def main(stdscr): try: player = cage.CursesPlayer(stdscr) automaton = VoteAutomaton(player.size) cage.RandomInitializer().initialize(automaton) player.main(automaton) finally: player.done()
def main(stdscr): states = int(sys.argv[1]) threshold = float(sys.argv[2]) try: player = cage.CursesPlayer(stdscr) automaton = SteppingStoneAutomaton(player.size, states, threshold) cage.RandomInitializer().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 main(): player = None try: player = cage.ImagePlayer(400, 600) automaton = cage.LinearCodedAutomaton(player.size, RULE) rightMostAddress = player.size[0] - 1, if RANDOM: initializer = cage.RandomInitializer() else: initializer = cage.PointInitializer(rightMostAddress) initializer.initialize(automaton) player.main(automaton) finally: if player is not None: player.done()
def main(): player = None k = 2 r = 2 total = 2 * k**(2 * r + 1) for code in range(0, total + 1, 2): print "%d/%d" % (code, total) try: player = cage.LinePlayer(79) automaton = LinearTotalisticAutomaton(player.size, k, r, code) cage.RandomInitializer().initialize(automaton) player.main(automaton) finally: if player is not None: player.done() print