McRunnable implements Runnable { public Color playout(boolean mercy) { if (board.getTurn() >= coords.getMaxMovesPerGame()) { return VACANT; } if (board.getPasses() < 2) { selectAndPlayOneMove(false); fancyHashes[board.getTurn()] = board.getFancyHash(); } if (board.getPasses() >= 2) { return scorer.winner(); } if (mercy) { final Color mercyWinner = mercyObserver.mercyWinner(); if (mercyWinner != null) { return mercyWinner; } } do { if (board.getTurn() >= coords.getMaxMovesPerGame()) { return VACANT; } if (board.getPasses() < 2) { selectAndPlayOneMove(true); } if (board.getPasses() >= 2) { return scorer.winner(); } if (mercy) { final Color mercyWinner = mercyObserver.mercyWinner(); if (mercyWinner != null) { return mercyWinner; } } } while (true); } McRunnable(Player player, CopiableStructure stuff); void acceptMove(short p); void copyDataFrom(Board that); Board getBoard(); long[] getFancyHashes(); HistoryObserver getHistoryObserver(); ShortSet getPlayedPoints(); Player getPlayer(); long getPlayoutsCompleted(); MersenneTwisterFast getRandom(); Suggester[] getSuggesters(); int getTurn(); boolean isFeasible(short p); Color performMcRun(); Color performMcRun(boolean mercy); Color playout(boolean mercy); @Override void run(); Rater[] getRaters(); ShortList getCandidates();  }
@Test public void testPlayout() { String[] blackWins = { ".##O.", "..#OO", "###O.", "..#OO", ".####", }; player.getBoard().setUpProblem(blackWins, WHITE); String[] whiteWins = { ".#O..", ".#O.O", "##OOO", ".#O.O", ".#O..", }; runnable.getBoard().setUpProblem(whiteWins, WHITE); assertEquals(BLACK, runnable.performMcRun()); }