ChinesePlayoutScorer implements PlayoutScorer { @Override public double score() { final CoordinateSystem coords = board.getCoordinateSystem(); double result = komi; for (final short p : coords.getAllPointsOnBoard()) { final Color color = board.getColorAt(p); if (color == BLACK) { result++; } else if (color == WHITE) { result--; } else { if (board.hasMaxNeighborsForColor(BLACK, p)) { result++; } else if (board.hasMaxNeighborsForColor(WHITE, p)) { result--; } } } return result; } ChinesePlayoutScorer(Board board, double komi); @Override double getKomi(); @Override double score(); @Override Color winner();  }
@Test public void testScore() { String[] before = { ".#OO.", "###OO", ".#.O.", "##OOO", "OOO.O", }; board.setUpProblem(before, WHITE); assertEquals(-13.5, scorer.score(), 0.1); }