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

Loading…
Cancel
Save