Skip to content

Instantly share code, notes, and snippets.

@googkhan
Created May 1, 2019 21:19
Show Gist options
  • Save googkhan/87273c3e27fd424cce314f6640a6a1d4 to your computer and use it in GitHub Desktop.
Save googkhan/87273c3e27fd424cce314f6640a6a1d4 to your computer and use it in GitHub Desktop.
while True:
board = """
- - -
- - -
- - -
"""
user1_x = int(input("x kordinati gir: "))
user1_y = int(input("y kordinati gir: "))
# 1,1 boardun 1
# 1,2 boardun 3
# 1,3 boardun 5
# 2,1 boardun 6
# 2,2 boardun 8
# 2,3 boardun 10
# 3,1 boardun 11
# 3,2 boardun 13
# 3,3 boardun 15
if user1_x == 1 and user1_y == 1:
board[1] = "x"
print(board)
elif user1_x == 1 and user1_y == 2:
board[3] = board[3].replace("-", "x")
print(board)
elif user1_x == 1 and user1_y == 3:
board[5] = board[5].replace("-", "x")
print(board)
elif user1_x == 2 and user1_y == 1:
board[7] = board[7].replace("-", "x")
print(board)
elif user1_x == 2 and user1_y == 2:
board = board[9].replace("-", "x")
print(board)
elif user1_x == 2 and user1_y == 3:
board = board[11].replace("-", "x")
print(board)
elif user1_x == 3 and user1_y == 1:
board = board[13].replace("-", "x")
print(board)
elif user1_x == 3 and user1_y == 2:
board = board[15].replace("-", "x")
print(board)
elif user1_x == 3 and user1_y == 3:
board = board[17].replace("-", "x")
print(board)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment