aboutsummaryrefslogtreecommitdiff
path: root/src/moves.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-11 21:37:34 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-11 21:37:34 +0100
commit3568412f8f230774d0d11d7ed1c897424f95d3ef (patch)
tree77223792d8c925a9b1fc32b3f4341e943b5f8209 /src/moves.h
parent67e1b5e6e6a2c917a2fe58a37a1382c982b1e5c5 (diff)
downloadnissy-3568412f8f230774d0d11d7ed1c897424f95d3ef.tar.gz
nissy-3568412f8f230774d0d11d7ed1c897424f95d3ef.zip
Rewritten from scratch. Welocme nissy 2.0!
Diffstat (limited to 'src/moves.h')
-rw-r--r--src/moves.h91
1 files changed, 12 insertions, 79 deletions
diff --git a/src/moves.h b/src/moves.h
index 99d0ec3..082a080 100644
--- a/src/moves.h
+++ b/src/moves.h
@@ -1,83 +1,16 @@
1#include "utils.h" 1#ifndef MOVES_H
2#define MOVES_H
2 3
3/* Bitmask that define certain movesets. */ 4#include "alg.h"
4#define move_mask_all 524287 /* Reverse 1111111111111111111 */ 5#include "cube.h"
5#define move_mask_eofb 155647 /* Reverse 1111111111111010010 */ 6#include "env.h"
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 7
13extern int possible_next[19][19]; 8Cube apply_alg(Alg *alg, Cube cube);
9Cube apply_alg_generic(Alg *alg, Cube c, PieceFilter f, bool a);
10Cube apply_move(Move m, Cube cube);
11bool commute(Move m1, Move m2);
12bool possible_next(Move m1, Move m2, Move m3);
14 13
15int parallel(int m1, int m2); 14void init_moves();
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 15
16#endif

Generated with cgit - Back to sebastiano.tronto.net