Skip to content

Instantly share code, notes, and snippets.

View collares's full-sized avatar

Mauricio Collares collares

View GitHub Profile
@collares
collares / cell_store.py
Last active August 25, 2022 12:33
An implementation of Bill Gosper's hashlife algorithm
class Store(object):
LOG_MAX_UNIVERSE = 60
# This is arbitrary, but it simplifies get_empty below.
DEAD_HASH = 0
ALIVE_HASH = LOG_MAX_UNIVERSE + 1
class MacrocellData(object):
def __init__(self, quadrants, result):
self.quadrants = quadrants