diff --git a/main.py b/main.py index d751bf8..7e5f293 100644 --- a/main.py +++ b/main.py @@ -51,20 +51,20 @@ def nextSquare(passenger, grid): def GenPassList(): border = [Passenger((0, a),(-1,-1)) for a in range(0,3)] for x in range(1,width): - border.append([Passenger((x, a),(-1,-1)) for a in range(0,3)]) - border.append([Passenger((x, a),(-1,-1)) for a in range(4,7)]) + border += [Passenger((x, a),(-1,-1)) for a in range(0,3)] + border += [Passenger((x, a),(-1,-1)) for a in range(4,7)] return border grid=makeGrid() #boarding order passengers = GenPassList() -for index, i in enumerate(passengers): - grid[i.curr[0]][i.curr[1]] = index + +toad = 0 def tick(): + global toad # print grid - print(grid) for row in grid: for guy in row: if guy.occupant is not None: @@ -74,12 +74,15 @@ def tick(): else: print(" ", end="") print() + if toad < len(passengers): + grid[passengers[toad].curr[0]][passengers[toad].curr[1]].occupant = toad #added + toad += 1 for (i, man) in enumerate(passengers): #im sexist cp = man.curr man.curr = nextSquare(man, grid) - grid[cp[0]][cp[1]] = None #they move out of there - grid[man.curr[0]][man.curr[1]] = i + grid[cp[0]][cp[1]].occupant = None #they move out of there + grid[man.curr[0]][man.curr[1]].occupant = i def run(): while 1: