Adjusted mobility and isolated pawn penalty
[owl.git] / move.h
blobb78186552ba0f861889ca04a030d9cc31abfebec
1 /*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 #define TYPE_PAWN_ONE 1
17 #define TYPE_PAWN_TWO 2
18 #define TYPE_CAPTURE 4
19 #define TYPE_PROMOTE 8
20 #define TYPE_CASTLE 16
21 #define TYPE_ENPASSANT 32
22 #define TYPE_TACTICAL (TYPE_CAPTURE | TYPE_ENPASSANT | TYPE_PROMOTE)
24 #define SET_FROM(x) (x)
25 #define SET_TO(x) ((x) << 6)
26 #define SET_TYPE(x) ((x) << 12)
27 #define SET_PROMOTE(x) ((x) << 18)
29 #define GET_FROM(x) ((x) & 0x3f)
30 #define GET_TO(x) (((x) >> 6) & 0x3f)
31 #define GET_TYPE(x) (((x) >> 12) & 0x3f)
32 #define GET_PROMOTE(x) (((x) >> 18) & 7)
34 #define MOVE_IS_TACTICAL(x) (GET_TYPE(x) & TYPE_TACTICAL)
35 #define PIECE(x) (square64[GET_FROM(x)])
36 #define CAP_PIECE(x) (square64[GET_TO(x)])
38 #define MAX_MOVES 512
40 struct moves_t {
41 int count;
42 int move[MAX_MOVES];
43 int score[MAX_MOVES];
44 int see[MAX_MOVES];
47 void sort_moves(struct moves_t *moves, int current, int ply);
48 char *coord_move(int move, char *buf);
49 char *get_pv_string_coord(char * buf);
50 char *get_pv_string_san(char * buf);
51 int make_move(int move, int tb);
52 int move_is_legal(int move);
53 int parse_move_coord(char * move);
54 int parse_move_san(char * move);
55 void print_moves_coord(struct moves_t * moves);
56 void print_moves_san(struct moves_t *moves);
57 char *san_move(int move, char * buf);
58 void takeback(void);
59 void print_move_coord(int move);
61 int gen_legal_moves(struct moves_t *moves);
62 int gen_moves(struct moves_t *moves);
63 int gen_quiescent_moves(struct moves_t *moves, uint64_t target);