Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if __name__ == "__main__":
print('Welcome to Tic Tac Toe!')
i = 1
# Choose your side
players=player_input()
# Empty board init
board = ['#'] * 10
while True:
# Set the game up here
game_on=full_board_check(board)
while not game_on:
# Player to choose where to put the mark
position = player_choice(board)
# Who's playin ? Choose the marker
if i % 2 == 0:
marker = players[1]
else:
marker = players[0]
# Play !
place_marker(board, marker, int(position))
# Check the board
display_board(board)
i += 1
if win_check(board, marker):
print("You won !")
break
game_on=full_board_check(board)
if not replay():
break
else:
i = 1
# Choose your side
players=player_input()
# Empty board init
board = ['#'] * 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment