board, player input
parent
e15032a589
commit
3bdf1ca979
@ -0,0 +1,23 @@
|
||||
board = [[" ", " ", " "],[" ", " ", " "],[" ", " ", " "]]
|
||||
|
||||
def print_board(board):
|
||||
print(f""" 1 2 3
|
||||
1 |{board[0][0]}|{board[0][1]}|{board[0][2]}|
|
||||
2 |{board[1][0]}|{board[1][1]}|{board[1][2]}|
|
||||
3 |{board[2][0]}|{board[2][1]}|{board[2][2]}|
|
||||
""")
|
||||
|
||||
def player(board):
|
||||
player_move = input("Zvol si radu a sloupec ")
|
||||
try:
|
||||
if board[int(player_move[0])][int(player_move[0])] == " ":
|
||||
pass
|
||||
else:
|
||||
print("Moznost nelze vybrat")
|
||||
player_move = input("Zvol si radu a sloupec ")
|
||||
except:
|
||||
print("Moznost nelze vybrat")
|
||||
player_move = input("Zvol si radu a sloupec ")
|
||||
|
||||
|
||||
player()
|
Loading…
Reference in New Issue