aboutsummaryrefslogtreecommitdiff
path: root/src/moves.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/moves.h')
-rw-r--r--src/moves.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/moves.h b/src/moves.h
new file mode 100644
index 0000000..99d0ec3
--- /dev/null
+++ b/src/moves.h
@@ -0,0 +1,83 @@
1#include "utils.h"
2
3/* Bitmask that define certain movesets. */
4#define move_mask_all 524287 /* Reverse 1111111111111111111 */
5#define move_mask_eofb 155647 /* Reverse 1111111111111010010 */
6#define move_mask_eorl 518527 /* Reverse 1111111010101111111 */
7#define move_mask_eoud 524197 /* Reverse 1010010111111111111 */
8#define move_mask_drud 149887 /* Reverse 1111111010010010010 */
9#define move_mask_drfb 518437 /* Reverse 1010010010010111111 */
10#define move_mask_drrl 155557 /* Reverse 1010010111111010010 */
11#define move_mask_htr 149797 /* Reverse 1010010010010010010 */
12
13extern int possible_next[19][19];
14
15int parallel(int m1, int m2);
16void init_possible_next();
17
18/* Transition tables */
19extern int eofb_transition_table[pow2to11][19];
20extern int eorl_transition_table[pow2to11][19];
21extern int eoud_transition_table[pow2to11][19];
22extern int coud_transition_table[pow3to7][19];
23extern int cofb_transition_table[pow3to7][19];
24extern int corl_transition_table[pow3to7][19];
25extern int epud_transition_table[factorial8][19];
26extern int epfb_transition_table[factorial8][19];
27extern int eprl_transition_table[factorial8][19];
28extern int epose_transition_table[binom12on4][19];
29extern int eposs_transition_table[binom12on4][19];
30extern int eposm_transition_table[binom12on4][19];
31extern int epe_transition_table[factorial4][19];
32extern int eps_transition_table[factorial4][19];
33extern int epm_transition_table[factorial4][19];
34extern int emslices_transition_table[binom12on4*binom8on4][19];
35extern int cp_transition_table[factorial8][19];
36
37
38/* Functions for permuting pieces (given in array format) */
39
40void apply_move_ep_array(int move, int ep[12]);
41void apply_move_cp_array(int move, int cp[8]);
42
43/* Functions for permuting pieces (given in integer format) */
44
45int apply_move_ep_int(int move, int ep);
46int apply_move_epud_int(int move, int ep);
47int apply_move_epfb_int(int move, int ep);
48int apply_move_eprl_int(int move, int ep);
49int apply_move_epose_int(int move, int ep);
50int apply_move_eposs_int(int move, int ep);
51int apply_move_eposm_int(int move, int ep);
52int apply_move_epe_int(int move, int ep);
53int apply_move_eps_int(int move, int ep);
54int apply_move_epm_int(int move, int ep);
55int apply_move_cp_int(int move, int cp);
56int apply_move_eofb_int(int move, int eo);
57int apply_move_eorl_int(int move, int eo);
58int apply_move_eoud_int(int move, int eo);
59int apply_move_coud_int(int move, int co);
60int apply_move_cofb_int(int move, int co);
61int apply_move_corl_int(int move, int co);
62
63/* Initialize transition tables */
64
65void init_epud_transition_table();
66void init_epfb_transition_table();
67void init_eprl_transition_table();
68void init_epose_transition_table();
69void init_eposs_transition_table();
70void init_eposm_transition_table();
71void init_epe_transition_table();
72void init_eps_transition_table();
73void init_epm_transition_table();
74void init_cp_transition_table();
75void init_eofb_transition_table();
76void init_eorl_transition_table();
77void init_eoud_transition_table();
78void init_coud_transition_table();
79void init_cofb_transition_table();
80void init_corl_transition_table();
81
82void init_transition_table();
83

Generated with cgit - Back to sebastiano.tronto.net