def main(stdscr): try: player = cage.CursesPlayer(stdscr) map = cage.MooreMap(player.size) automaton = cage.TwoStateReductionAutomaton(map, operator.or_) cage.SeedInitializer(5).initialize(automaton) player.main(automaton) finally: player.done()
def main(stdscr): global RULES rule = sys.argv[1] if rule in RULES: rule = RULES[rule] try: player = cage.CursesPlayer(stdscr) map = cage.MooreMap(player.size) automaton = cage.TwoStateTotalisticAutomaton(map, rule) cage.RandomInitializer().initialize(automaton) player.main(automaton) finally: player.done()
def __init__(self, size, twist=True): cage.SynchronousAutomaton.__init__(self, cage.MooreMap(size)) if twist: self.table = self.twistTable else: self.table = self.normalTable
def __init__(self, size): cage.SynchronousAutomaton.__init__(self, cage.MooreMap(size))