-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgol
34 lines (29 loc) · 749 Bytes
/
gol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
import sys
import consts as Consts
import GameOfLifeSimulation as GOLS
import tk_draw
DEBUG = True
def loadInitialConfiguration(filename):
if DEBUG:
print(filename)
pass
def main(args):
gols = GOLS.GameOfLifeSimulation()
if DEBUG:
print('initial field : ')
gols.field.dump()
instance = tk_draw.getInstance()
window = tk_draw.getWindow(instance, gols)
ids = tk_draw.initWindow(window, gols)
if DEBUG:
print(ids)
tk_draw.attachUpdater(instance, window, ids, gols)
tk_draw.attachMainloop(instance)
if DEBUG:
print('done')
if __name__ == '__main__':
if len(sys.argv) in (1, 2):
main(sys.argv[1:])
else:
print(Consts.USAGE)