-
Notifications
You must be signed in to change notification settings - Fork 0
/
creating_board.py
53 lines (44 loc) · 1.2 KB
/
creating_board.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
""" Creating tic-tac-toe board """
def board1():
""" Printing Board style manually """
print(
" ______ ______ ______ \n \
| | | | \n \
| | | | \n \
|______|______|______| \n \
| | | | \n \
| | | | \n \
|______|______|______| \n \
| | | | \n \
| | | | \n \
|______|______|______| \n "
)
def board2():
""" Printing Board Style Using Iteration """
board = ""
for i in range(1, 8):
if i % 2 != 0:
board += " ______" * 3
else:
board += "| " * 4
board += "\n| | | |"
board += "\n"
print(board)
def board3():
""" Printing Board Style Using Iteration Version 2 """
board = ""
for i in range(1, 5):
if i == 1:
board += " ______" * 3
else:
board += "| " * 4
board += "\n| | | |"
board += "\n|______|______|______|"
board += "\n"
print(board)
board1()
print()
board2()
print()
board3()
print()