Commit 8ffc004b authored by Stefano Cobelli's avatar Stefano Cobelli

Blocker player priorities straightened out

parent f33f2e8a
......@@ -88,9 +88,35 @@ public class BlockerPlayer extends Player implements AutoPlayable {
}
// prioritizing middle
// if (theBoard.isEmpty(theBoard.getSize() / 2, theBoard.getSize() / 2))
System.out.println("Getting random");
if (theBoard.isEmpty(theBoard.getSize() / 2, theBoard.getSize() / 2)) {
move(theBoard.getSize() / 2, theBoard.getSize() / 2);
Integer[] answer = { theBoard.getSize() / 2, theBoard.getSize() / 2 };
return answer;
}
// top left corner
if (theBoard.isEmpty(0, 0)) {
move(0, 0);
Integer[] answer = { 0, 0 };
return answer;
}
// top right corner
if (theBoard.isEmpty(theBoard.getSize() - 1, 0)) {
move(theBoard.getSize() - 1, 0);
Integer[] answer = { theBoard.getSize() - 1, 0 };
return answer;
}
// bottom left corner
if (theBoard.isEmpty(0, theBoard.getSize() - 1)) {
move(0, theBoard.getSize() - 1);
Integer[] answer = { 0, theBoard.getSize() - 1 };
return answer;
}
// bottom right corner
if (theBoard.isEmpty(theBoard.getSize() - 1, theBoard.getSize() - 1)) {
move(theBoard.getSize() - 1, theBoard.getSize() - 1);
Integer[] answer = { theBoard.getSize() - 1, theBoard.getSize() - 1 };
return answer;
}
Integer[][] coors = new Integer[theBoard.getSize() * theBoard.getSize()][2];
int index = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment