This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |