TTT v0.2.0 TTT.Core.Logic View Source
This module represents and controlls the flow of the game play.
Link to this section Summary
Functions
Parameters
Parameters
If the game ends in a draw, it’ll display a message with the result
Parameters
Parameters
Link to this section Functions
## Parameters
- game: Struct of the game.
- starting_move: Interger that represents the first move the navie computer player will take.
## Example: starting_move = 1 => {0, 0} Recursive function calls with incremented starting_move if cell is taken. Returns the move in coordinate if move is available.
## Parameters
- game: Struct of the game.
Recursive function calls with randomly generated move if cell is taken. Returns the move in coordinate if move is available.
If the game ends in a draw, it’ll display a message with the result.
## Parameters
- game: Struct of the game.
- last_player: Struct of the last player played.
Returns the player who plays next.
## Parameters
- board: Map of the board.
- game: Struct of the game.
Convert each player’s moves into a list and calls render_board, passing in a map of the list with the players’ tokens to generate new UI to reflect the new board.