aboutsummaryrefslogtreecommitdiff
path: root/src/coordinates.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/coordinates.h
parent67e1b5e6e6a2c917a2fe58a37a1382c982b1e5c5 (diff)
downloadnissy-3568412f8f230774d0d11d7ed1c897424f95d3ef.tar.gz
nissy-3568412f8f230774d0d11d7ed1c897424f95d3ef.zip
Rewritten from scratch. Welocme nissy 2.0!
Diffstat (limited to 'src/coordinates.h')
-rw-r--r--src/coordinates.h92
1 files changed, 0 insertions, 92 deletions
diff --git a/src/coordinates.h b/src/coordinates.h
deleted file mode 100644
index 10f7d18..0000000
--- a/src/coordinates.h
+++ /dev/null
@@ -1,92 +0,0 @@
1/* General rule for piece numbering (visually nicer):
2 *
3 * 0 1 2 3 4 5 6 7 8 9 10 11
4 * UF UL UB UR DF DL DB DR FR FL BL BR
5 * UFR UFL UBL UBR DFR DFL DBL DBR
6 *
7 * The order of moves is
8 * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
9 * - U U2 U' D D2 D' R R2 R' L L2 L' F F2 F' B B2 B'
10 * (0 is reserved for no move) */
11
12#define UF 0
13#define UL 1
14#define UB 2
15#define UR 3
16#define DF 4
17#define DL 5
18#define DB 6
19#define DR 7
20#define FR 8
21#define FL 9
22#define BL 10
23#define BR 11
24
25#define UFR 0
26#define UFL 1
27#define UBL 2
28#define UBR 3
29#define DFR 4
30#define DFL 5
31#define DBL 6
32#define DBR 7
33
34#define U 1
35#define U2 2
36#define U3 3
37#define D 4
38#define D2 5
39#define D3 6
40#define R 7
41#define R2 8
42#define R3 9
43#define L 10
44#define L2 11
45#define L3 12
46#define F 13
47#define F2 14
48#define F3 15
49#define B 16
50#define B2 17
51#define B3 18
52
53extern char edge_string_list[12][5];
54extern char corner_string_list[8][5];
55extern char move_string_list[19][5];
56extern int inverse_move[19];
57
58/* Convert piece representation from integer to array.
59 * Come convertions are not "perfect": for example, and epud type of piece
60 * is represented by a permutation index in 8! elements, but it as an array
61 * it is converted to the first 8 elements of a 12 elements ep array (with
62 * meaningless values for the other 4 elements). */
63
64void ep_int_to_array(int ep, int a[12]);
65void epud_int_to_array(int epud, int a[12]);
66void epfb_int_to_array(int epfb, int a[12]);
67void eprl_int_to_array(int eprl, int a[12]);
68void epose_int_to_array(int epos, int a[12]);
69void eposs_int_to_array(int epos, int a[12]);
70void eposm_int_to_array(int epos, int a[12]);
71void epe_int_to_array(int epe, int a[12]);
72void epm_int_to_array(int epe, int a[12]);
73void eps_int_to_array(int epe, int a[12]);
74void emslices_int_to_array(int emslices, int a[12]);
75void cp_int_to_array(int cp, int a[8]);
76void eo_11bits_to_array(int eo, int a[12]);
77void co_7trits_to_array(int co, int a[8]);
78
79int ep_array_to_int(int ep[12]);
80int epud_array_to_int(int ep[12]);
81int epfb_array_to_int(int ep[12]);
82int eprl_array_to_int(int ep[12]);
83int epose_array_to_int(int ep[12]);
84int eposs_array_to_int(int ep[12]);
85int eposm_array_to_int(int ep[12]);
86int epe_array_to_int(int epe[12]);
87int epm_array_to_int(int epe[12]);
88int eps_array_to_int(int epe[12]);
89int emslices_array_to_int(int ep[12]);
90int cp_array_to_int(int cp[8]);
91int eo_array_to_11bits(int a[12]);
92int co_array_to_7trits(int a[8]);

Generated with cgit - Back to sebastiano.tronto.net