()
| 37 | } |
| 38 | |
| 39 | private int topMove() { |
| 40 | int move = 0; |
| 41 | int moveParity = 0; |
| 42 | do { |
| 43 | if ((top & 0x800) == 0) { |
| 44 | move += 1; |
| 45 | top = top << 1; |
| 46 | } else { |
| 47 | move += 2; |
| 48 | top = (top << 2) ^ 0x3003; |
| 49 | } |
| 50 | moveParity = 1 - moveParity; |
| 51 | } while ((Integer.bitCount(top & 0x3f) & 1) != 0); |
| 52 | if ((Integer.bitCount(top) & 2) == 0) { |
| 53 | parity ^= moveParity; |
| 54 | } |
| 55 | return move; |
| 56 | } |
| 57 | |
| 58 | private int bottomMove() { |
| 59 | int move = 0; |