-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
46 lines (38 loc) · 1.05 KB
/
main.py
File metadata and controls
46 lines (38 loc) · 1.05 KB
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
import random
wantedInt = int(input("Enter a number from 1 to 6"))
row1 = ["O", "O", "O"]
row2 = ["O", "O", "O"]
row3 = ["O", "O", "O"]
def peter(randInt):
if randInt == 1:
row1 = ["O", "O", "O"]
row2 = ["O", "X", "O"]
row3 = ["O", "O", "O"]
if randInt == 2:
row1 = ["X", "O", "O"]
row2 = ["O", "O", "O"]
row3 = ["O", "O", "X"]
if randInt == 3:
row1 = ["X", "O", "O"]
row2 = ["O", "X", "O"]
row3 = ["O", "O", "X"]
if randInt == 4:
row1 = ["X", "O", "X"]
row2 = ["O", "O", "O"]
row3 = ["X", "O", "X"]
if randInt == 5:
row1 = ["X", "O", "X"]
row2 = ["O", "X", "O"]
row3 = ["X", "O", "X"]
if randInt == 6:
row1 = ["X", "O", "X"]
row2 = ["X", "O", "X"]
row3 = ["X", "O", "X"]
return (row1, row2, row3)
while True:
RandomInt = random.randrange(1, 7)
for row in peter(RandomInt):
print(row)
print("------------------------------------")
if RandomInt == wantedInt:
break