479 |
|
* threads (instead new ones are constructed), so don't |
480 |
|
* need any synch. |
481 |
|
*/ |
482 |
< |
static final class Board { |
482 |
> |
static final class Board { |
483 |
|
|
484 |
|
/* |
485 |
|
First, some Constants and utilities that might as well be here |
761 |
|
synchronized boolean isFrom(int r, int c) { |
762 |
|
return fromRow== r && fromCol == c; |
763 |
|
} |
764 |
< |
synchronized boolean isTo(int r, int c) { |
764 |
> |
synchronized boolean isTo(int r, int c) { |
765 |
|
return toRow == r && toCol == c; |
766 |
|
} |
767 |
|
synchronized Board board() { |
1005 |
|
Finder forked = null; // list of forked subtasks when level > 1 |
1006 |
|
|
1007 |
|
long open = ~(ours | theirs); // currently empty cells |
1008 |
< |
long here = 1; // travserse through bits |
1008 |
> |
long here = 1; // traverse through bits |
1009 |
|
|
1010 |
|
for (int k = 0; k < Board.CELLS; ++k, here <<= 1) { |
1011 |
|
if ((here & ours) != 0) { |
1173 |
|
long nextOurs = bestFinder.theirs; |
1174 |
|
long nextTheirs = bestFinder.ours; |
1175 |
|
long blue = player.isBlue() ? nextOurs : nextTheirs; |
1176 |
< |
long green = player.isBlue() ? nextTheirs: nextOurs; |
1176 |
> |
long green = player.isBlue() ? nextTheirs : nextOurs; |
1177 |
|
move = new Move(player, new Board(blue, green), true); |
1178 |
|
} |
1179 |
|
automover.relay(move); |