|
|
@ -1,6 +1,7 @@ |
|
|
|
#!/usr/bin/env python3 |
|
|
|
import random as rnd |
|
|
|
from enum import Enum |
|
|
|
|
|
|
|
class SquareType(Enum): |
|
|
|
AISLE = 0 |
|
|
|
SEAT = 1 |
|
|
@ -26,6 +27,8 @@ class Passenger: |
|
|
|
def __init__(self, dest, curr): |
|
|
|
self.dest = dest |
|
|
|
self.curr = curr |
|
|
|
def __str__(self): |
|
|
|
return "(%s|%s)" % (dest, curr) |
|
|
|
|
|
|
|
def manhattanDistance(pos1, pos2): |
|
|
|
return abs(pos1[0] - pos2[0]) + abs(pos1[1] - pos2[1]) |
|
|
@ -62,6 +65,7 @@ toad = 0 |
|
|
|
def tick(): |
|
|
|
global toad |
|
|
|
# print grid |
|
|
|
print(grid) |
|
|
|
for row in grid: |
|
|
|
for guy in row: |
|
|
|
if guy.occupant is not None: |
|
|
|