aboutsummaryrefslogtreecommitdiff
path: root/old/2020-unknown-date/moves.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--old/2020-unknown-date/moves.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/old/2020-unknown-date/moves.c b/old/2020-unknown-date/moves.c
deleted file mode 100644
index de293ed..0000000
--- a/old/2020-unknown-date/moves.c
+++ /dev/null
@@ -1,57 +0,0 @@
1#include <stdbool.h>
2#include "pieces.h"
3#include "moves.h"
4#include "utils.h"
5
6/* Transition tables */
7int eofb_ttable[pow2to11][NULLMOVE];
8int eorl_ttable[pow2to11][NULLMOVE];
9int eoud_ttable[pow2to11][NULLMOVE];
10int coud_ttable[pow3to7][NULLMOVE];
11int cofb_ttable[pow3to7][NULLMOVE];
12int corl_ttable[pow3to7][NULLMOVE];
13int epose_ttable[factorial12/factorial8][NULLMOVE];
14int eposs_ttable[factorial12/factorial8][NULLMOVE];
15int eposm_ttable[factorial12/factorial8][NULLMOVE];
16int cp_ttable[factorial8][NULLMOVE];
17int centerpos_ttable[factorial6][NULLMOVE];
18
19void apply_move_ep(Move m, int a[12]) {
20 int aux[12];
21 intarrcopy(a, aux, 12);
22 for (int i = 0; i < 12; i++)
23 a[i] = aux[edge_cycle[m][i]];
24}
25
26void apply_move_cp(Move m, int a[8]) {
27 int aux[8];
28 intarrcopy(a, aux, 8);
29 for (int i = 0; i < 8; i++)
30 a[i] = aux[corner_cycle[m][i]];
31}
32
33void apply_move_centerpos(Move m, int a[6]) {
34 int aux[6];
35 intarrcopy(a, aux, 6);
36 for (int i = 0; i < 6; i++)
37 a[i] = aux[center_cycle[m][i]];
38}
39
40void init_ttables() {
41 /* TODO */
42}
43
44void apply_move(Move m, Cube *cube) {
45 cube->eofb = eofb_ttable[cube->eofb][m];
46 cube->eorl = eorl_ttable[cube->eorl][m];
47 cube->eoud = eoud_ttable[cube->eoud][m];
48 cube->coud = coud_ttable[cube->coud][m];
49 cube->cofb = cofb_ttable[cube->cofb][m];
50 cube->corl = corl_ttable[cube->corl][m];
51 cube->epose = epose_ttable[cube->epose][m];
52 cube->eposs = eposs_ttable[cube->eposs][m];
53 cube->eposm = eposm_ttable[cube->eposm][m];
54 cube->cp = cp_ttable[cube->cp][m];
55 cube->centerpos = centerpos_ttable[cube->centerpos][m];
56}
57

Generated with cgit - Back to sebastiano.tronto.net