package makise.othello; import othello.*; import java.awt.Point; /* (その回で)一番多く取れる場所に置くプレーヤー */ public class ManyReversePlayer implements OthelloPlayer { private int myColor; public void init(int color, boolean first, String param) { myColor = color; } public Point nextHand(OthelloBoard board) { int maxCount = -1, maxX = 0, maxY = 0; for (int y = 0; y < 8; y++) { for (int x = 0; x < 8; x++) { int count = board.countReversiblePieces(x, y, myColor); if (0 < count) { if (count > maxCount) { maxCount = count; maxX = x; maxY = y; } } } } return new Point(maxX, maxY); } }