<commit_before>new require('styles/dark')
module.exports = class extends require('base/drawapp'){ //top
	prototype() {
		this.tools = {
			Quad:{
				dead :0,
				pixel:function() {$
					
					this.viewport()
					this.rect(0, 0, this.w, this.h)
					this.fillKeep('orange')
					this.stroke(mix('blue', 'red', this.dead), 4.)
					
					return this.result
				}
			}
		}
	}
	
	onKeyDown(e) {
		if(e.name === 'upArrow') {
			this.dir = [0,  - 1]
		}
		if(e.name === 'downArrow') {
			this.dir = [0, 1]
		}
		if(e.name === 'leftArrow') {
			this.dir = [ - 1, 0]
		}
		if(e.name === 'rightArrow') {
			this.dir = [1, 0]
		}
	}
	
	constructor() {
		super()
		this.snake = [[0, 0]]
		this.len = 10
		this.dir = [1, 0]
		this.border = [0, 0, 20, 20]
		this.dead = false
	}
	
	step() {
		if(this.dead) return
		let head = this.snake[0]
		let next = [
			head[0] + this.dir[0],
			head[1] + this.dir[1]
		]
		this.snake.unshift(next)
		if(next[0] < this.border[0]) this.dead = true
		if(next[1] < this.border[1]) this.dead = true
		if(next[0] >= this.border[2]) this.dead = true
		if(next[1] >= this.border[3]) this.dead = true
		if(this.snake.length > this.len) 
		this.snake.pop()
	}
	
	onDraw() {<commit_msg>snake<commit_after>new require('styles/dark')
module.exports = class extends require('base/drawapp'){ //top
	prototype() {
		this.tools = {
			Quad:{
				dead :0,
				pixel:function() {$
					
					this.viewport()
					this.rect(0, 0, this.w, this.h)
					this.fillKeep('orange')
					this.stroke(mix('blue', 'red', this.dead), 4.)
					
					return this.result
				}
			}
		}
	}
	
	onKeyDown(e) {
		if(e.name === 'upArrow') {
			this.dir = [0,  - 1]
		}
		if(e.name === 'downArrow') {
			this.dir = [0, 1]
		}
		if(e.name === 'leftArrow') {
			this.dir = [ - 1, 0]
		}
		if(e.name === 'rightArrow') {
			this.dir = [1, 0]
		}
	}
	
	constructor() {
		super()
		this.start()
	}
	
	start() {
		this.snake = [[0, 0]]
		this.len = 10
		this.dir = [1, 0]
		this.border = [0, 0, 20, 20]
		this.dead = false
	}
	
	step() {
		if(this.dead) return
		let head = this.snake[0]
		let next = [
			head[0] + this.dir[0],
			head[1] + this.dir[1]
		]
		this.snake.unshift(next)
		if(next[0] < this.border[0]) this.dead = true
		if(next[1] < this.border[1]) this.dead = true
		if(next[0] >= this.border[2]) this.dead = true
		if(next[1] >= this.border[3]) this.dead = true
		if(this.snake.length > this.len) {
			this.snake.pop()
		}
		if(this.dead) {
			setTimeout(_=>this.start(), 200)
		}
	}
	
	onDraw() {
{'fraction_non_alphanumeric': 0.20824989987985582, 'fraction_numerical': 0.030837004405286344, 'mean_word_length': 2.4694444444444446, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7011770', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1067, 'n_words': 197}