diff --git a/Board.h b/Board.h index 2c34698..b3d6bdb 100644 --- a/Board.h +++ b/Board.h @@ -216,7 +216,6 @@ void make(Move m) { } // are we promoting? - byte new_val = m.pc_prom & 0b1111; if(m.pc_prom != P_EMPTY) { // promoting; indicate this in the sq_to byte in unmove. field[m.sq_to] = m.pc_prom; diff --git a/Movegen.h b/Movegen.h index fe0c3c1..f7f4b3e 100644 --- a/Movegen.h +++ b/Movegen.h @@ -4,8 +4,8 @@ #include "Types.h" #include "Move.h" -const static byte SLIDE_OFFSETS[] = {-1, 1, -16, 16, 15, 17, -15, -17}; -const static byte KNIGHT_OFFSETS[] = {-31, 31, -33, 33, -18, 18, -14, 14}; +const static byte SLIDE_OFFSETS[] = {255, 1, 240, 16, 15, 17, 241, 239}; +const static byte KNIGHT_OFFSETS[] = {225, 31, 223, 33, 238, 18, 242, 14}; #define INVALID_MOVE Move{0xFF, 0xFF, P_EMPTY} @@ -136,7 +136,7 @@ Move Movegen::generate_pawn() { offset = color ? -0x10 : 0x10; target_square = square + offset; if(field[target_square] || - (square & 0x70) == (color ? 0x10 : 0x60) + (square & 0x70) == (color ? 0x10 : 0x60) ) { // moving ahead is not possible, not even a capture! // this is either due to a blockade or a pending promotion diff --git a/Types.h b/Types.h index fdf2202..3b12c24 100644 --- a/Types.h +++ b/Types.h @@ -1,7 +1,7 @@ #ifndef __TYPES_H_INC #define __TYPES_H_INC -#include "Config.h"" +#include "Config.h" #ifdef _ACF_DEBUG_PRINT #define DEBUG(x) Serial.println(F(x)); Serial.flush()