public Node(TicTacToe ttt, int move, int height) { this.ttt = ttt; this.move = move; this.height = height; ttt.Setze(move / ttt.Size, move % ttt.Size); if (ttt.GameEnd) { if (ttt.Winner != ' ') { if (ttt.Winner == ttt.player1) { losses++; } else { wins++; } } else { ties++; } ProcessVals(); } else { ProccessNextMoves(); } }
public void NextMove() { curr = curr.nodes[game.lastMove]; Node next = null; foreach (Node n in curr.nodes.Values) { if (next == null) { next = n; } else if (next.val < n.val) { next = n; } } curr = next; game.Setze(curr.move / game.Size, curr.move % game.Size); }