diff options
Diffstat (limited to 'src/solvers/coord/eo.h')
| -rw-r--r-- | src/solvers/coord/eo.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/solvers/coord/eo.h b/src/solvers/coord/eo.h index b83be01..a0685c4 100644 --- a/src/solvers/coord/eo.h +++ b/src/solvers/coord/eo.h | |||
| @@ -2,6 +2,7 @@ STATIC uint64_t coordinate_eo_coord(cube_t, const void *); | |||
| 2 | STATIC cube_t coordinate_eo_cube(uint64_t, const void *); | 2 | STATIC cube_t coordinate_eo_cube(uint64_t, const void *); |
| 3 | STATIC bool coordinate_eo_isnasty(uint64_t, const void *); | 3 | STATIC bool coordinate_eo_isnasty(uint64_t, const void *); |
| 4 | STATIC size_t coordinate_eo_gendata(void *); | 4 | STATIC size_t coordinate_eo_gendata(void *); |
| 5 | STATIC bool is_eo_even(cube_t); | ||
| 5 | 6 | ||
| 6 | STATIC coord_t coordinate_eo = { | 7 | STATIC coord_t coordinate_eo = { |
| 7 | .name = "EO", | 8 | .name = "EO", |
| @@ -18,6 +19,7 @@ STATIC coord_t coordinate_eo = { | |||
| 18 | [AXIS_FB] = TRANS_UFr, | 19 | [AXIS_FB] = TRANS_UFr, |
| 19 | }, | 20 | }, |
| 20 | .is_admissible = &solution_lastqt_cw, | 21 | .is_admissible = &solution_lastqt_cw, |
| 22 | .is_solvable = &is_eo_even, | ||
| 21 | .sym = {0}, | 23 | .sym = {0}, |
| 22 | }; | 24 | }; |
| 23 | 25 | ||
| @@ -46,3 +48,16 @@ coordinate_eo_gendata(void *data) | |||
| 46 | { | 48 | { |
| 47 | return 0; | 49 | return 0; |
| 48 | } | 50 | } |
| 51 | |||
| 52 | STATIC bool | ||
| 53 | is_eo_even(cube_t cube) | ||
| 54 | { | ||
| 55 | uint8_t c[8], e[12], i, count; | ||
| 56 | |||
| 57 | pieces(&cube, c, e); | ||
| 58 | |||
| 59 | for (i = 0, count = 0; i < 12; i++) | ||
| 60 | count += (e[i] & EOBIT) >> EOSHIFT; | ||
| 61 | |||
| 62 | return count % 2 == 0; | ||
| 63 | } | ||
