Skip to content

Instantly share code, notes, and snippets.

View ponyta's full-sized avatar

Chun Li ponyta

View GitHub Profile
@ponyta
ponyta / lisp.py
Created August 8, 2018 14:39
lisp parser
#!/usr/bin/env python3
from enum import Enum, auto
# Represents an AST Node
class Node:
def __init__(self, key, children=None):
self.key = key
self.children = children
@ponyta
ponyta / gameoflife.js
Created July 30, 2018 20:58
Conway's Game of Life
// source can be found at https://git.chunli.me/life.git/
// For a demo, please see https://chunli.me/life/
// initialization
let canvas = document.querySelector("#canvas");
var ctx = canvas.getContext("2d");
var running = false;
var UPDATE_INTERVAL = 100; // time between updates in ms
var CELL_SIZE = 10; // 10x10px cell size
// game grid size