Browse Source

Merge branch 'master' of https://git.e-dt.xyz/e-dt/bodice

master
iamsosmart19 3 years ago
parent
commit
83e22ac7ae
  1. 17
      main.py

17
main.py

@ -51,20 +51,20 @@ def nextSquare(passenger, grid):
def GenPassList(): def GenPassList():
border = [Passenger((0, a),(-1,-1)) for a in range(0,3)] border = [Passenger((0, a),(-1,-1)) for a in range(0,3)]
for x in range(1,width): for x in range(1,width):
border.append([Passenger((x, a),(-1,-1)) for a in range(0,3)]) border += [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(4,7)]
return border return border
grid=makeGrid() grid=makeGrid()
#boarding order #boarding order
passengers = GenPassList() passengers = GenPassList()
for index, i in enumerate(passengers):
grid[i.curr[0]][i.curr[1]] = index toad = 0
def tick(): def tick():
global toad
# print grid # print grid
print(grid)
for row in grid: for row in grid:
for guy in row: for guy in row:
if guy.occupant is not None: if guy.occupant is not None:
@ -74,12 +74,15 @@ def tick():
else: else:
print(" ", end="") print(" ", end="")
print() 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): for (i, man) in enumerate(passengers):
#im sexist #im sexist
cp = man.curr cp = man.curr
man.curr = nextSquare(man, grid) man.curr = nextSquare(man, grid)
grid[cp[0]][cp[1]] = 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]] = i grid[man.curr[0]][man.curr[1]].occupant = i
def run(): def run():
while 1: while 1:

Loading…
Cancel
Save