Add docstring

This commit is contained in:
Chris Proctor 2022-04-28 19:12:52 -04:00
parent c465a8406c
commit f10c39531f
1 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ class TTTGame:
}
def play_move(self, move):
"Updates the game's state by recording a move"
if not self.is_valid_move(move):
raise ValueError(f"Illegal move {move} with board {self.board}.")
self.board[move] = self.get_current_player_symbol()
@ -20,7 +21,7 @@ class TTTGame:
return [index for index in range(9) if self.board[index] is None]
def is_valid_move(self, move):
"Checks whether a move is valid."
"Checks whether a move is valid"
return move in self.get_valid_moves()
def get_current_player_symbol(self):