Exemple #1
0
        #gridpy.set_style(gridpy.TRIPLE)
        #gridpy.set_style(gridpy.DOUBLE)
        #gridpy.set_style(gridpy.SINGLE)
        #gridpy.set_style(gridpy.NONE)

        gridpy.title(GUI.TITLE % self.dim)

    def run(self):
        self.config()
        gridpy.show()
        self.main_loop()

    def main_loop(self):
        while True:
            self.game.tick()
            #print "--- Game Matrix ---"
            #print self.game
            for cell, position in self.game.cells():  
                gridpy.plot(GUI.CELL_COLOR, position)
            gridpy.update()
            gridpy.clear()

if __name__ == "__main__":
    r = Reader(open("test.life"))
    #print "--- Text File ---"
    #print r
    g = GUI(r.get_char_map())
    #print "--- Game Matrix ---"
    #print g.game
    g.run()
Exemple #2
0
#!/usr/bin/python2

from gui    import GUI
from reader import Reader

import sys

f = None
if len(sys.argv) > 1:
    f = open(sys.argv[1])
else:
    f = sys.stdin

the_reader = Reader(f)
the_gui    = GUI(the_reader.get_char_map())

the_gui.run()