public override Node GetNextState(int move) { int[,] nextBoard = (int[, ])board.Clone(); MiniCoord nextCoord = miniBoard; int x = move / 9; int y = move % 9; nextBoard[x, y] = ActivePlayer; nextCoord.Set(x % 3, y % 3); if (MiniWinner(nextCoord) != -1 || MiniFull(nextCoord)) { nextCoord.Reset(); } return(new UltimateTicTacToeNode() { ActivePlayer = (ActivePlayer + 1) % 2, board = nextBoard, miniBoard = nextCoord }); }
bool MiniFull(MiniCoord coord) { return(MiniFull(coord.X, coord.Y)); }
int MiniWinner(MiniCoord coord) { return(MiniWinner(coord.X, coord.Y)); }