Created
January 12, 2019 20:01
-
-
Save luxu/d22ef1176255ae07ec26dc6c96860c3a 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
tabuleiro = {'top-L':' ','top-M':' ','top-R':' ', | |
'mid-L':' ','mid-M':' ','mid-R':' ', | |
'low-L':' ','low-M':' ','low-R':' '} | |
def imprimeTabuleiro(tabuleiro): | |
print(tabuleiro['top-L'] + '|' + tabuleiro['top-M'] + '|' + tabuleiro['top-R']) | |
print('-+-+-') | |
print(tabuleiro['mid-L'] + '|' + tabuleiro['mid-M'] + '|' + tabuleiro['mid-R']) | |
print('-+-+-') | |
print(tabuleiro['low-L'] + '|' + tabuleiro['low-M'] + '|' + tabuleiro['low-R']) | |
turn = 'X' | |
for i in range(9): | |
print(imprimeTabuleiro(tabuleiro)) | |
print('Turn for ' + turn + '. Move on which space?') | |
move = input() | |
tabuleiro[move] = turn | |
if turn == 'X': | |
turn = 'O' | |
else: | |
turn = 'X' | |
print(imprimeTabuleiro(tabuleiro)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment