Browse Source

YEAHgit pull

master
e-dt 3 years ago
parent
commit
c87f1ef0ad
  1. 11
      main.py

11
main.py

@ -77,15 +77,18 @@ import random
random.seed(505) random.seed(505)
random.shuffle(passengers) random.shuffle(passengers)
toad = 0 toad = 0
btime = 10 #passengers board every btime ticks
import os import os
def nunty(x): def nunty(x):
if x is None: return -1 if x is None: return -1
return x return x
def tick(): def tick(t):
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:
@ -98,7 +101,7 @@ def tick():
print() print()
print("---") print("---")
print(grid[3][0].occupant, grid[3][1].occupant, passengers[nunty(grid[3][1].occupant)].dest) print(grid[3][0].occupant, grid[3][1].occupant, passengers[nunty(grid[3][1].occupant)].dest)
if toad < len(passengers) and grid[3][0].occupant is None: if toad < len(passengers) and grid[3][0].occupant is None 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
@ -124,7 +127,9 @@ def tick():
exit() exit()
def run(): def run():
t = 0
while 1: while 1:
tick() tick(t)
t += 1
run() run()

Loading…
Cancel
Save