Created
April 6, 2020 18:37
-
-
Save BetterProgramming/30d4d2e378f2f0d671ccd59f7a2c99d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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