diff options
-rw-r--r-- | board.h | 9 | ||||
-rw-r--r-- | main.cpp | 2 |
2 files changed, 5 insertions, 6 deletions
@@ -12,10 +12,10 @@ const int BLACK = 1; const int EMPTY = 0, PAWN = 1, ROOK = 2, KNIGHT = 3, BISHOP = 4, KING = 5, QUEEN = 6; -// WHITE WHITE WHITE y = 0 +// BLACK BLACK BLACK y = 0 // ... // ... -// BLACK BLACK BLACK y = 7 +// WHITE WHITE WHITE y = 7 #define IDX(x_, y_) (8 * (y_) + (x_)) @@ -44,13 +44,12 @@ public: inline int at(int x, int y) const {return at(IDX(x, y));} inline int at(int idx) const {return bd[idx];} - int locate(int stone) const; + int locate(int stone) const; // moderately slow (iterates board) static inline int colour(int stone) {return stone > 0 ? WHITE : BLACK;} static inline int worth(int stone) { static const int w[7] = {0, 1, 5, 3, 3, 100000000, 9}; - if (stone < -6 || stone > 6) __asm("int3\n\t"); return w[abs(stone)]; } @@ -58,7 +57,7 @@ public: void apply(const Move &mv); // does not perform checking - bool isValid(const Move &mv); + bool isValid(const Move &mv) const; // SLOW friend bool operator==(const Board &B1, const Board &B2); }; @@ -57,7 +57,7 @@ int main() { for (size_t i = 0; i < subs.size(); i++) { int v = alphabeta<evaluate_pieceScore>(subs[i], AB_MAXDEPTH); if (i != 0) cout << ", "; - cout << v << endl; + cout << v << flush; v *= multfactor; if (v > maxval) { maxval = v; |