Exemplo n.º 1
0
def main(stdscr):
    try:
        player = cage.CursesPlayer(stdscr)
        size = player.size
        automaton = Automaton(size)
        cage.PointInitializer(state=Automaton.FIRING).initialize(automaton)
        player.main(automaton)
    finally:
        player.done()
Exemplo n.º 2
0
def main():
    player = None
    try:
        player = NaschImagePlayer(len(highway), iters)
        automaton = NaschAutomaton(player.size, vmax, p)
        x = 0
        for c in highway:
            cage.PointInitializer((x, ), c).initialize(automaton)
            x += 1
        player.main(automaton)
    except Exception as e:
        print str(e)
    finally:
        player.done()
Exemplo n.º 3
0
def main():
    player = None
    total = 256
    for code in range(total):
        print("%d/%d" % (code, total))
        try:
            player = cage.LinePlayer(79)
            automaton = TimedLinearCodedAutomaton(player.size, code)
            cage.PointInitializer().initialize(automaton)
            player.main(automaton)
        finally:
            if player is not None:
                player.done()
            player = None
        print()
Exemplo n.º 4
0
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()