EtherealEntity 3 years ago
parent
commit
14c20746c0
  1. 11
      main.py

11
main.py

@ -1,4 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import random as rnd
from enum import Enum from enum import Enum
class SquareType(Enum): class SquareType(Enum):
@ -6,9 +7,10 @@ class SquareType(Enum):
SEAT = 1 SEAT = 1
height=7 height=7
width=33 width=32
class GridSquare: class GridSquare:
#typ: SquareType, occupant: index
def __init__(self, typ, occupant): def __init__(self, typ, occupant):
self.typ = typ self.typ = typ
self.occupant = occupant self.occupant = occupant
@ -47,10 +49,15 @@ def nextSquare(passenger, grid):
return candidati[0] return candidati[0]
def GenPassList(): def GenPassList():
return [] 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)])
return border
grid=makeGrid() grid=makeGrid()
#boarding order
passengers = GenPassList() passengers = GenPassList()
for index, i in enumerate(passengers): for index, i in enumerate(passengers):
grid[i.curr[0]][i.curr[1]] = index grid[i.curr[0]][i.curr[1]] = index

Loading…
Cancel
Save