-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhall.py
33 lines (29 loc) · 1.2 KB
/
hall.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
class Hall:
SEATS = 100
BUSY_SEAT = "X"
FREE_SEAT = "."
MAX_ROW = 10
MIN_ROW = 1
MAX_COL = 10
MIN_COL = 1
def __init__(self):
self.places = [
[' ', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
['1 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['2 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['3 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['4 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['5 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['6 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['7 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['8 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['9 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['10', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.']
]
def set_busy_seat(self, row, col):
self.places[row][col] = 'X'
def print_places(self):
for i in range(len(self.places)):
for j in range(len(self.places[0])):
print(self.places[i][j], end=' ')
print()