From f6f546de9519a736ec886a4389163474b65a85e4 Mon Sep 17 00:00:00 2001 From: EtherealEntity Date: Wed, 23 Mar 2022 11:40:24 +1100 Subject: [PATCH] tick counter. final tick print. tick modulator. --- main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index d5a7e64..dc53496 100644 --- a/main.py +++ b/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()