repl.it
@aaku/

PeacefulSimilarUsername

Python

No description

fork
loading
Files
  • main.py
main.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
x_or_o = input("Does player 1 want to be X or O?")
num_on_board = ['1','2','3','4','5','6','7','8','9']
taken_out = ['','','','','','','','','']
marker = ""
marker_2 = ""
space1 = [""]
space2 = [""]
space3 = [""]
space4 = [""]
space5 = [""]
space6 = [""]
space7 = [""]
space8 = [""]
space9 = [""]
space_1 = [""]
space_2 = [""]
space_3 = [""]
space_4 = [""]
space_5 = [""]
space_6 = [""]
space_7 = [""]
space_8 = [""]
space_9 = [""]
def pseudo_board():
  print("  |".join(['1','2','3']))
  print("-----------")
  print("  |".join(['4','5','6']))
  print("-----------")
  print("  |".join(['7','8','9']))
if marker == " X":
  marker =  " O"
elif marker == "O":
  marker_2 = "X"
def ply1_x():
  placement = input("where does player 1 want to play?:")
  print('')
  if placement == num_on_board[0]:
    space_1[0] = marker
    print(space_1[0],"  |",space2[0],"  |",space3[0])
    print("--------------")
    print(space4[0],"   |",space5[0],"  |",space6[0])
    print("--------------")
    print(space7[0],"   |",space8[0],"  |",space9[0])
    taken_out.append(num_on_board[0])
    num_on_board.remove(num_on_board[0])
  elif placement == num_on_board[1]:
    space_2 = marker
    print(space1[0],"   |",space_2[0]," |",space3[0])
    print("--------------")
    print(space4[0],"   |",space5[0],"  |",space6[0])
    print("--------------")
    print(space7[0],"   |",space8[0],"  |",space9[0])
    taken_out.append(num_on_board[0])
    num_on_board.remove(num_on_board[0])
  elif placement == num_on_board[2]:
    space_3 = marker
    print(space1[0],"   |",space2[0],"  |",space_3[0])
    print("--------------")
    print(space4[0],"   |",space5[0],"  |",space6[0])
    print("--------------")
    print(space7[0],"   |",space8[0],"  |",space9[0])
    taken_out.append(num_on_board[0])
    num_on_board.remove(num_on_board[0])
  elif placement == num_on_board[3]:
    space_4 = marker
    print(space1[0]," |",space2[0]," |",space3[0])
    print("---------")
    print(space_4[0]," |",space5[0]," |",space6[0])
    print("---------")
    print(space7[0]," |",space8[0]," |",space9[0])
    taken_out.append(num_on_board[0])
    num_on_board.remove(num_on_board[0])
  elif placement == num_on_board[4]:
    space_5 = marker
    print(space1[0]," |",space2[0]," |",space3[0])
    print("---------")
    print(space4[0]," |",space_5[0]," |",space6[0])
    print("---------")
    print(space7[0]," |",space8[0]," |",space9[0])
    taken_out.append(num_on_board[0])
    num_on_board.remove(num_on_board[0])
  elif placement == num_on_board[5]:
    space_6 = marker
    print(space1[0]," |",space2[0]," |",space_3[0])
    print("---------")
    print(space4[0]," |",space5[0]," |",space_6[0])
    print("---------")
    print(space7[0]," |",space8[0]," |",space9[0])
    taken_out.append(num_on_board[0])
    num_on_board.remove(num_on_board[0])
  elif placement == num_on_board[6]:
    space_7 = marker
    print(space1[0]," |",space2[0]," |",space_3[0])
    print("---------")
    print(space4[0]," |",space5[0]," |",space6[0])
    print("---------")
    print(space_7[0]," |",space8[0]," |",space9[0])
    taken_out.append(num_on_board[0])
    num_on_board.remove(num_on_board[0])
  elif placement == num_on_board[7]:
    space_8 = marker
    print(space1[0]," |",space2[0]," |",space_3[0])
    print("---------")
    print(space4[0]," |",space5[0]," |",space6[0])
    print("---------")
    print(space7[0]," |",space_8[0]," |",space9[0])
    taken_out.append(num_on_board[0])
    num_on_board.remove(num_on_board[0])
  elif placement == num_on_board[8]:
    space_9 = marker
    print(space1[0]," |",space2[0]," |",space_3[0])
    print("---------")
    print(space4[0]," |",space5[0]," |",space6[0])
    print("---------")
    print(space7[0]," |",space8[0]," |",space_9[0])
    taken_out.append(num_on_board[0])
    num_on_board.remove(num_on_board[0])
if x_or_o == "x":
  marker = " X"
  print("Player 1 is X. Player 2 is O")
  print('')
  print(space1[0],"   |",space2[0],"   |",space3[0])
  print("------------------")
  print(space4[0],"   |",space5[0],"   |",space6[0])
  print("------------------")
  print(space7[0],"   |",space8[0],"   |",space9[0])
  print('')
  print("Choose a spot to place your piece 1-9. Use board below for help")
  pseudo_board()
  ply1_x()
elif x_or_o =="o":
  marker = " O"
  print("Player 1 is O. Player 2 is X")
  print('')
  print('')
  print("Choose a spot to place your piece 1-9. Use board below for help")
  pseudo_board()
Fetching token
?