Browse Source

tick counter. final tick print. tick modulator.

master
EtherealEntity 3 years ago
parent
commit
f6f546de95
  1. 12
      main.py

12
main.py

@ -73,11 +73,12 @@ grid=makeGrid()
passengers = GenPassList(grid) passengers = GenPassList(grid)
toad = 0 toad = 0
btime = 10 #passengers board every btime ticks
def tick(t):
def tick():
done=True done=True
global toad global toad
global btime
# print grid # print grid
for row in grid: for row in grid:
for guy in row: for guy in row:
@ -89,7 +90,7 @@ def tick():
print(".", end="") print(".", end="")
print() print()
print("---") print("---")
if toad < len(passengers): if toad < len(passengers) and t % btime == 0:
grid[3][0].occupant = toad #added grid[3][0].occupant = toad #added
passengers[toad].curr = (3, 0) passengers[toad].curr = (3, 0)
toad += 1 toad += 1
@ -105,10 +106,13 @@ def tick():
grid[cp[0]][cp[1]].occupant = None #they move out of there grid[cp[0]][cp[1]].occupant = None #they move out of there
grid[man.curr[0]][man.curr[1]].occupant = i grid[man.curr[0]][man.curr[1]].occupant = i
if done: if done:
print("Final Tick: " + t);
exit() exit()
def run(): def run():
t = 0
while 1: while 1:
tick() t += 1
tick(t)
run() run()

Loading…
Cancel
Save