func takeTurn(board board.Board, playerOne, playerTwo iplayer.Player, movesPlayed []int) []int { currentPlayer := gamestate.GetCurrentPlayer(board, playerOne, playerTwo) if currentPlayer.IsComputer() { move := currentPlayer.GetMove(board, currentPlayer.GetMark(), gamestate.GetOpponentMark(currentPlayer.GetMark())) board.PlaceMove(move, currentPlayer.GetMark()) movesPlayed = append(movesPlayed, move) } return movesPlayed }
func rebuildBoard(board board.Board, movesPlayed []int) { for _, move := range movesPlayed { board.PlaceMove(move, gamestate.GetCurrentMark(board)) } }