private double?Selection() { Board s = startState; while (policy.ContainsState(s)) { Move a = policy.GetMove(s); // make move. board switches players by itself Board newBoard; board.MakeMove(a, out newBoard); episode.Push(Tuple.Create(s, a)); s = newBoard; if (s.IsGameOver()) { return(s.Evaluate(startState.CurrentPlayer)); } } // Phase 2. Expand tree Expansion(s); return(null); }