repl.it
@aaku/

Func Tic Tac Toe

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
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']
space_1 = ["-"]
space_2 = ["-"]
space_3 = ["-"]
space_4 = ["-"]
space_5 = ["-"]
space_6 = ["-"]
space_7 = ["-"]
space_8 = ["-"]
space_9 = ["-"]
num_on_board[0] == space_1[0]
num_on_board[1] == space_2[0]
num_on_board[2] == space_3[0]
num_on_board[3] == space_4[0]
num_on_board[4] == space_5[0]
num_on_board[5] == space_6[0]
num_on_board[6] == space_7[0]
num_on_board[7] == space_8[0]
num_on_board[8] == space_9[0]
space_board = [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']))
def board():
  print(space_1[0]," |",space_2[0]," |",space_3[0])
  print("------------")
  print(space_4[0]," |",space_5[0]," |",space_6[0])
  print("------------")
  print(space_7[0]," |",space_8[0]," |",space_9[0])
if x_or_o == "x":
  print("Player 1 is X. Player 2 is O.")
  pseudo_board()
  board()
  print("Place a piece using the corresponding values from number board.")
  placement = input("Where to play?")
  if placement == "1":
    space_1[0] = "X"
    board()
    space_1[0] = tuple(space_1[0])
  if placement =
Fetching token
?