MCPcopy Create free account
hub / github.com/geekcomputers/Python / get_player_move

Function get_player_move

Tic-Tac-Toe Games/tic-tac-toe5.py:111–119  ·  view source on GitHub ↗

Get the player's next valid move.

(board: List[str])

Source from the content-addressed store, hash-verified

109
110
111def get_player_move(board: List[str]) -> int:
112 """Get the player's next valid move."""
113 move: str = " "
114 while move not in "1 2 3 4 5 6 7 8 9".split() or not is_space_free(
115 board, int(move)
116 ):
117 print("What is your next move? (1-9)")
118 move = input()
119 return int(move)
120
121
122def choose_random_move_from_list(

Callers 1

mainFunction · 0.85

Calls 1

is_space_freeFunction · 0.85

Tested by

no test coverage detected