repl.it
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
# A Tic Tac Tao 
# Tutorial from clever programmer :) but at the same time I learn

# Board
board = ["-","-","-",
        "-","-","-",
        "-","-","-"]
# Display board
def display_board():     # " | "  <---- I neeeded this
    print(board[0] + " | " + board[1] + " | "  + board[2])
    print(board[3] + " | " + board[4] + " | "  + board[5])
    print(board[6] + " | " + board[7] + " | "  + board[8])

# Play Game
def play_game():
    # Print initial board
    display_board()
    handle_turn()

def handle_turn():
  position = input("Choose a position from 1 to 9: ")

play_game()
 
# Handle a turn
# Check win
   # Check rows
   # Check columms
   # Check diagonals
#Chect tie
# Flip player
Fetching token
?