Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created April 6, 2020 18:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BetterProgramming/30d4d2e378f2f0d671ccd59f7a2c99d2 to your computer and use it in GitHub Desktop.
Save BetterProgramming/30d4d2e378f2f0d671ccd59f7a2c99d2 to your computer and use it in GitHub Desktop.
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