-
Notifications
You must be signed in to change notification settings - Fork 0
/
02_Amazing.py
39 lines (35 loc) · 986 Bytes
/
02_Amazing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from functions import *
class Room:
def __init__(self) -> None:
self.left = None
self.right = None
self.down = None
self.up = None
class Maze:
def __init__(self, length, width) -> None:
self.length = length
self.width = width
self.rooms = []
def create_maze(self) -> None:
for y in range(self.width):
self.rooms.append([])
for x in range(self.length):
self.rooms[y].append(Room())
def draw_rooms(self) -> None:
for y in range(len(self.rooms)):
for room in self.rooms[y]:
if y == 0:
print(" __", end="")
continue
print("|__", end="")
if y == 0:
print(" __")
else:
print("|__|")
def main():
clearConsole()
maze = Maze(15, 10)
maze.create_maze()
maze.draw_rooms()
if __name__ == "__main__":
main()