You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
582 B
Python
24 lines
582 B
Python
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()
|