aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-25 10:09:22 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-25 10:09:22 +0200
commit7faca28009c5efb0ba2b897b34dbdcac47a1a6f3 (patch)
treefd507509d00d2926175c72f4c06b9158c3a331a7
parent17e5a9e1e2b241c67956651f87f40236467fe7d8 (diff)
downloadnissy-core-7faca28009c5efb0ba2b897b34dbdcac47a1a6f3.tar.gz
nissy-core-7faca28009c5efb0ba2b897b34dbdcac47a1a6f3.zip
NISS
-rw-r--r--src/core/constants.h76
-rw-r--r--src/core/core.h1
-rw-r--r--src/core/cube.h8
-rw-r--r--src/core/moves.h84
-rw-r--r--src/core/oriented_cube.h78
-rw-r--r--src/nissy.h2
-rw-r--r--src/solvers/coord/dr.h2
-rw-r--r--src/solvers/coord/dreo.h2
-rw-r--r--src/solvers/coord/eo.h2
-rw-r--r--src/solvers/coord/types_macros.h2
-rw-r--r--src/solvers/h48/solve.h31
-rw-r--r--test/030_applymoves/000_nomove_solved.in (renamed from test/030_move/000_nomove_solved.in)0
-rw-r--r--test/030_applymoves/000_nomove_solved.out (renamed from test/030_move/000_nomove_solved.out)0
-rw-r--r--test/030_applymoves/001_nomove_scrambled.in (renamed from test/030_move/001_nomove_scrambled.in)0
-rw-r--r--test/030_applymoves/001_nomove_scrambled.out (renamed from test/030_move/001_nomove_scrambled.out)0
-rw-r--r--test/030_applymoves/010_U_solved.in (renamed from test/030_move/010_U_solved.in)0
-rw-r--r--test/030_applymoves/010_U_solved.out (renamed from test/030_move/010_U_solved.out)0
-rw-r--r--test/030_applymoves/011_U_scrambled.in (renamed from test/030_move/011_U_scrambled.in)0
-rw-r--r--test/030_applymoves/011_U_scrambled.out (renamed from test/030_move/011_U_scrambled.out)0
-rw-r--r--test/030_applymoves/012_U_inverse.in (renamed from test/030_move/012_U_inverse.in)0
-rw-r--r--test/030_applymoves/012_U_inverse.out (renamed from test/030_move/012_U_inverse.out)0
-rw-r--r--test/030_applymoves/020_U2_solved.in (renamed from test/030_move/020_U2_solved.in)0
-rw-r--r--test/030_applymoves/020_U2_solved.out (renamed from test/030_move/020_U2_solved.out)0
-rw-r--r--test/030_applymoves/021_U2_scrambled.in (renamed from test/030_move/021_U2_scrambled.in)0
-rw-r--r--test/030_applymoves/021_U2_scrambled.out (renamed from test/030_move/021_U2_scrambled.out)0
-rw-r--r--test/030_applymoves/022_U2_inverse.in (renamed from test/030_move/022_U2_inverse.in)0
-rw-r--r--test/030_applymoves/022_U2_inverse.out (renamed from test/030_move/022_U2_inverse.out)0
-rw-r--r--test/030_applymoves/030_U3_solved.in (renamed from test/030_move/030_U3_solved.in)0
-rw-r--r--test/030_applymoves/030_U3_solved.out (renamed from test/030_move/030_U3_solved.out)0
-rw-r--r--test/030_applymoves/031_U3_inverse.in (renamed from test/030_move/031_U3_inverse.in)0
-rw-r--r--test/030_applymoves/031_U3_inverse.out (renamed from test/030_move/031_U3_inverse.out)0
-rw-r--r--test/030_applymoves/032_U3_scrambled.in (renamed from test/030_move/032_U3_scrambled.in)0
-rw-r--r--test/030_applymoves/032_U3_scrambled.out (renamed from test/030_move/032_U3_scrambled.out)0
-rw-r--r--test/030_applymoves/033_U3_with_prime.in (renamed from test/030_move/033_U3_with_prime.in)0
-rw-r--r--test/030_applymoves/033_U3_with_prime.out (renamed from test/030_move/033_U3_with_prime.out)0
-rw-r--r--test/030_applymoves/040_D_solved.in (renamed from test/030_move/040_D_solved.in)0
-rw-r--r--test/030_applymoves/040_D_solved.out (renamed from test/030_move/040_D_solved.out)0
-rw-r--r--test/030_applymoves/050_D2_solved.in (renamed from test/030_move/050_D2_solved.in)0
-rw-r--r--test/030_applymoves/050_D2_solved.out (renamed from test/030_move/050_D2_solved.out)0
-rw-r--r--test/030_applymoves/060_D3_solved.in (renamed from test/030_move/060_D3_solved.in)0
-rw-r--r--test/030_applymoves/060_D3_solved.out (renamed from test/030_move/060_D3_solved.out)0
-rw-r--r--test/030_applymoves/070_R_solved.in (renamed from test/030_move/070_R_solved.in)0
-rw-r--r--test/030_applymoves/070_R_solved.out (renamed from test/030_move/070_R_solved.out)0
-rw-r--r--test/030_applymoves/071_R_scrambled.in (renamed from test/030_move/071_R_scrambled.in)0
-rw-r--r--test/030_applymoves/071_R_scrambled.out (renamed from test/030_move/071_R_scrambled.out)0
-rw-r--r--test/030_applymoves/080_R2_solved.in (renamed from test/030_move/080_R2_solved.in)0
-rw-r--r--test/030_applymoves/080_R2_solved.out (renamed from test/030_move/080_R2_solved.out)0
-rw-r--r--test/030_applymoves/090_R3_solved.in (renamed from test/030_move/090_R3_solved.in)0
-rw-r--r--test/030_applymoves/090_R3_solved.out (renamed from test/030_move/090_R3_solved.out)0
-rw-r--r--test/030_applymoves/100_L_solved.in (renamed from test/030_move/100_L_solved.in)0
-rw-r--r--test/030_applymoves/100_L_solved.out (renamed from test/030_move/100_L_solved.out)0
-rw-r--r--test/030_applymoves/110_L2_solved.in (renamed from test/030_move/110_L2_solved.in)0
-rw-r--r--test/030_applymoves/110_L2_solved.out (renamed from test/030_move/110_L2_solved.out)0
-rw-r--r--test/030_applymoves/120_L3_solved.in (renamed from test/030_move/120_L3_solved.in)0
-rw-r--r--test/030_applymoves/120_L3_solved.out (renamed from test/030_move/120_L3_solved.out)0
-rw-r--r--test/030_applymoves/130_F_solved.in (renamed from test/030_move/130_F_solved.in)0
-rw-r--r--test/030_applymoves/130_F_solved.out (renamed from test/030_move/130_F_solved.out)0
-rw-r--r--test/030_applymoves/132_F_scrambled.in (renamed from test/030_move/132_F_scrambled.in)0
-rw-r--r--test/030_applymoves/132_F_scrambled.out (renamed from test/030_move/132_F_scrambled.out)0
-rw-r--r--test/030_applymoves/133_F_scrambled_2.in (renamed from test/030_move/133_F_scrambled_2.in)0
-rw-r--r--test/030_applymoves/133_F_scrambled_2.out (renamed from test/030_move/133_F_scrambled_2.out)0
-rw-r--r--test/030_applymoves/140_F2_solved.in (renamed from test/030_move/140_F2_solved.in)0
-rw-r--r--test/030_applymoves/140_F2_solved.out (renamed from test/030_move/140_F2_solved.out)0
-rw-r--r--test/030_applymoves/150_F3_solved.in (renamed from test/030_move/150_F3_solved.in)0
-rw-r--r--test/030_applymoves/150_F3_solved.out (renamed from test/030_move/150_F3_solved.out)0
-rw-r--r--test/030_applymoves/160_B_solved.in (renamed from test/030_move/160_B_solved.in)0
-rw-r--r--test/030_applymoves/160_B_solved.out (renamed from test/030_move/160_B_solved.out)0
-rw-r--r--test/030_applymoves/170_B2_solved.in (renamed from test/030_move/170_B2_solved.in)0
-rw-r--r--test/030_applymoves/170_B2_solved.out (renamed from test/030_move/170_B2_solved.out)0
-rw-r--r--test/030_applymoves/180_B3_solved.in (renamed from test/030_move/180_B3_solved.in)0
-rw-r--r--test/030_applymoves/180_B3_solved.out (renamed from test/030_move/180_B3_solved.out)0
-rw-r--r--test/030_applymoves/200_scramble_solved.in (renamed from test/030_move/200_scramble_solved.in)0
-rw-r--r--test/030_applymoves/200_scramble_solved.out (renamed from test/030_move/200_scramble_solved.out)0
-rw-r--r--test/030_applymoves/201_solution_scrambled.in (renamed from test/030_move/201_solution_scrambled.in)0
-rw-r--r--test/030_applymoves/201_solution_scrambled.out (renamed from test/030_move/201_solution_scrambled.out)0
-rw-r--r--test/030_applymoves/300_multimove_solved.in (renamed from test/030_move/300_multimove_solved.in)0
-rw-r--r--test/030_applymoves/300_multimove_solved.out (renamed from test/030_move/300_multimove_solved.out)0
-rw-r--r--test/030_applymoves/301_multimove_scrambled.in (renamed from test/030_move/301_multimove_scrambled.in)0
-rw-r--r--test/030_applymoves/301_multimove_scrambled.out (renamed from test/030_move/301_multimove_scrambled.out)0
-rw-r--r--test/030_applymoves/500_Uw_solved.in (renamed from test/030_move/500_Uw_solved.in)0
-rw-r--r--test/030_applymoves/500_Uw_solved.out (renamed from test/030_move/500_Uw_solved.out)0
-rw-r--r--test/030_applymoves/501_Uw2_solved.in (renamed from test/030_move/501_Uw2_solved.in)0
-rw-r--r--test/030_applymoves/501_Uw2_solved.out (renamed from test/030_move/501_Uw2_solved.out)0
-rw-r--r--test/030_applymoves/502_Uw3_solved.in (renamed from test/030_move/502_Uw3_solved.in)0
-rw-r--r--test/030_applymoves/502_Uw3_solved.out (renamed from test/030_move/502_Uw3_solved.out)0
-rw-r--r--test/030_applymoves/503_Dw_solved.in (renamed from test/030_move/503_Dw_solved.in)0
-rw-r--r--test/030_applymoves/503_Dw_solved.out (renamed from test/030_move/503_Dw_solved.out)0
-rw-r--r--test/030_applymoves/504_Dw2_solved.in (renamed from test/030_move/504_Dw2_solved.in)0
-rw-r--r--test/030_applymoves/504_Dw2_solved.out (renamed from test/030_move/504_Dw2_solved.out)0
-rw-r--r--test/030_applymoves/505_Dw3_solved.in (renamed from test/030_move/505_Dw3_solved.in)0
-rw-r--r--test/030_applymoves/505_Dw3_solved.out (renamed from test/030_move/505_Dw3_solved.out)0
-rw-r--r--test/030_applymoves/506_Rw_solved.in (renamed from test/030_move/506_Rw_solved.in)0
-rw-r--r--test/030_applymoves/506_Rw_solved.out (renamed from test/030_move/506_Rw_solved.out)0
-rw-r--r--test/030_applymoves/507_Rw2_solved.in (renamed from test/030_move/507_Rw2_solved.in)0
-rw-r--r--test/030_applymoves/507_Rw2_solved.out (renamed from test/030_move/507_Rw2_solved.out)0
-rw-r--r--test/030_applymoves/508_Rw3_solved.in (renamed from test/030_move/508_Rw3_solved.in)0
-rw-r--r--test/030_applymoves/508_Rw3_solved.out (renamed from test/030_move/508_Rw3_solved.out)0
-rw-r--r--test/030_applymoves/509_Lw_solved.in (renamed from test/030_move/509_Lw_solved.in)0
-rw-r--r--test/030_applymoves/509_Lw_solved.out (renamed from test/030_move/509_Lw_solved.out)0
-rw-r--r--test/030_applymoves/510_Lw2_solved.in (renamed from test/030_move/510_Lw2_solved.in)0
-rw-r--r--test/030_applymoves/510_Lw2_solved.out (renamed from test/030_move/510_Lw2_solved.out)0
-rw-r--r--test/030_applymoves/511_Lw3_solved.in (renamed from test/030_move/511_Lw3_solved.in)0
-rw-r--r--test/030_applymoves/511_Lw3_solved.out (renamed from test/030_move/511_Lw3_solved.out)0
-rw-r--r--test/030_applymoves/512_Fw_solved.in (renamed from test/030_move/512_Fw_solved.in)0
-rw-r--r--test/030_applymoves/512_Fw_solved.out (renamed from test/030_move/512_Fw_solved.out)0
-rw-r--r--test/030_applymoves/513_Fw2_solved.in (renamed from test/030_move/513_Fw2_solved.in)0
-rw-r--r--test/030_applymoves/513_Fw2_solved.out (renamed from test/030_move/513_Fw2_solved.out)0
-rw-r--r--test/030_applymoves/514_Fw3_solved.in (renamed from test/030_move/514_Fw3_solved.in)0
-rw-r--r--test/030_applymoves/514_Fw3_solved.out (renamed from test/030_move/514_Fw3_solved.out)0
-rw-r--r--test/030_applymoves/515_Bw_solved.in (renamed from test/030_move/515_Bw_solved.in)0
-rw-r--r--test/030_applymoves/515_Bw_solved.out (renamed from test/030_move/515_Bw_solved.out)0
-rw-r--r--test/030_applymoves/516_Bw2_solved.in (renamed from test/030_move/516_Bw2_solved.in)0
-rw-r--r--test/030_applymoves/516_Bw2_solved.out (renamed from test/030_move/516_Bw2_solved.out)0
-rw-r--r--test/030_applymoves/517_Bw3_solved.in (renamed from test/030_move/517_Bw3_solved.in)0
-rw-r--r--test/030_applymoves/517_Bw3_solved.out (renamed from test/030_move/517_Bw3_solved.out)0
-rw-r--r--test/030_applymoves/518_M_solved.in (renamed from test/030_move/518_M_solved.in)0
-rw-r--r--test/030_applymoves/518_M_solved.out (renamed from test/030_move/518_M_solved.out)0
-rw-r--r--test/030_applymoves/519_M2_solved.in (renamed from test/030_move/519_M2_solved.in)0
-rw-r--r--test/030_applymoves/519_M2_solved.out (renamed from test/030_move/519_M2_solved.out)0
-rw-r--r--test/030_applymoves/520_M3_solved.in (renamed from test/030_move/520_M3_solved.in)0
-rw-r--r--test/030_applymoves/520_M3_solved.out (renamed from test/030_move/520_M3_solved.out)0
-rw-r--r--test/030_applymoves/521_S_solved.in (renamed from test/030_move/521_S_solved.in)0
-rw-r--r--test/030_applymoves/521_S_solved.out (renamed from test/030_move/521_S_solved.out)0
-rw-r--r--test/030_applymoves/522_S2_solved.in (renamed from test/030_move/522_S2_solved.in)0
-rw-r--r--test/030_applymoves/522_S2_solved.out (renamed from test/030_move/522_S2_solved.out)0
-rw-r--r--test/030_applymoves/523_S3_solved.in (renamed from test/030_move/523_S3_solved.in)0
-rw-r--r--test/030_applymoves/523_S3_solved.out (renamed from test/030_move/523_S3_solved.out)0
-rw-r--r--test/030_applymoves/524_E_solved.in (renamed from test/030_move/524_E_solved.in)0
-rw-r--r--test/030_applymoves/524_E_solved.out (renamed from test/030_move/524_E_solved.out)0
-rw-r--r--test/030_applymoves/525_E2_solved.in (renamed from test/030_move/525_E2_solved.in)0
-rw-r--r--test/030_applymoves/525_E2_solved.out (renamed from test/030_move/525_E2_solved.out)0
-rw-r--r--test/030_applymoves/526_E3_solved.in (renamed from test/030_move/526_E3_solved.in)0
-rw-r--r--test/030_applymoves/526_E3_solved.out (renamed from test/030_move/526_E3_solved.out)0
-rw-r--r--test/030_applymoves/527_x_solved.in (renamed from test/030_move/527_x_solved.in)0
-rw-r--r--test/030_applymoves/527_x_solved.out (renamed from test/030_move/527_x_solved.out)0
-rw-r--r--test/030_applymoves/528_x2_solved.in (renamed from test/030_move/528_x2_solved.in)0
-rw-r--r--test/030_applymoves/528_x2_solved.out (renamed from test/030_move/528_x2_solved.out)0
-rw-r--r--test/030_applymoves/529_x3_solved.in (renamed from test/030_move/529_x3_solved.in)0
-rw-r--r--test/030_applymoves/529_x3_solved.out (renamed from test/030_move/529_x3_solved.out)0
-rw-r--r--test/030_applymoves/530_y_solved.in (renamed from test/030_move/530_y_solved.in)0
-rw-r--r--test/030_applymoves/530_y_solved.out (renamed from test/030_move/530_y_solved.out)0
-rw-r--r--test/030_applymoves/531_y2_solved.in (renamed from test/030_move/531_y2_solved.in)0
-rw-r--r--test/030_applymoves/531_y2_solved.out (renamed from test/030_move/531_y2_solved.out)0
-rw-r--r--test/030_applymoves/532_y3_solved.in (renamed from test/030_move/532_y3_solved.in)0
-rw-r--r--test/030_applymoves/532_y3_solved.out (renamed from test/030_move/532_y3_solved.out)0
-rw-r--r--test/030_applymoves/533_z_solved.in (renamed from test/030_move/533_z_solved.in)0
-rw-r--r--test/030_applymoves/533_z_solved.out (renamed from test/030_move/533_z_solved.out)0
-rw-r--r--test/030_applymoves/534_z2_solved.in (renamed from test/030_move/534_z2_solved.in)0
-rw-r--r--test/030_applymoves/534_z2_solved.out (renamed from test/030_move/534_z2_solved.out)0
-rw-r--r--test/030_applymoves/535_z3_solved.in (renamed from test/030_move/535_z3_solved.in)0
-rw-r--r--test/030_applymoves/535_z3_solved.out (renamed from test/030_move/535_z3_solved.out)0
-rw-r--r--test/030_applymoves/550_scrambled_random.in (renamed from test/030_move/550_scrambled_random.in)0
-rw-r--r--test/030_applymoves/550_scrambled_random.out (renamed from test/030_move/550_scrambled_random.out)0
-rw-r--r--test/030_applymoves/559_solved_xzy.in (renamed from test/030_move/559_solved_xzy.in)0
-rw-r--r--test/030_applymoves/559_solved_xzy.out (renamed from test/030_move/559_solved_xzy.out)0
-rw-r--r--test/030_applymoves/560_solved_RwS.in (renamed from test/030_move/560_solved_RwS.in)0
-rw-r--r--test/030_applymoves/560_solved_RwS.out (renamed from test/030_move/560_solved_RwS.out)0
-rw-r--r--test/030_applymoves/561_solved_RwSE3.in (renamed from test/030_move/561_solved_RwSE3.in)0
-rw-r--r--test/030_applymoves/561_solved_RwSE3.out (renamed from test/030_move/561_solved_RwSE3.out)0
-rw-r--r--test/030_applymoves/569_returns_to_noreorient.in (renamed from test/030_move/569_returns_to_noreorient.in)0
-rw-r--r--test/030_applymoves/569_returns_to_noreorient.out (renamed from test/030_move/569_returns_to_noreorient.out)0
-rw-r--r--test/030_applymoves/600_niss_solved.in2
-rw-r--r--test/030_applymoves/600_niss_solved.out1
-rw-r--r--test/030_applymoves/601_niss_solved_widenormal.in2
-rw-r--r--test/030_applymoves/601_niss_solved_widenormal.out1
-rw-r--r--test/030_applymoves/602_scrambled_niss_1x3.in2
-rw-r--r--test/030_applymoves/602_scrambled_niss_1x3.out1
-rw-r--r--test/030_applymoves/603_scrambled_long_niss.in3
-rw-r--r--test/030_applymoves/603_scrambled_long_niss.out1
-rw-r--r--test/030_applymoves/604_scrambled_niss_extendedmoves.in3
-rw-r--r--test/030_applymoves/604_scrambled_niss_extendedmoves.out1
-rw-r--r--test/030_applymoves/applymoves_tests.c (renamed from test/030_move/move_tests.c)0
-rw-r--r--test/032_countmoves/05_niss.in1
-rw-r--r--test/032_countmoves/05_niss.out1
-rw-r--r--test/033_inverse_move/inverse_move_tests.c12
-rw-r--r--test/051_compose_oriented/00_scrambled_noorient.in4
-rw-r--r--test/051_compose_oriented/00_scrambled_noorient.out1
-rw-r--r--test/051_compose_oriented/01_Uw_Fw.in2
-rw-r--r--test/051_compose_oriented/01_Uw_Fw.out1
-rw-r--r--test/051_compose_oriented/02_scrambled_scrambled.in4
-rw-r--r--test/051_compose_oriented/02_scrambled_scrambled.out1
-rw-r--r--test/051_compose_oriented/compose_oriented_tests.c24
-rw-r--r--test/062_transform_move/transform_move_tests.c12
-rw-r--r--test/130_appendsolution/00_empty.in2
-rw-r--r--test/130_appendsolution/01_simple_onlynormal_nounniss.in2
-rw-r--r--test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.in2
-rw-r--r--test/130_appendsolution/03_simple_unniss.in4
-rw-r--r--test/130_appendsolution/04_niss_nounniss.in4
-rw-r--r--test/130_appendsolution/05_sort_parallel.in2
-rw-r--r--test/130_appendsolution/06_unniss_trans_sort.in4
-rw-r--r--test/130_appendsolution/07_unniss_cancel_nosol.in4
-rw-r--r--test/130_appendsolution/08_unniss_cancel_nosol_v2.in4
-rw-r--r--test/130_appendsolution/09_fullinverse_niss.in4
-rw-r--r--test/130_appendsolution/10_rotated.in5
-rw-r--r--test/130_appendsolution/10_rotated.out4
-rw-r--r--test/130_appendsolution/appendsolution_tests.c21
196 files changed, 301 insertions, 129 deletions
diff --git a/src/core/constants.h b/src/core/constants.h
index 2908f28..fb1450e 100644
--- a/src/core/constants.h
+++ b/src/core/constants.h
@@ -348,22 +348,22 @@
348#define NMOVES_EXTENDED (1+MOVE_z3) 348#define NMOVES_EXTENDED (1+MOVE_z3)
349#define NTRANS (1+TRANS_BLm) 349#define NTRANS (1+TRANS_BLm)
350 350
351#define MM_ALLMOVES UINT32_C(0x3FFFF) 351#define MM_SINGLE(m) (UINT64_C(1) << (uint64_t)(m))
352#define MM_NOHALFTURNS UINT32_C(0x2DB6D) 352#define MM18_ALLMOVES UINT64_C(0x3FFFF)
353#define MM_SINGLE(m) (UINT32_C(1) << (uint32_t)(m)) 353#define MM18_NOHALFTURNS UINT64_C(0x2DB6D)
354#define MM_FACE(m) (UINT32_C(7) << (uint32_t)(m)) 354#define MM18_FACE(m) (UINT64_C(7) << (uint64_t)(m))
355#define MM_EO (\ 355#define MM18_EO (\
356 MM_FACE(MOVE_U) | MM_FACE(MOVE_D) |\ 356 MM18_FACE(MOVE_U) | MM18_FACE(MOVE_D) |\
357 MM_FACE(MOVE_R) | MM_FACE(MOVE_L) |\ 357 MM18_FACE(MOVE_R) | MM18_FACE(MOVE_L) |\
358 MM_SINGLE(MOVE_F2) | MM_SINGLE(MOVE_B2)) 358 MM_SINGLE(MOVE_F2) | MM_SINGLE(MOVE_B2))
359#define MM_DR (\ 359#define MM18_DR (\
360 MM_FACE(MOVE_U) | MM_FACE(MOVE_D) |\ 360 MM18_FACE(MOVE_U) | MM18_FACE(MOVE_D) |\
361 MM_SINGLE(MOVE_R2) | MM_SINGLE(MOVE_L2) |\ 361 MM_SINGLE(MOVE_R2) | MM_SINGLE(MOVE_L2) |\
362 MM_SINGLE(MOVE_F2) | MM_SINGLE(MOVE_B2)) 362 MM_SINGLE(MOVE_F2) | MM_SINGLE(MOVE_B2))
363#define MM_HTR (MM_ALLMOVES & ~MM_NOHALFTURNS) 363#define MM18_HTR (MM18_ALLMOVES & ~MM18_NOHALFTURNS)
364 364
365#define TM_ALLTRANS UINT64_C(0xFFFFFFFFFFFF)
366#define TM_SINGLE(t) (UINT64_C(1) << (uint64_t)(t)) 365#define TM_SINGLE(t) (UINT64_C(1) << (uint64_t)(t))
366#define TM_ALLTRANS UINT64_C(0xFFFFFFFFFFFF)
367#define TM_UDRLFIX (\ 367#define TM_UDRLFIX (\
368 TM_SINGLE(TRANS_UFr) | TM_SINGLE(TRANS_UBr) | TM_SINGLE(TRANS_UFm) | \ 368 TM_SINGLE(TRANS_UFr) | TM_SINGLE(TRANS_UBr) | TM_SINGLE(TRANS_UFm) | \
369 TM_SINGLE(TRANS_UBm) | TM_SINGLE(TRANS_DFr) | TM_SINGLE(TRANS_DBr) | \ 369 TM_SINGLE(TRANS_UBm) | TM_SINGLE(TRANS_DFr) | TM_SINGLE(TRANS_DBr) | \
@@ -423,13 +423,26 @@
423#define ORIENTATION_BU UINT8_C(22) 423#define ORIENTATION_BU UINT8_C(22)
424#define ORIENTATION_BL UINT8_C(23) 424#define ORIENTATION_BL UINT8_C(23)
425 425
426STATIC const uint32_t allowedmask[] = { 426/* This is only meant to work for the 18 base moves, for now */
427 UINT32_C(0x3FFF8), 427STATIC const uint64_t allowedmask[] = {
428 UINT32_C(0x3FFC0), 428 [MOVE_U / 3] = UINT64_C(0x3FFF8),
429 UINT32_C(0x3FE3F), 429 [MOVE_D / 3] = UINT64_C(0x3FFC0),
430 UINT32_C(0x3F03F), 430 [MOVE_R / 3] = UINT64_C(0x3FE3F),
431 UINT32_C(0x38FFF), 431 [MOVE_L / 3] = UINT64_C(0x3F03F),
432 UINT32_C(0x00FFF) 432 [MOVE_F / 3] = UINT64_C(0x38FFF),
433 [MOVE_B / 3] = UINT64_C(0x00FFF),
434 [MOVE_Uw / 3] = 0,
435 [MOVE_Dw / 3] = 0,
436 [MOVE_Rw / 3] = 0,
437 [MOVE_Lw / 3] = 0,
438 [MOVE_Fw / 3] = 0,
439 [MOVE_Bw / 3] = 0,
440 [MOVE_M / 3] = 0,
441 [MOVE_S / 3] = 0,
442 [MOVE_E / 3] = 0,
443 [MOVE_x / 3] = 0,
444 [MOVE_y / 3] = 0,
445 [MOVE_z / 3] = 0,
433}; 446};
434 447
435STATIC const char *cornerstr[] = { 448STATIC const char *cornerstr[] = {
@@ -682,6 +695,33 @@ STATIC uint8_t trans_move_table[][3] = {
682 [TRANS_BLm] = { MOVE_B, MOVE_U, MOVE_R }, 695 [TRANS_BLm] = { MOVE_B, MOVE_U, MOVE_R },
683}; 696};
684 697
698STATIC uint8_t orientation_moves[][3] = {
699 [ORIENTATION_UF] = { UINT8_MAX },
700 [ORIENTATION_UR] = { MOVE_y, UINT8_MAX },
701 [ORIENTATION_UB] = { MOVE_y2, UINT8_MAX },
702 [ORIENTATION_UL] = { MOVE_y3, UINT8_MAX },
703 [ORIENTATION_DF] = { MOVE_z2, UINT8_MAX },
704 [ORIENTATION_DR] = { MOVE_y, MOVE_z2, UINT8_MAX },
705 [ORIENTATION_DB] = { MOVE_y2, MOVE_z2, UINT8_MAX },
706 [ORIENTATION_DL] = { MOVE_y3, MOVE_z2, UINT8_MAX },
707 [ORIENTATION_RF] = { MOVE_z3, UINT8_MAX },
708 [ORIENTATION_RD] = { MOVE_z3, MOVE_y, UINT8_MAX },
709 [ORIENTATION_RB] = { MOVE_z3, MOVE_y2, UINT8_MAX },
710 [ORIENTATION_RU] = { MOVE_z3, MOVE_y3, UINT8_MAX },
711 [ORIENTATION_LF] = { MOVE_z, UINT8_MAX },
712 [ORIENTATION_LD] = { MOVE_z, MOVE_y3, UINT8_MAX },
713 [ORIENTATION_LB] = { MOVE_z, MOVE_y2, UINT8_MAX },
714 [ORIENTATION_LU] = { MOVE_z, MOVE_y, UINT8_MAX },
715 [ORIENTATION_FD] = { MOVE_x, UINT8_MAX },
716 [ORIENTATION_FR] = { MOVE_x, MOVE_y, UINT8_MAX },
717 [ORIENTATION_FU] = { MOVE_x, MOVE_y2, UINT8_MAX },
718 [ORIENTATION_FL] = { MOVE_x, MOVE_y3, UINT8_MAX },
719 [ORIENTATION_BD] = { MOVE_x3, MOVE_y2, UINT8_MAX },
720 [ORIENTATION_BR] = { MOVE_x3, MOVE_y, UINT8_MAX },
721 [ORIENTATION_BU] = { MOVE_x3, UINT8_MAX },
722 [ORIENTATION_BL] = { MOVE_x3, MOVE_y3, UINT8_MAX },
723};
724
685STATIC uint8_t orientation_transition_table[][3] = { 725STATIC uint8_t orientation_transition_table[][3] = {
686 [ORIENTATION_UF] = { ORIENTATION_FD, ORIENTATION_UR, ORIENTATION_LF }, 726 [ORIENTATION_UF] = { ORIENTATION_FD, ORIENTATION_UR, ORIENTATION_LF },
687 [ORIENTATION_UR] = { ORIENTATION_RD, ORIENTATION_UB, ORIENTATION_FR }, 727 [ORIENTATION_UR] = { ORIENTATION_RD, ORIENTATION_UB, ORIENTATION_FR },
diff --git a/src/core/core.h b/src/core/core.h
index b56106e..5e0faaa 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -3,3 +3,4 @@
3#include "cube.h" 3#include "cube.h"
4#include "moves.h" 4#include "moves.h"
5#include "transform.h" 5#include "transform.h"
6#include "oriented_cube.h"
diff --git a/src/core/cube.h b/src/core/cube.h
index 88e1ca9..842ec59 100644
--- a/src/core/cube.h
+++ b/src/core/cube.h
@@ -1,4 +1,3 @@
1STATIC oriented_cube_t solvedcube(void);
2STATIC cube_t cubefromarray(uint8_t [static 8], uint8_t [static 12]); 1STATIC cube_t cubefromarray(uint8_t [static 8], uint8_t [static 12]);
3STATIC bool isconsistent(oriented_cube_t); 2STATIC bool isconsistent(oriented_cube_t);
4STATIC bool issolvable(oriented_cube_t); 3STATIC bool issolvable(oriented_cube_t);
@@ -20,13 +19,6 @@ STATIC uint8_t b32tocorner(char);
20STATIC char edgetob32(uint8_t); 19STATIC char edgetob32(uint8_t);
21STATIC char cornertob32(uint8_t); 20STATIC char cornertob32(uint8_t);
22 21
23/* This is used only in tests, use SOLVED_ORIENTED_CUBE everywhere else */
24STATIC oriented_cube_t
25solvedcube(void)
26{
27 return SOLVED_ORIENTED_CUBE;
28}
29
30STATIC cube_t 22STATIC cube_t
31cubefromarray(uint8_t c[static 8], uint8_t e[static 12]) 23cubefromarray(uint8_t c[static 8], uint8_t e[static 12])
32{ 24{
diff --git a/src/core/moves.h b/src/core/moves.h
index dc580be..008e928 100644
--- a/src/core/moves.h
+++ b/src/core/moves.h
@@ -2,7 +2,8 @@
2#define PREMOVE(M, c) compose(MOVE_CUBE_ ## M, c) 2#define PREMOVE(M, c) compose(MOVE_CUBE_ ## M, c)
3 3
4STATIC uint8_t readmove(char); 4STATIC uint8_t readmove(char);
5STATIC int64_t readmoves(const char *, size_t n, uint8_t [n]); 5STATIC int64_t readmoves(const char *,
6 size_t n, size_t m, uint64_t *, uint64_t *, uint8_t [n], uint8_t [m]);
6STATIC int64_t countmoves(const char *); 7STATIC int64_t countmoves(const char *);
7STATIC uint8_t readmodifier(char); 8STATIC uint8_t readmodifier(char);
8STATIC int64_t writemoves(size_t n, const uint8_t [n], size_t m, char [m]); 9STATIC int64_t writemoves(size_t n, const uint8_t [n], size_t m, char [m]);
@@ -21,14 +22,11 @@ STATIC_INLINE uint8_t movefollow(uint8_t);
21STATIC uint8_t transform_move(uint8_t, uint8_t); 22STATIC uint8_t transform_move(uint8_t, uint8_t);
22 23
23STATIC cube_t move(cube_t, uint8_t); 24STATIC cube_t move(cube_t, uint8_t);
24STATIC oriented_cube_t move_extended(oriented_cube_t, uint8_t);
25STATIC cube_t premove(cube_t, uint8_t); 25STATIC cube_t premove(cube_t, uint8_t);
26STATIC uint8_t inverse_move(uint8_t); 26STATIC uint8_t inverse_move(uint8_t);
27STATIC void sortparallel_moves(size_t n, uint8_t [n]); 27STATIC void sortparallel_moves(size_t n, uint8_t [n]);
28STATIC bool are_lastmoves_singlecw(size_t n, const uint8_t [n]); 28STATIC bool are_lastmoves_singlecw(size_t n, const uint8_t [n]);
29 29
30STATIC oriented_cube_t applymoves(oriented_cube_t, const char *);
31
32#define FOREACH_READMOVE(ARG_BUF, ARG_MOVE, ARG_C, ARG_MAX, \ 30#define FOREACH_READMOVE(ARG_BUF, ARG_MOVE, ARG_C, ARG_MAX, \
33 RET_ERROR, ARG_ACTION) \ 31 RET_ERROR, ARG_ACTION) \
34 const char *VAR_B; \ 32 const char *VAR_B; \
@@ -118,14 +116,34 @@ readmodifier(char c)
118} 116}
119 117
120STATIC int64_t 118STATIC int64_t
121readmoves(const char *buf, size_t n, uint8_t ret[n]) 119readmoves(
120 const char *buf,
121 size_t nsize,
122 size_t invsize,
123 uint64_t *n,
124 uint64_t *i,
125 uint8_t normal[nsize],
126 uint8_t inverse[invsize]
127)
122{ 128{
123// TODO: modify to accept NISS
124 uint8_t m; 129 uint8_t m;
125 uint64_t c; 130 uint64_t c;
126 131
127 FOREACH_READMOVE(buf, m, c, n, NISSY_ERROR_INVALID_MOVES, 132 *n = *i = 0;
128 ret[c] = m; 133 FOREACH_READMOVE(buf, m, c, nsize+invsize, NISSY_ERROR_INVALID_MOVES,
134 if (!VAR_IN_PARENTHESES) {
135 if (*n >= nsize-1) {
136 LOG("Error in readmoves: normal buffer\n");
137 return NISSY_ERROR_BUFFER_SIZE;
138 }
139 normal[(*n)++] = m;
140 } else {
141 if (*i >= invsize-1) {
142 LOG("Error in readmoves: inverse buffer\n");
143 return NISSY_ERROR_BUFFER_SIZE;
144 }
145 inverse[(*i)++] = m;
146 }
129 ) 147 )
130 148
131 return (int64_t)c; 149 return (int64_t)c;
@@ -188,9 +206,7 @@ writemoves_error:
188STATIC_INLINE bool 206STATIC_INLINE bool
189allowednextmove(uint8_t m1, uint8_t m2) 207allowednextmove(uint8_t m1, uint8_t m2)
190{ 208{
191// TODO: adjust allowedmask 209 return allowedmask[movebase(m1)] & MM_SINGLE(m2);
192// TODO: movemask is now 64 bits
193 return allowedmask[movebase(m1)] & (UINT32_C(1) << m2);
194} 210}
195 211
196STATIC bool 212STATIC bool
@@ -226,9 +242,7 @@ isbase(uint8_t move)
226STATIC_INLINE bool 242STATIC_INLINE bool
227parallel(uint8_t m1, uint8_t m2) 243parallel(uint8_t m1, uint8_t m2)
228{ 244{
229// TODO add unit tests 245 return moveaxis(movefollow(m1)) == moveaxis(movefollow(m2));
230//TODO fix the logic (maybe use moveaxis(movefollow)), then remove comment
231 return moveaxis(m1) == moveaxis(m2);
232} 246}
233 247
234STATIC_INLINE uint8_t 248STATIC_INLINE uint8_t
@@ -249,7 +263,6 @@ inverse_reorient_move(uint8_t m, uint8_t or)
249 return transform_move(m, inverse_trans_table[orientation_trans[or]]); 263 return transform_move(m, inverse_trans_table[orientation_trans[or]]);
250} 264}
251 265
252/* This is currently unused, but it may turn out to be useful at some point */
253STATIC_INLINE uint8_t 266STATIC_INLINE uint8_t
254movefollow(uint8_t move) 267movefollow(uint8_t move)
255{ 268{
@@ -351,27 +364,6 @@ transform_move(uint8_t m, uint8_t t)
351 return base + modifier; 364 return base + modifier;
352} 365}
353 366
354STATIC oriented_cube_t
355move_extended(oriented_cube_t c, uint8_t m)
356{
357 int i;
358 equivalent_moves_t eqm;
359 oriented_cube_t ret;
360
361 eqm = equivalent_moves_table[m];
362 ret = c;
363
364 for (i = 0; eqm.move[i] != UINT8_MAX; i++)
365 ret.cube = move(
366 ret.cube, reorient_move(eqm.move[i], ret.orientation));
367
368 for (i = 0; eqm.rotation[i] != UINT8_MAX; i++)
369 ret.orientation = orientation_transition_table[
370 ret.orientation][eqm.rotation[i]];
371
372 return ret;
373}
374
375/* Applies the INVERSE of m BEFORE the scramble corresponding to c */ 367/* Applies the INVERSE of m BEFORE the scramble corresponding to c */
376STATIC cube_t 368STATIC cube_t
377premove(cube_t c, uint8_t m) 369premove(cube_t c, uint8_t m)
@@ -428,15 +420,13 @@ inverse_move(uint8_t m)
428STATIC void 420STATIC void
429sortparallel_moves(size_t n, uint8_t moves[n]) 421sortparallel_moves(size_t n, uint8_t moves[n])
430{ 422{
431// TODO: fix for wide moves...
432 uint8_t i; 423 uint8_t i;
433 424
434 if (n < 2) 425 if (n < 2)
435 return; 426 return;
436 427
437 for (i = 0; i < n-1; i++) 428 for (i = 0; i < n-1; i++)
438 if (moveaxis(moves[i]) == moveaxis(moves[i+1]) && 429 if (parallel(moves[i], moves[i+1]) && moves[i] > moves[i+1])
439 movebase(moves[i]) == movebase(moves[i+1]) + 1)
440 SWAP(moves[i], moves[i+1]); 430 SWAP(moves[i], moves[i+1]);
441} 431}
442 432
@@ -452,19 +442,3 @@ are_lastmoves_singlecw(size_t n, const uint8_t moves[n])
452 442
453 return isbase(moves[n-1]) && (!two || isbase(moves[n-2])); 443 return isbase(moves[n-1]) && (!two || isbase(moves[n-2]));
454} 444}
455
456STATIC oriented_cube_t
457applymoves(oriented_cube_t cube, const char *buf)
458{
459 int c;
460 uint8_t m;
461
462 DBG_ASSERT(isconsistent(cube), ZERO_ORIENTED_CUBE,
463 "move error: inconsistent cube\n");
464
465 FOREACH_READMOVE(buf, m, c, -1, ZERO_ORIENTED_CUBE,
466 cube = move_extended(cube, m);
467 )
468
469 return cube;
470}
diff --git a/src/core/oriented_cube.h b/src/core/oriented_cube.h
new file mode 100644
index 0000000..2c86af0
--- /dev/null
+++ b/src/core/oriented_cube.h
@@ -0,0 +1,78 @@
1STATIC oriented_cube_t solvedcube(void);
2
3STATIC oriented_cube_t move_extended(oriented_cube_t, uint8_t);
4STATIC oriented_cube_t applymoves(oriented_cube_t, const char *);
5
6/* This is used only in tests, use SOLVED_ORIENTED_CUBE everywhere else */
7STATIC oriented_cube_t
8solvedcube(void)
9{
10 return SOLVED_ORIENTED_CUBE;
11}
12
13STATIC oriented_cube_t
14compose_oriented(oriented_cube_t c, oriented_cube_t d)
15{
16 int i;
17 cube_t transformed_d;
18 oriented_cube_t ret;
19
20 transformed_d = transform(d.cube, orientation_trans[c.orientation]);
21
22 ret.cube = compose(c.cube, transformed_d);
23 ret.orientation = c.orientation;
24
25 for (i = 0; orientation_moves[d.orientation][i] != UINT8_MAX; i++)
26 ret = move_extended(ret, orientation_moves[d.orientation][i]);
27
28 return ret;
29}
30
31STATIC oriented_cube_t
32move_extended(oriented_cube_t c, uint8_t m)
33{
34 int i;
35 equivalent_moves_t eqm;
36 oriented_cube_t ret;
37
38 eqm = equivalent_moves_table[m];
39 ret = c;
40
41 for (i = 0; eqm.move[i] != UINT8_MAX; i++)
42 ret.cube = move(
43 ret.cube, reorient_move(eqm.move[i], ret.orientation));
44
45 for (i = 0; eqm.rotation[i] != UINT8_MAX; i++)
46 ret.orientation = orientation_transition_table[
47 ret.orientation][eqm.rotation[i]];
48
49 return ret;
50}
51
52STATIC oriented_cube_t
53applymoves(oriented_cube_t cube, const char *buf)
54{
55 int count;
56 uint8_t m;
57 oriented_cube_t c, cinv;
58
59 DBG_ASSERT(isconsistent(cube), ZERO_ORIENTED_CUBE,
60 "move error: inconsistent cube\n");
61
62 c = cube;
63 cinv = SOLVED_ORIENTED_CUBE;
64 FOREACH_READMOVE(buf, m, count, -1, ZERO_ORIENTED_CUBE,
65 if (!VAR_IN_PARENTHESES)
66 c = move_extended(c, m);
67 else
68 cinv = move_extended(cinv, m);
69 )
70
71 if (cinv.orientation != ORIENTATION_UF) {
72 LOG("Error applying moves: NISS part must not move centers\n");
73 return ZERO_ORIENTED_CUBE;
74 }
75
76 cinv.cube = inverse(cinv.cube);
77 return compose_oriented(cinv, c);
78}
diff --git a/src/nissy.h b/src/nissy.h
index c827275..5800490 100644
--- a/src/nissy.h
+++ b/src/nissy.h
@@ -11,6 +11,8 @@ see the README.md file for more information.
11Accepted moves are any of the following: 11Accepted moves are any of the following:
12U, D, R, L, F, B, Uw, Dw, Rw, Lw, Fw, Bw, M, S, E, x, y, z 12U, D, R, L, F, B, Uw, Dw, Rw, Lw, Fw, Bw, M, S, E, x, y, z
13optionally followed by a 2, a ' or a 3. 13optionally followed by a 2, a ' or a 3.
14The standard NISS notation is also accepted: moves in parentheses () are
15inverted and used as premoves.
14 16
15A transformation must be given in the format 17A transformation must be given in the format
16 (rotation|mirrored) (2 letters) 18 (rotation|mirrored) (2 letters)
diff --git a/src/solvers/coord/dr.h b/src/solvers/coord/dr.h
index e197f8c..607cc39 100644
--- a/src/solvers/coord/dr.h
+++ b/src/solvers/coord/dr.h
@@ -24,7 +24,7 @@ STATIC coord_t coordinate_dr = {
24 .gendata = coordinate_dr_gendata, 24 .gendata = coordinate_dr_gendata,
25 .max = DREOESEP_CLASSES * POW_3_7, 25 .max = DREOESEP_CLASSES * POW_3_7,
26 .trans_mask = TM_UDFIX, 26 .trans_mask = TM_UDFIX,
27 .moves_mask = MM_ALLMOVES, 27 .moves_mask = MM18_ALLMOVES,
28 .axistrans = { 28 .axistrans = {
29 [AXIS_UD] = TRANS_UFr, 29 [AXIS_UD] = TRANS_UFr,
30 [AXIS_RL] = TRANS_RFr, 30 [AXIS_RL] = TRANS_RFr,
diff --git a/src/solvers/coord/dreo.h b/src/solvers/coord/dreo.h
index 2bc8cd1..1cce4e2 100644
--- a/src/solvers/coord/dreo.h
+++ b/src/solvers/coord/dreo.h
@@ -19,7 +19,7 @@ STATIC coord_t coordinate_dreo = {
19 .gendata = coordinate_dreo_gendata, 19 .gendata = coordinate_dreo_gendata,
20 .max = DRESEP_CLASSES * POW_3_7, 20 .max = DRESEP_CLASSES * POW_3_7,
21 .trans_mask = TM_UDRLFIX, 21 .trans_mask = TM_UDRLFIX,
22 .moves_mask = MM_EO, 22 .moves_mask = MM18_EO,
23 .axistrans = { 23 .axistrans = {
24 [AXIS_UD] = TRANS_UFr, 24 [AXIS_UD] = TRANS_UFr,
25 [AXIS_RL] = TRANS_RFr, 25 [AXIS_RL] = TRANS_RFr,
diff --git a/src/solvers/coord/eo.h b/src/solvers/coord/eo.h
index c8faaea..51dfb29 100644
--- a/src/solvers/coord/eo.h
+++ b/src/solvers/coord/eo.h
@@ -12,7 +12,7 @@ STATIC coord_t coordinate_eo = {
12 .gendata = coordinate_eo_gendata, 12 .gendata = coordinate_eo_gendata,
13 .max = POW_2_11, 13 .max = POW_2_11,
14 .trans_mask = TM_SINGLE(TRANS_UFr), 14 .trans_mask = TM_SINGLE(TRANS_UFr),
15 .moves_mask = MM_ALLMOVES, 15 .moves_mask = MM18_ALLMOVES,
16 .axistrans = { 16 .axistrans = {
17 [AXIS_UD] = TRANS_FDr, 17 [AXIS_UD] = TRANS_FDr,
18 [AXIS_RL] = TRANS_URr, 18 [AXIS_RL] = TRANS_URr,
diff --git a/src/solvers/coord/types_macros.h b/src/solvers/coord/types_macros.h
index 2767dcc..a5ac7f3 100644
--- a/src/solvers/coord/types_macros.h
+++ b/src/solvers/coord/types_macros.h
@@ -21,7 +21,7 @@ typedef struct {
21 bool (*isnasty)(uint64_t, const unsigned char *); 21 bool (*isnasty)(uint64_t, const unsigned char *);
22 size_t (*gendata)(unsigned char *); 22 size_t (*gendata)(unsigned char *);
23 uint64_t max; 23 uint64_t max;
24 uint32_t moves_mask; 24 uint64_t moves_mask;
25 uint64_t trans_mask; 25 uint64_t trans_mask;
26 uint8_t axistrans[3]; 26 uint8_t axistrans[3];
27 bool (*is_admissible)(const solution_moves_t[static 1]); 27 bool (*is_admissible)(const solution_moves_t[static 1]);
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index 86c590a..e3ef9b9 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -25,8 +25,8 @@ typedef struct {
25 const unsigned char *h48data; 25 const unsigned char *h48data;
26 const unsigned char *h48data_fallback_h0k4; 26 const unsigned char *h48data_fallback_h0k4;
27 const unsigned char *h48data_fallback_eoesep; 27 const unsigned char *h48data_fallback_eoesep;
28 uint32_t movemask_normal; 28 uint64_t movemask_normal;
29 uint32_t movemask_inverse; 29 uint64_t movemask_inverse;
30 int64_t nodes_visited; 30 int64_t nodes_visited;
31 int64_t table_fallbacks; 31 int64_t table_fallbacks;
32 int64_t table_lookups; 32 int64_t table_lookups;
@@ -72,7 +72,7 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
72 arg->solution_settings->optimal) 72 arg->solution_settings->optimal)
73 return true; 73 return true;
74 74
75 arg->movemask_normal = arg->movemask_inverse = MM_ALLMOVES; 75 arg->movemask_normal = arg->movemask_inverse = MM18_ALLMOVES;
76 arg->nodes_visited++; 76 arg->nodes_visited++;
77 77
78 /* Preliminary probing using last computed bound, if possible */ 78 /* Preliminary probing using last computed bound, if possible */
@@ -113,7 +113,7 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
113 if (arg->lb_inverse > target) 113 if (arg->lb_inverse > target)
114 return true; 114 return true;
115 nh = arg->lb_inverse == target; 115 nh = arg->lb_inverse == target;
116 arg->movemask_normal = nh * MM_NOHALFTURNS + (1-nh) * MM_ALLMOVES; 116 arg->movemask_normal = nh * MM18_NOHALFTURNS + (1-nh) * MM18_ALLMOVES;
117 117
118 /* Normal probing */ 118 /* Normal probing */
119 119
@@ -141,7 +141,7 @@ solve_h48_stop(dfsarg_solve_h48_t arg[static 1])
141 if (arg->lb_normal > target) 141 if (arg->lb_normal > target)
142 return true; 142 return true;
143 nh = arg->lb_normal == target; 143 nh = arg->lb_normal == target;
144 arg->movemask_inverse = nh * MM_NOHALFTURNS + (1-nh) * MM_ALLMOVES; 144 arg->movemask_inverse = nh * MM18_NOHALFTURNS + (1-nh) * MM18_ALLMOVES;
145 145
146 return false; 146 return false;
147} 147}
@@ -151,7 +151,7 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1])
151{ 151{
152 int64_t ret, n; 152 int64_t ret, n;
153 uint8_t m, nm, lbn, lbi; 153 uint8_t m, nm, lbn, lbi;
154 uint32_t mm_normal, mm_inverse; 154 uint64_t mm_normal, mm_inverse;
155 bool ulbi, ulbn; 155 bool ulbi, ulbn;
156 cube_t backup_cube, backup_inverse; 156 cube_t backup_cube, backup_inverse;
157 157
@@ -191,7 +191,7 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1])
191 if (popcount_u32(mm_normal) <= popcount_u32(mm_inverse)) { 191 if (popcount_u32(mm_normal) <= popcount_u32(mm_inverse)) {
192 arg->solution_moves->nmoves++; 192 arg->solution_moves->nmoves++;
193 for (m = 0; m < 18; m++) { 193 for (m = 0; m < 18; m++) {
194 if (!(mm_normal & (UINT32_C(1) << (uint32_t)m))) 194 if (!(mm_normal & MM_SINGLE(m)))
195 continue; 195 continue;
196 arg->solution_moves->moves[ 196 arg->solution_moves->moves[
197 arg->solution_moves->nmoves-1] = m; 197 arg->solution_moves->nmoves-1] = m;
@@ -209,7 +209,7 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1])
209 } else { 209 } else {
210 arg->solution_moves->npremoves++; 210 arg->solution_moves->npremoves++;
211 for (m = 0; m < 18; m++) { 211 for (m = 0; m < 18; m++) {
212 if(!(mm_inverse & (UINT32_C(1) << (uint32_t)m))) 212 if(!(mm_inverse & MM_SINGLE(m)))
213 continue; 213 continue;
214 arg->solution_moves->premoves[ 214 arg->solution_moves->premoves[
215 arg->solution_moves->npremoves-1] = m; 215 arg->solution_moves->npremoves-1] = m;
@@ -258,8 +258,8 @@ solve_h48_runthread(void *arg)
258 dfsarg->lb_inverse = 0; 258 dfsarg->lb_inverse = 0;
259 dfsarg->use_lb_normal = false; 259 dfsarg->use_lb_normal = false;
260 dfsarg->use_lb_inverse = false; 260 dfsarg->use_lb_inverse = false;
261 dfsarg->movemask_normal = MM_ALLMOVES; 261 dfsarg->movemask_normal = MM18_ALLMOVES;
262 dfsarg->movemask_inverse = MM_ALLMOVES; 262 dfsarg->movemask_inverse = MM18_ALLMOVES;
263 263
264 solve_h48_dfs(dfsarg); 264 solve_h48_dfs(dfsarg);
265 } 265 }
@@ -278,7 +278,7 @@ solve_h48_maketasks(
278 int r; 278 int r;
279 int64_t appret; 279 int64_t appret;
280 uint8_t m, t; 280 uint8_t m, t;
281 uint32_t mm; 281 uint64_t mm;
282 cube_t backup_cube; 282 cube_t backup_cube;
283 solution_moves_t moves; 283 solution_moves_t moves;
284 284
@@ -308,7 +308,7 @@ solve_h48_maketasks(
308 } 308 }
309 309
310 if (maketasks_arg->nmoves == 0) { 310 if (maketasks_arg->nmoves == 0) {
311 mm = MM_ALLMOVES; 311 mm = MM18_ALLMOVES;
312 } else { 312 } else {
313 m = maketasks_arg->moves[maketasks_arg->nmoves-1]; 313 m = maketasks_arg->moves[maketasks_arg->nmoves-1];
314 mm = allowedmask[movebase(m)]; 314 mm = allowedmask[movebase(m)];
@@ -317,7 +317,7 @@ solve_h48_maketasks(
317 maketasks_arg->nmoves++; 317 maketasks_arg->nmoves++;
318 backup_cube = maketasks_arg->cube; 318 backup_cube = maketasks_arg->cube;
319 for (m = 0; m < 18; m++) { 319 for (m = 0; m < 18; m++) {
320 if (!(mm & (1 << m))) 320 if (!(mm & MM_SINGLE(m)))
321 continue; 321 continue;
322 maketasks_arg->moves[maketasks_arg->nmoves-1] = m; 322 maketasks_arg->moves[maketasks_arg->nmoves-1] = m;
323 maketasks_arg->cube = move(backup_cube, m); 323 maketasks_arg->cube = move(backup_cube, m);
@@ -330,9 +330,8 @@ solve_h48_maketasks(
330 if (maketasks_arg->nmoves == 1) 330 if (maketasks_arg->nmoves == 1)
331 for (t = 0; t < NTRANS; t++) 331 for (t = 0; t < NTRANS; t++)
332 if (solve_arg->solution_settings->tmask & 332 if (solve_arg->solution_settings->tmask &
333 (UINT64_C(1) << (uint64_t)t)) 333 TM_SINGLE(t))
334 mm &= ~(UINT32_C(1) << 334 mm &= ~MM_SINGLE(transform_move(m, t));
335 (uint32_t)transform_move(m, t));
336 } 335 }
337 maketasks_arg->nmoves--; 336 maketasks_arg->nmoves--;
338 maketasks_arg->cube = backup_cube; 337 maketasks_arg->cube = backup_cube;
diff --git a/test/030_move/000_nomove_solved.in b/test/030_applymoves/000_nomove_solved.in
index 149c123..149c123 100644
--- a/test/030_move/000_nomove_solved.in
+++ b/test/030_applymoves/000_nomove_solved.in
diff --git a/test/030_move/000_nomove_solved.out b/test/030_applymoves/000_nomove_solved.out
index 5aa6ba7..5aa6ba7 100644
--- a/test/030_move/000_nomove_solved.out
+++ b/test/030_applymoves/000_nomove_solved.out
diff --git a/test/030_move/001_nomove_scrambled.in b/test/030_applymoves/001_nomove_scrambled.in
index 700d45f..700d45f 100644
--- a/test/030_move/001_nomove_scrambled.in
+++ b/test/030_applymoves/001_nomove_scrambled.in
diff --git a/test/030_move/001_nomove_scrambled.out b/test/030_applymoves/001_nomove_scrambled.out
index d1fc648..d1fc648 100644
--- a/test/030_move/001_nomove_scrambled.out
+++ b/test/030_applymoves/001_nomove_scrambled.out
diff --git a/test/030_move/010_U_solved.in b/test/030_applymoves/010_U_solved.in
index 3c87da7..3c87da7 100644
--- a/test/030_move/010_U_solved.in
+++ b/test/030_applymoves/010_U_solved.in
diff --git a/test/030_move/010_U_solved.out b/test/030_applymoves/010_U_solved.out
index 250d3a1..250d3a1 100644
--- a/test/030_move/010_U_solved.out
+++ b/test/030_applymoves/010_U_solved.out
diff --git a/test/030_move/011_U_scrambled.in b/test/030_applymoves/011_U_scrambled.in
index 7245f4e..7245f4e 100644
--- a/test/030_move/011_U_scrambled.in
+++ b/test/030_applymoves/011_U_scrambled.in
diff --git a/test/030_move/011_U_scrambled.out b/test/030_applymoves/011_U_scrambled.out
index fb9b6c9..fb9b6c9 100644
--- a/test/030_move/011_U_scrambled.out
+++ b/test/030_applymoves/011_U_scrambled.out
diff --git a/test/030_move/012_U_inverse.in b/test/030_applymoves/012_U_inverse.in
index 4a41554..4a41554 100644
--- a/test/030_move/012_U_inverse.in
+++ b/test/030_applymoves/012_U_inverse.in
diff --git a/test/030_move/012_U_inverse.out b/test/030_applymoves/012_U_inverse.out
index 5aa6ba7..5aa6ba7 100644
--- a/test/030_move/012_U_inverse.out
+++ b/test/030_applymoves/012_U_inverse.out
diff --git a/test/030_move/020_U2_solved.in b/test/030_applymoves/020_U2_solved.in
index a261a22..a261a22 100644
--- a/test/030_move/020_U2_solved.in
+++ b/test/030_applymoves/020_U2_solved.in
diff --git a/test/030_move/020_U2_solved.out b/test/030_applymoves/020_U2_solved.out
index b14792e..b14792e 100644
--- a/test/030_move/020_U2_solved.out
+++ b/test/030_applymoves/020_U2_solved.out
diff --git a/test/030_move/021_U2_scrambled.in b/test/030_applymoves/021_U2_scrambled.in
index 5e7fab6..5e7fab6 100644
--- a/test/030_move/021_U2_scrambled.in
+++ b/test/030_applymoves/021_U2_scrambled.in
diff --git a/test/030_move/021_U2_scrambled.out b/test/030_applymoves/021_U2_scrambled.out
index c95806f..c95806f 100644
--- a/test/030_move/021_U2_scrambled.out
+++ b/test/030_applymoves/021_U2_scrambled.out
diff --git a/test/030_move/022_U2_inverse.in b/test/030_applymoves/022_U2_inverse.in
index 071ab85..071ab85 100644
--- a/test/030_move/022_U2_inverse.in
+++ b/test/030_applymoves/022_U2_inverse.in
diff --git a/test/030_move/022_U2_inverse.out b/test/030_applymoves/022_U2_inverse.out
index 5aa6ba7..5aa6ba7 100644
--- a/test/030_move/022_U2_inverse.out
+++ b/test/030_applymoves/022_U2_inverse.out
diff --git a/test/030_move/030_U3_solved.in b/test/030_applymoves/030_U3_solved.in
index 42bfad7..42bfad7 100644
--- a/test/030_move/030_U3_solved.in
+++ b/test/030_applymoves/030_U3_solved.in
diff --git a/test/030_move/030_U3_solved.out b/test/030_applymoves/030_U3_solved.out
index 111ba2b..111ba2b 100644
--- a/test/030_move/030_U3_solved.out
+++ b/test/030_applymoves/030_U3_solved.out
diff --git a/test/030_move/031_U3_inverse.in b/test/030_applymoves/031_U3_inverse.in
index 50788bd..50788bd 100644
--- a/test/030_move/031_U3_inverse.in
+++ b/test/030_applymoves/031_U3_inverse.in
diff --git a/test/030_move/031_U3_inverse.out b/test/030_applymoves/031_U3_inverse.out
index 5aa6ba7..5aa6ba7 100644
--- a/test/030_move/031_U3_inverse.out
+++ b/test/030_applymoves/031_U3_inverse.out
diff --git a/test/030_move/032_U3_scrambled.in b/test/030_applymoves/032_U3_scrambled.in
index 49293ff..49293ff 100644
--- a/test/030_move/032_U3_scrambled.in
+++ b/test/030_applymoves/032_U3_scrambled.in
diff --git a/test/030_move/032_U3_scrambled.out b/test/030_applymoves/032_U3_scrambled.out
index 80862a2..80862a2 100644
--- a/test/030_move/032_U3_scrambled.out
+++ b/test/030_applymoves/032_U3_scrambled.out
diff --git a/test/030_move/033_U3_with_prime.in b/test/030_applymoves/033_U3_with_prime.in
index 7c16119..7c16119 100644
--- a/test/030_move/033_U3_with_prime.in
+++ b/test/030_applymoves/033_U3_with_prime.in
diff --git a/test/030_move/033_U3_with_prime.out b/test/030_applymoves/033_U3_with_prime.out
index 111ba2b..111ba2b 100644
--- a/test/030_move/033_U3_with_prime.out
+++ b/test/030_applymoves/033_U3_with_prime.out
diff --git a/test/030_move/040_D_solved.in b/test/030_applymoves/040_D_solved.in
index adc471e..adc471e 100644
--- a/test/030_move/040_D_solved.in
+++ b/test/030_applymoves/040_D_solved.in
diff --git a/test/030_move/040_D_solved.out b/test/030_applymoves/040_D_solved.out
index ffcea5d..ffcea5d 100644
--- a/test/030_move/040_D_solved.out
+++ b/test/030_applymoves/040_D_solved.out
diff --git a/test/030_move/050_D2_solved.in b/test/030_applymoves/050_D2_solved.in
index 0696727..0696727 100644
--- a/test/030_move/050_D2_solved.in
+++ b/test/030_applymoves/050_D2_solved.in
diff --git a/test/030_move/050_D2_solved.out b/test/030_applymoves/050_D2_solved.out
index f872210..f872210 100644
--- a/test/030_move/050_D2_solved.out
+++ b/test/030_applymoves/050_D2_solved.out
diff --git a/test/030_move/060_D3_solved.in b/test/030_applymoves/060_D3_solved.in
index 867183d..867183d 100644
--- a/test/030_move/060_D3_solved.in
+++ b/test/030_applymoves/060_D3_solved.in
diff --git a/test/030_move/060_D3_solved.out b/test/030_applymoves/060_D3_solved.out
index acd829c..acd829c 100644
--- a/test/030_move/060_D3_solved.out
+++ b/test/030_applymoves/060_D3_solved.out
diff --git a/test/030_move/070_R_solved.in b/test/030_applymoves/070_R_solved.in
index e164209..e164209 100644
--- a/test/030_move/070_R_solved.in
+++ b/test/030_applymoves/070_R_solved.in
diff --git a/test/030_move/070_R_solved.out b/test/030_applymoves/070_R_solved.out
index 1be2e89..1be2e89 100644
--- a/test/030_move/070_R_solved.out
+++ b/test/030_applymoves/070_R_solved.out
diff --git a/test/030_move/071_R_scrambled.in b/test/030_applymoves/071_R_scrambled.in
index 4134942..4134942 100644
--- a/test/030_move/071_R_scrambled.in
+++ b/test/030_applymoves/071_R_scrambled.in
diff --git a/test/030_move/071_R_scrambled.out b/test/030_applymoves/071_R_scrambled.out
index 1711b22..1711b22 100644
--- a/test/030_move/071_R_scrambled.out
+++ b/test/030_applymoves/071_R_scrambled.out
diff --git a/test/030_move/080_R2_solved.in b/test/030_applymoves/080_R2_solved.in
index 25b0b10..25b0b10 100644
--- a/test/030_move/080_R2_solved.in
+++ b/test/030_applymoves/080_R2_solved.in
diff --git a/test/030_move/080_R2_solved.out b/test/030_applymoves/080_R2_solved.out
index 6611740..6611740 100644
--- a/test/030_move/080_R2_solved.out
+++ b/test/030_applymoves/080_R2_solved.out
diff --git a/test/030_move/090_R3_solved.in b/test/030_applymoves/090_R3_solved.in
index ffab472..ffab472 100644
--- a/test/030_move/090_R3_solved.in
+++ b/test/030_applymoves/090_R3_solved.in
diff --git a/test/030_move/090_R3_solved.out b/test/030_applymoves/090_R3_solved.out
index a14e69b..a14e69b 100644
--- a/test/030_move/090_R3_solved.out
+++ b/test/030_applymoves/090_R3_solved.out
diff --git a/test/030_move/100_L_solved.in b/test/030_applymoves/100_L_solved.in
index e47b8ff..e47b8ff 100644
--- a/test/030_move/100_L_solved.in
+++ b/test/030_applymoves/100_L_solved.in
diff --git a/test/030_move/100_L_solved.out b/test/030_applymoves/100_L_solved.out
index 5aa4131..5aa4131 100644
--- a/test/030_move/100_L_solved.out
+++ b/test/030_applymoves/100_L_solved.out
diff --git a/test/030_move/110_L2_solved.in b/test/030_applymoves/110_L2_solved.in
index c71e7ff..c71e7ff 100644
--- a/test/030_move/110_L2_solved.in
+++ b/test/030_applymoves/110_L2_solved.in
diff --git a/test/030_move/110_L2_solved.out b/test/030_applymoves/110_L2_solved.out
index 4fe322f..4fe322f 100644
--- a/test/030_move/110_L2_solved.out
+++ b/test/030_applymoves/110_L2_solved.out
diff --git a/test/030_move/120_L3_solved.in b/test/030_applymoves/120_L3_solved.in
index 7f82d91..7f82d91 100644
--- a/test/030_move/120_L3_solved.in
+++ b/test/030_applymoves/120_L3_solved.in
diff --git a/test/030_move/120_L3_solved.out b/test/030_applymoves/120_L3_solved.out
index fbe35f3..fbe35f3 100644
--- a/test/030_move/120_L3_solved.out
+++ b/test/030_applymoves/120_L3_solved.out
diff --git a/test/030_move/130_F_solved.in b/test/030_applymoves/130_F_solved.in
index dcb65dc..dcb65dc 100644
--- a/test/030_move/130_F_solved.in
+++ b/test/030_applymoves/130_F_solved.in
diff --git a/test/030_move/130_F_solved.out b/test/030_applymoves/130_F_solved.out
index a75744c..a75744c 100644
--- a/test/030_move/130_F_solved.out
+++ b/test/030_applymoves/130_F_solved.out
diff --git a/test/030_move/132_F_scrambled.in b/test/030_applymoves/132_F_scrambled.in
index e793507..e793507 100644
--- a/test/030_move/132_F_scrambled.in
+++ b/test/030_applymoves/132_F_scrambled.in
diff --git a/test/030_move/132_F_scrambled.out b/test/030_applymoves/132_F_scrambled.out
index 2992f71..2992f71 100644
--- a/test/030_move/132_F_scrambled.out
+++ b/test/030_applymoves/132_F_scrambled.out
diff --git a/test/030_move/133_F_scrambled_2.in b/test/030_applymoves/133_F_scrambled_2.in
index 35af326..35af326 100644
--- a/test/030_move/133_F_scrambled_2.in
+++ b/test/030_applymoves/133_F_scrambled_2.in
diff --git a/test/030_move/133_F_scrambled_2.out b/test/030_applymoves/133_F_scrambled_2.out
index 7fd0f96..7fd0f96 100644
--- a/test/030_move/133_F_scrambled_2.out
+++ b/test/030_applymoves/133_F_scrambled_2.out
diff --git a/test/030_move/140_F2_solved.in b/test/030_applymoves/140_F2_solved.in
index 9ac2bbf..9ac2bbf 100644
--- a/test/030_move/140_F2_solved.in
+++ b/test/030_applymoves/140_F2_solved.in
diff --git a/test/030_move/140_F2_solved.out b/test/030_applymoves/140_F2_solved.out
index 69720be..69720be 100644
--- a/test/030_move/140_F2_solved.out
+++ b/test/030_applymoves/140_F2_solved.out
diff --git a/test/030_move/150_F3_solved.in b/test/030_applymoves/150_F3_solved.in
index dbfb928..dbfb928 100644
--- a/test/030_move/150_F3_solved.in
+++ b/test/030_applymoves/150_F3_solved.in
diff --git a/test/030_move/150_F3_solved.out b/test/030_applymoves/150_F3_solved.out
index 500d969..500d969 100644
--- a/test/030_move/150_F3_solved.out
+++ b/test/030_applymoves/150_F3_solved.out
diff --git a/test/030_move/160_B_solved.in b/test/030_applymoves/160_B_solved.in
index 25b045d..25b045d 100644
--- a/test/030_move/160_B_solved.in
+++ b/test/030_applymoves/160_B_solved.in
diff --git a/test/030_move/160_B_solved.out b/test/030_applymoves/160_B_solved.out
index 73e099a..73e099a 100644
--- a/test/030_move/160_B_solved.out
+++ b/test/030_applymoves/160_B_solved.out
diff --git a/test/030_move/170_B2_solved.in b/test/030_applymoves/170_B2_solved.in
index bd25f3a..bd25f3a 100644
--- a/test/030_move/170_B2_solved.in
+++ b/test/030_applymoves/170_B2_solved.in
diff --git a/test/030_move/170_B2_solved.out b/test/030_applymoves/170_B2_solved.out
index 1021aeb..1021aeb 100644
--- a/test/030_move/170_B2_solved.out
+++ b/test/030_applymoves/170_B2_solved.out
diff --git a/test/030_move/180_B3_solved.in b/test/030_applymoves/180_B3_solved.in
index a38d932..a38d932 100644
--- a/test/030_move/180_B3_solved.in
+++ b/test/030_applymoves/180_B3_solved.in
diff --git a/test/030_move/180_B3_solved.out b/test/030_applymoves/180_B3_solved.out
index 78bd94a..78bd94a 100644
--- a/test/030_move/180_B3_solved.out
+++ b/test/030_applymoves/180_B3_solved.out
diff --git a/test/030_move/200_scramble_solved.in b/test/030_applymoves/200_scramble_solved.in
index 65127d4..65127d4 100644
--- a/test/030_move/200_scramble_solved.in
+++ b/test/030_applymoves/200_scramble_solved.in
diff --git a/test/030_move/200_scramble_solved.out b/test/030_applymoves/200_scramble_solved.out
index 6d77f16..6d77f16 100644
--- a/test/030_move/200_scramble_solved.out
+++ b/test/030_applymoves/200_scramble_solved.out
diff --git a/test/030_move/201_solution_scrambled.in b/test/030_applymoves/201_solution_scrambled.in
index e4d20b5..e4d20b5 100644
--- a/test/030_move/201_solution_scrambled.in
+++ b/test/030_applymoves/201_solution_scrambled.in
diff --git a/test/030_move/201_solution_scrambled.out b/test/030_applymoves/201_solution_scrambled.out
index 5aa6ba7..5aa6ba7 100644
--- a/test/030_move/201_solution_scrambled.out
+++ b/test/030_applymoves/201_solution_scrambled.out
diff --git a/test/030_move/300_multimove_solved.in b/test/030_applymoves/300_multimove_solved.in
index 751602a..751602a 100644
--- a/test/030_move/300_multimove_solved.in
+++ b/test/030_applymoves/300_multimove_solved.in
diff --git a/test/030_move/300_multimove_solved.out b/test/030_applymoves/300_multimove_solved.out
index d069105..d069105 100644
--- a/test/030_move/300_multimove_solved.out
+++ b/test/030_applymoves/300_multimove_solved.out
diff --git a/test/030_move/301_multimove_scrambled.in b/test/030_applymoves/301_multimove_scrambled.in
index dbe14c6..dbe14c6 100644
--- a/test/030_move/301_multimove_scrambled.in
+++ b/test/030_applymoves/301_multimove_scrambled.in
diff --git a/test/030_move/301_multimove_scrambled.out b/test/030_applymoves/301_multimove_scrambled.out
index 9c668da..9c668da 100644
--- a/test/030_move/301_multimove_scrambled.out
+++ b/test/030_applymoves/301_multimove_scrambled.out
diff --git a/test/030_move/500_Uw_solved.in b/test/030_applymoves/500_Uw_solved.in
index 3e79076..3e79076 100644
--- a/test/030_move/500_Uw_solved.in
+++ b/test/030_applymoves/500_Uw_solved.in
diff --git a/test/030_move/500_Uw_solved.out b/test/030_applymoves/500_Uw_solved.out
index fc08019..fc08019 100644
--- a/test/030_move/500_Uw_solved.out
+++ b/test/030_applymoves/500_Uw_solved.out
diff --git a/test/030_move/501_Uw2_solved.in b/test/030_applymoves/501_Uw2_solved.in
index fb0cf4b..fb0cf4b 100644
--- a/test/030_move/501_Uw2_solved.in
+++ b/test/030_applymoves/501_Uw2_solved.in
diff --git a/test/030_move/501_Uw2_solved.out b/test/030_applymoves/501_Uw2_solved.out
index eb734e6..eb734e6 100644
--- a/test/030_move/501_Uw2_solved.out
+++ b/test/030_applymoves/501_Uw2_solved.out
diff --git a/test/030_move/502_Uw3_solved.in b/test/030_applymoves/502_Uw3_solved.in
index 3b4ebf6..3b4ebf6 100644
--- a/test/030_move/502_Uw3_solved.in
+++ b/test/030_applymoves/502_Uw3_solved.in
diff --git a/test/030_move/502_Uw3_solved.out b/test/030_applymoves/502_Uw3_solved.out
index 6724a49..6724a49 100644
--- a/test/030_move/502_Uw3_solved.out
+++ b/test/030_applymoves/502_Uw3_solved.out
diff --git a/test/030_move/503_Dw_solved.in b/test/030_applymoves/503_Dw_solved.in
index da4009e..da4009e 100644
--- a/test/030_move/503_Dw_solved.in
+++ b/test/030_applymoves/503_Dw_solved.in
diff --git a/test/030_move/503_Dw_solved.out b/test/030_applymoves/503_Dw_solved.out
index f554f31..f554f31 100644
--- a/test/030_move/503_Dw_solved.out
+++ b/test/030_applymoves/503_Dw_solved.out
diff --git a/test/030_move/504_Dw2_solved.in b/test/030_applymoves/504_Dw2_solved.in
index 5e403a4..5e403a4 100644
--- a/test/030_move/504_Dw2_solved.in
+++ b/test/030_applymoves/504_Dw2_solved.in
diff --git a/test/030_move/504_Dw2_solved.out b/test/030_applymoves/504_Dw2_solved.out
index 51c13ad..51c13ad 100644
--- a/test/030_move/504_Dw2_solved.out
+++ b/test/030_applymoves/504_Dw2_solved.out
diff --git a/test/030_move/505_Dw3_solved.in b/test/030_applymoves/505_Dw3_solved.in
index d4a9fbb..d4a9fbb 100644
--- a/test/030_move/505_Dw3_solved.in
+++ b/test/030_applymoves/505_Dw3_solved.in
diff --git a/test/030_move/505_Dw3_solved.out b/test/030_applymoves/505_Dw3_solved.out
index b842e86..b842e86 100644
--- a/test/030_move/505_Dw3_solved.out
+++ b/test/030_applymoves/505_Dw3_solved.out
diff --git a/test/030_move/506_Rw_solved.in b/test/030_applymoves/506_Rw_solved.in
index 4387d10..4387d10 100644
--- a/test/030_move/506_Rw_solved.in
+++ b/test/030_applymoves/506_Rw_solved.in
diff --git a/test/030_move/506_Rw_solved.out b/test/030_applymoves/506_Rw_solved.out
index 853c85d..853c85d 100644
--- a/test/030_move/506_Rw_solved.out
+++ b/test/030_applymoves/506_Rw_solved.out
diff --git a/test/030_move/507_Rw2_solved.in b/test/030_applymoves/507_Rw2_solved.in
index 3510315..3510315 100644
--- a/test/030_move/507_Rw2_solved.in
+++ b/test/030_applymoves/507_Rw2_solved.in
diff --git a/test/030_move/507_Rw2_solved.out b/test/030_applymoves/507_Rw2_solved.out
index f89caca..f89caca 100644
--- a/test/030_move/507_Rw2_solved.out
+++ b/test/030_applymoves/507_Rw2_solved.out
diff --git a/test/030_move/508_Rw3_solved.in b/test/030_applymoves/508_Rw3_solved.in
index 69cb0b2..69cb0b2 100644
--- a/test/030_move/508_Rw3_solved.in
+++ b/test/030_applymoves/508_Rw3_solved.in
diff --git a/test/030_move/508_Rw3_solved.out b/test/030_applymoves/508_Rw3_solved.out
index 38ae9a9..38ae9a9 100644
--- a/test/030_move/508_Rw3_solved.out
+++ b/test/030_applymoves/508_Rw3_solved.out
diff --git a/test/030_move/509_Lw_solved.in b/test/030_applymoves/509_Lw_solved.in
index ddd8aea..ddd8aea 100644
--- a/test/030_move/509_Lw_solved.in
+++ b/test/030_applymoves/509_Lw_solved.in
diff --git a/test/030_move/509_Lw_solved.out b/test/030_applymoves/509_Lw_solved.out
index b588134..b588134 100644
--- a/test/030_move/509_Lw_solved.out
+++ b/test/030_applymoves/509_Lw_solved.out
diff --git a/test/030_move/510_Lw2_solved.in b/test/030_applymoves/510_Lw2_solved.in
index c0a00b3..c0a00b3 100644
--- a/test/030_move/510_Lw2_solved.in
+++ b/test/030_applymoves/510_Lw2_solved.in
diff --git a/test/030_move/510_Lw2_solved.out b/test/030_applymoves/510_Lw2_solved.out
index 9d468db..9d468db 100644
--- a/test/030_move/510_Lw2_solved.out
+++ b/test/030_applymoves/510_Lw2_solved.out
diff --git a/test/030_move/511_Lw3_solved.in b/test/030_applymoves/511_Lw3_solved.in
index 94b1333..94b1333 100644
--- a/test/030_move/511_Lw3_solved.in
+++ b/test/030_applymoves/511_Lw3_solved.in
diff --git a/test/030_move/511_Lw3_solved.out b/test/030_applymoves/511_Lw3_solved.out
index d4f17bb..d4f17bb 100644
--- a/test/030_move/511_Lw3_solved.out
+++ b/test/030_applymoves/511_Lw3_solved.out
diff --git a/test/030_move/512_Fw_solved.in b/test/030_applymoves/512_Fw_solved.in
index 179dab4..179dab4 100644
--- a/test/030_move/512_Fw_solved.in
+++ b/test/030_applymoves/512_Fw_solved.in
diff --git a/test/030_move/512_Fw_solved.out b/test/030_applymoves/512_Fw_solved.out
index 966f275..966f275 100644
--- a/test/030_move/512_Fw_solved.out
+++ b/test/030_applymoves/512_Fw_solved.out
diff --git a/test/030_move/513_Fw2_solved.in b/test/030_applymoves/513_Fw2_solved.in
index 94fd724..94fd724 100644
--- a/test/030_move/513_Fw2_solved.in
+++ b/test/030_applymoves/513_Fw2_solved.in
diff --git a/test/030_move/513_Fw2_solved.out b/test/030_applymoves/513_Fw2_solved.out
index 06c3560..06c3560 100644
--- a/test/030_move/513_Fw2_solved.out
+++ b/test/030_applymoves/513_Fw2_solved.out
diff --git a/test/030_move/514_Fw3_solved.in b/test/030_applymoves/514_Fw3_solved.in
index 5287f6a..5287f6a 100644
--- a/test/030_move/514_Fw3_solved.in
+++ b/test/030_applymoves/514_Fw3_solved.in
diff --git a/test/030_move/514_Fw3_solved.out b/test/030_applymoves/514_Fw3_solved.out
index 659a09e..659a09e 100644
--- a/test/030_move/514_Fw3_solved.out
+++ b/test/030_applymoves/514_Fw3_solved.out
diff --git a/test/030_move/515_Bw_solved.in b/test/030_applymoves/515_Bw_solved.in
index 13eac57..13eac57 100644
--- a/test/030_move/515_Bw_solved.in
+++ b/test/030_applymoves/515_Bw_solved.in
diff --git a/test/030_move/515_Bw_solved.out b/test/030_applymoves/515_Bw_solved.out
index 28af170..28af170 100644
--- a/test/030_move/515_Bw_solved.out
+++ b/test/030_applymoves/515_Bw_solved.out
diff --git a/test/030_move/516_Bw2_solved.in b/test/030_applymoves/516_Bw2_solved.in
index 989ad7c..989ad7c 100644
--- a/test/030_move/516_Bw2_solved.in
+++ b/test/030_applymoves/516_Bw2_solved.in
diff --git a/test/030_move/516_Bw2_solved.out b/test/030_applymoves/516_Bw2_solved.out
index 43b400d..43b400d 100644
--- a/test/030_move/516_Bw2_solved.out
+++ b/test/030_applymoves/516_Bw2_solved.out
diff --git a/test/030_move/517_Bw3_solved.in b/test/030_applymoves/517_Bw3_solved.in
index a53c4e9..a53c4e9 100644
--- a/test/030_move/517_Bw3_solved.in
+++ b/test/030_applymoves/517_Bw3_solved.in
diff --git a/test/030_move/517_Bw3_solved.out b/test/030_applymoves/517_Bw3_solved.out
index e10aaf5..e10aaf5 100644
--- a/test/030_move/517_Bw3_solved.out
+++ b/test/030_applymoves/517_Bw3_solved.out
diff --git a/test/030_move/518_M_solved.in b/test/030_applymoves/518_M_solved.in
index 599d8ff..599d8ff 100644
--- a/test/030_move/518_M_solved.in
+++ b/test/030_applymoves/518_M_solved.in
diff --git a/test/030_move/518_M_solved.out b/test/030_applymoves/518_M_solved.out
index 6b28216..6b28216 100644
--- a/test/030_move/518_M_solved.out
+++ b/test/030_applymoves/518_M_solved.out
diff --git a/test/030_move/519_M2_solved.in b/test/030_applymoves/519_M2_solved.in
index d0479b8..d0479b8 100644
--- a/test/030_move/519_M2_solved.in
+++ b/test/030_applymoves/519_M2_solved.in
diff --git a/test/030_move/519_M2_solved.out b/test/030_applymoves/519_M2_solved.out
index e28cb4e..e28cb4e 100644
--- a/test/030_move/519_M2_solved.out
+++ b/test/030_applymoves/519_M2_solved.out
diff --git a/test/030_move/520_M3_solved.in b/test/030_applymoves/520_M3_solved.in
index 32bff5a..32bff5a 100644
--- a/test/030_move/520_M3_solved.in
+++ b/test/030_applymoves/520_M3_solved.in
diff --git a/test/030_move/520_M3_solved.out b/test/030_applymoves/520_M3_solved.out
index 1d47a15..1d47a15 100644
--- a/test/030_move/520_M3_solved.out
+++ b/test/030_applymoves/520_M3_solved.out
diff --git a/test/030_move/521_S_solved.in b/test/030_applymoves/521_S_solved.in
index 9e08bff..9e08bff 100644
--- a/test/030_move/521_S_solved.in
+++ b/test/030_applymoves/521_S_solved.in
diff --git a/test/030_move/521_S_solved.out b/test/030_applymoves/521_S_solved.out
index 74b55a2..74b55a2 100644
--- a/test/030_move/521_S_solved.out
+++ b/test/030_applymoves/521_S_solved.out
diff --git a/test/030_move/522_S2_solved.in b/test/030_applymoves/522_S2_solved.in
index 49818d0..49818d0 100644
--- a/test/030_move/522_S2_solved.in
+++ b/test/030_applymoves/522_S2_solved.in
diff --git a/test/030_move/522_S2_solved.out b/test/030_applymoves/522_S2_solved.out
index 85245c3..85245c3 100644
--- a/test/030_move/522_S2_solved.out
+++ b/test/030_applymoves/522_S2_solved.out
diff --git a/test/030_move/523_S3_solved.in b/test/030_applymoves/523_S3_solved.in
index 3cdc3d6..3cdc3d6 100644
--- a/test/030_move/523_S3_solved.in
+++ b/test/030_applymoves/523_S3_solved.in
diff --git a/test/030_move/523_S3_solved.out b/test/030_applymoves/523_S3_solved.out
index ac53534..ac53534 100644
--- a/test/030_move/523_S3_solved.out
+++ b/test/030_applymoves/523_S3_solved.out
diff --git a/test/030_move/524_E_solved.in b/test/030_applymoves/524_E_solved.in
index 03b48ef..03b48ef 100644
--- a/test/030_move/524_E_solved.in
+++ b/test/030_applymoves/524_E_solved.in
diff --git a/test/030_move/524_E_solved.out b/test/030_applymoves/524_E_solved.out
index 54fcf98..54fcf98 100644
--- a/test/030_move/524_E_solved.out
+++ b/test/030_applymoves/524_E_solved.out
diff --git a/test/030_move/525_E2_solved.in b/test/030_applymoves/525_E2_solved.in
index faee27c..faee27c 100644
--- a/test/030_move/525_E2_solved.in
+++ b/test/030_applymoves/525_E2_solved.in
diff --git a/test/030_move/525_E2_solved.out b/test/030_applymoves/525_E2_solved.out
index 330a390..330a390 100644
--- a/test/030_move/525_E2_solved.out
+++ b/test/030_applymoves/525_E2_solved.out
diff --git a/test/030_move/526_E3_solved.in b/test/030_applymoves/526_E3_solved.in
index 17fa78d..17fa78d 100644
--- a/test/030_move/526_E3_solved.in
+++ b/test/030_applymoves/526_E3_solved.in
diff --git a/test/030_move/526_E3_solved.out b/test/030_applymoves/526_E3_solved.out
index cb55358..cb55358 100644
--- a/test/030_move/526_E3_solved.out
+++ b/test/030_applymoves/526_E3_solved.out
diff --git a/test/030_move/527_x_solved.in b/test/030_applymoves/527_x_solved.in
index f26b8c5..f26b8c5 100644
--- a/test/030_move/527_x_solved.in
+++ b/test/030_applymoves/527_x_solved.in
diff --git a/test/030_move/527_x_solved.out b/test/030_applymoves/527_x_solved.out
index 29fefad..29fefad 100644
--- a/test/030_move/527_x_solved.out
+++ b/test/030_applymoves/527_x_solved.out
diff --git a/test/030_move/528_x2_solved.in b/test/030_applymoves/528_x2_solved.in
index c538316..c538316 100644
--- a/test/030_move/528_x2_solved.in
+++ b/test/030_applymoves/528_x2_solved.in
diff --git a/test/030_move/528_x2_solved.out b/test/030_applymoves/528_x2_solved.out
index cebf79a..cebf79a 100644
--- a/test/030_move/528_x2_solved.out
+++ b/test/030_applymoves/528_x2_solved.out
diff --git a/test/030_move/529_x3_solved.in b/test/030_applymoves/529_x3_solved.in
index cc314b4..cc314b4 100644
--- a/test/030_move/529_x3_solved.in
+++ b/test/030_applymoves/529_x3_solved.in
diff --git a/test/030_move/529_x3_solved.out b/test/030_applymoves/529_x3_solved.out
index 2449874..2449874 100644
--- a/test/030_move/529_x3_solved.out
+++ b/test/030_applymoves/529_x3_solved.out
diff --git a/test/030_move/530_y_solved.in b/test/030_applymoves/530_y_solved.in
index 07ec332..07ec332 100644
--- a/test/030_move/530_y_solved.in
+++ b/test/030_applymoves/530_y_solved.in
diff --git a/test/030_move/530_y_solved.out b/test/030_applymoves/530_y_solved.out
index 4749dd6..4749dd6 100644
--- a/test/030_move/530_y_solved.out
+++ b/test/030_applymoves/530_y_solved.out
diff --git a/test/030_move/531_y2_solved.in b/test/030_applymoves/531_y2_solved.in
index a77c990..a77c990 100644
--- a/test/030_move/531_y2_solved.in
+++ b/test/030_applymoves/531_y2_solved.in
diff --git a/test/030_move/531_y2_solved.out b/test/030_applymoves/531_y2_solved.out
index c876a74..c876a74 100644
--- a/test/030_move/531_y2_solved.out
+++ b/test/030_applymoves/531_y2_solved.out
diff --git a/test/030_move/532_y3_solved.in b/test/030_applymoves/532_y3_solved.in
index d52024c..d52024c 100644
--- a/test/030_move/532_y3_solved.in
+++ b/test/030_applymoves/532_y3_solved.in
diff --git a/test/030_move/532_y3_solved.out b/test/030_applymoves/532_y3_solved.out
index 3a5afc2..3a5afc2 100644
--- a/test/030_move/532_y3_solved.out
+++ b/test/030_applymoves/532_y3_solved.out
diff --git a/test/030_move/533_z_solved.in b/test/030_applymoves/533_z_solved.in
index af78379..af78379 100644
--- a/test/030_move/533_z_solved.in
+++ b/test/030_applymoves/533_z_solved.in
diff --git a/test/030_move/533_z_solved.out b/test/030_applymoves/533_z_solved.out
index 9267695..9267695 100644
--- a/test/030_move/533_z_solved.out
+++ b/test/030_applymoves/533_z_solved.out
diff --git a/test/030_move/534_z2_solved.in b/test/030_applymoves/534_z2_solved.in
index 2f702a1..2f702a1 100644
--- a/test/030_move/534_z2_solved.in
+++ b/test/030_applymoves/534_z2_solved.in
diff --git a/test/030_move/534_z2_solved.out b/test/030_applymoves/534_z2_solved.out
index 94daec7..94daec7 100644
--- a/test/030_move/534_z2_solved.out
+++ b/test/030_applymoves/534_z2_solved.out
diff --git a/test/030_move/535_z3_solved.in b/test/030_applymoves/535_z3_solved.in
index f697279..f697279 100644
--- a/test/030_move/535_z3_solved.in
+++ b/test/030_applymoves/535_z3_solved.in
diff --git a/test/030_move/535_z3_solved.out b/test/030_applymoves/535_z3_solved.out
index fd02d56..fd02d56 100644
--- a/test/030_move/535_z3_solved.out
+++ b/test/030_applymoves/535_z3_solved.out
diff --git a/test/030_move/550_scrambled_random.in b/test/030_applymoves/550_scrambled_random.in
index 35cd8bd..35cd8bd 100644
--- a/test/030_move/550_scrambled_random.in
+++ b/test/030_applymoves/550_scrambled_random.in
diff --git a/test/030_move/550_scrambled_random.out b/test/030_applymoves/550_scrambled_random.out
index b3f81b0..b3f81b0 100644
--- a/test/030_move/550_scrambled_random.out
+++ b/test/030_applymoves/550_scrambled_random.out
diff --git a/test/030_move/559_solved_xzy.in b/test/030_applymoves/559_solved_xzy.in
index 9bc374d..9bc374d 100644
--- a/test/030_move/559_solved_xzy.in
+++ b/test/030_applymoves/559_solved_xzy.in
diff --git a/test/030_move/559_solved_xzy.out b/test/030_applymoves/559_solved_xzy.out
index 9267695..9267695 100644
--- a/test/030_move/559_solved_xzy.out
+++ b/test/030_applymoves/559_solved_xzy.out
diff --git a/test/030_move/560_solved_RwS.in b/test/030_applymoves/560_solved_RwS.in
index 8ae51a9..8ae51a9 100644
--- a/test/030_move/560_solved_RwS.in
+++ b/test/030_applymoves/560_solved_RwS.in
diff --git a/test/030_move/560_solved_RwS.out b/test/030_applymoves/560_solved_RwS.out
index c33d2a6..c33d2a6 100644
--- a/test/030_move/560_solved_RwS.out
+++ b/test/030_applymoves/560_solved_RwS.out
diff --git a/test/030_move/561_solved_RwSE3.in b/test/030_applymoves/561_solved_RwSE3.in
index f75c1ef..f75c1ef 100644
--- a/test/030_move/561_solved_RwSE3.in
+++ b/test/030_applymoves/561_solved_RwSE3.in
diff --git a/test/030_move/561_solved_RwSE3.out b/test/030_applymoves/561_solved_RwSE3.out
index 4b27b9a..4b27b9a 100644
--- a/test/030_move/561_solved_RwSE3.out
+++ b/test/030_applymoves/561_solved_RwSE3.out
diff --git a/test/030_move/569_returns_to_noreorient.in b/test/030_applymoves/569_returns_to_noreorient.in
index 9e51d26..9e51d26 100644
--- a/test/030_move/569_returns_to_noreorient.in
+++ b/test/030_applymoves/569_returns_to_noreorient.in
diff --git a/test/030_move/569_returns_to_noreorient.out b/test/030_applymoves/569_returns_to_noreorient.out
index 9e419e8..9e419e8 100644
--- a/test/030_move/569_returns_to_noreorient.out
+++ b/test/030_applymoves/569_returns_to_noreorient.out
diff --git a/test/030_applymoves/600_niss_solved.in b/test/030_applymoves/600_niss_solved.in
new file mode 100644
index 0000000..7228e69
--- /dev/null
+++ b/test/030_applymoves/600_niss_solved.in
@@ -0,0 +1,2 @@
1R U R (F L F)
2ABCDEFGH=ABCDEFGHIJKL=A
diff --git a/test/030_applymoves/600_niss_solved.out b/test/030_applymoves/600_niss_solved.out
new file mode 100644
index 0000000..b184385
--- /dev/null
+++ b/test/030_applymoves/600_niss_solved.out
@@ -0,0 +1 @@
DGEAHSFJ=JQCWHDKELIFB=A
diff --git a/test/030_applymoves/601_niss_solved_widenormal.in b/test/030_applymoves/601_niss_solved_widenormal.in
new file mode 100644
index 0000000..983a345
--- /dev/null
+++ b/test/030_applymoves/601_niss_solved_widenormal.in
@@ -0,0 +1,2 @@
1Rw Uw' (F L F)
2ABCDEFGH=ABCDEFGHIJKL=A
diff --git a/test/030_applymoves/601_niss_solved_widenormal.out b/test/030_applymoves/601_niss_solved_widenormal.out
new file mode 100644
index 0000000..85805f3
--- /dev/null
+++ b/test/030_applymoves/601_niss_solved_widenormal.out
@@ -0,0 +1 @@
CUWNQRPT=DabWEFIHJQSR=T
diff --git a/test/030_applymoves/602_scrambled_niss_1x3.in b/test/030_applymoves/602_scrambled_niss_1x3.in
new file mode 100644
index 0000000..dc75db5
--- /dev/null
+++ b/test/030_applymoves/602_scrambled_niss_1x3.in
@@ -0,0 +1,2 @@
1R (F)
2FECDABGH=EFCDBAGHIJKL=A
diff --git a/test/030_applymoves/602_scrambled_niss_1x3.out b/test/030_applymoves/602_scrambled_niss_1x3.out
new file mode 100644
index 0000000..1574617
--- /dev/null
+++ b/test/030_applymoves/602_scrambled_niss_1x3.out
@@ -0,0 +1 @@
KQMRONLH=EFCZTYGLHQKB=A
diff --git a/test/030_applymoves/603_scrambled_long_niss.in b/test/030_applymoves/603_scrambled_long_niss.in
new file mode 100644
index 0000000..2af5854
--- /dev/null
+++ b/test/030_applymoves/603_scrambled_long_niss.in
@@ -0,0 +1,3 @@
1R U R (B D2 F')
2LFWBCAEH=QSabHBIFJWDU=A
3// scrambled cube: "R U R F D B2 L F D' B3"
diff --git a/test/030_applymoves/603_scrambled_long_niss.out b/test/030_applymoves/603_scrambled_long_niss.out
new file mode 100644
index 0000000..89552d1
--- /dev/null
+++ b/test/030_applymoves/603_scrambled_long_niss.out
@@ -0,0 +1 @@
ADXJKNMG=TaYBFJQGUXCL=A
diff --git a/test/030_applymoves/604_scrambled_niss_extendedmoves.in b/test/030_applymoves/604_scrambled_niss_extendedmoves.in
new file mode 100644
index 0000000..a51e4b7
--- /dev/null
+++ b/test/030_applymoves/604_scrambled_niss_extendedmoves.in
@@ -0,0 +1,3 @@
1M y2 F E (Bw D2 Fw' z2)
2LFWBCAEH=QSabHBIFJWDU=A
3// scrambled cube: "R U R F D B2 L F D' B3"
diff --git a/test/030_applymoves/604_scrambled_niss_extendedmoves.out b/test/030_applymoves/604_scrambled_niss_extendedmoves.out
new file mode 100644
index 0000000..fa47221
--- /dev/null
+++ b/test/030_applymoves/604_scrambled_niss_extendedmoves.out
@@ -0,0 +1 @@
EPNOACTJ=WXLDQVZCRYaE=V
diff --git a/test/030_move/move_tests.c b/test/030_applymoves/applymoves_tests.c
index 98c9592..98c9592 100644
--- a/test/030_move/move_tests.c
+++ b/test/030_applymoves/applymoves_tests.c
diff --git a/test/032_countmoves/05_niss.in b/test/032_countmoves/05_niss.in
new file mode 100644
index 0000000..692e6c8
--- /dev/null
+++ b/test/032_countmoves/05_niss.in
@@ -0,0 +1 @@
R2 M Uw (Fw2 M2 y2)
diff --git a/test/032_countmoves/05_niss.out b/test/032_countmoves/05_niss.out
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/test/032_countmoves/05_niss.out
@@ -0,0 +1 @@
7
diff --git a/test/033_inverse_move/inverse_move_tests.c b/test/033_inverse_move/inverse_move_tests.c
index dc9845c..e9bad0c 100644
--- a/test/033_inverse_move/inverse_move_tests.c
+++ b/test/033_inverse_move/inverse_move_tests.c
@@ -2,19 +2,25 @@
2 2
3extern char *movestr[]; 3extern char *movestr[];
4 4
5int64_t readmoves(const char *, size_t n, uint8_t [n]); 5int64_t readmoves(const char *, size_t n, size_t m,
6 uint64_t *, uint64_t *, uint8_t [n], uint8_t [m]);
6uint8_t inverse_move(uint8_t); 7uint8_t inverse_move(uint8_t);
7 8
8void run(void) { 9void run(void) {
10 uint64_t inv, nor;
11 int64_t tot;
9 uint8_t moves[2]; 12 uint8_t moves[2];
10 13
11 char moves_string[STRLENMAX]; 14 char moves_string[STRLENMAX];
12 15
13 fgets(moves_string, STRLENMAX, stdin); 16 fgets(moves_string, STRLENMAX, stdin);
14 if (readmoves(moves_string, 2, moves) != 1) { 17 tot = readmoves(moves_string, 2, 0, &nor, &inv, moves, NULL);
15 printf("Test error: cannot read moves\n"); 18 if (nor != 1 || tot != 1) {
19 printf("Test error reading moves\n");
16 return; 20 return;
17 } 21 }
18 22
23fprintf(stderr, "Read move %" PRIu8 " = %s\n", moves[0], movestr[moves[0]]);
24
19 printf("%s\n", movestr[inverse_move(moves[0])]); 25 printf("%s\n", movestr[inverse_move(moves[0])]);
20} 26}
diff --git a/test/051_compose_oriented/00_scrambled_noorient.in b/test/051_compose_oriented/00_scrambled_noorient.in
new file mode 100644
index 0000000..904292f
--- /dev/null
+++ b/test/051_compose_oriented/00_scrambled_noorient.in
@@ -0,0 +1,4 @@
1CILVXGMR=FKbGIDSXBJAU=A
2JLQWSVUH=ZLCUABGIVTKH=A
3// Scramble: U R D' L D' F L2 D L F B D2 B' L2 F U2 L2 D2 R2 L2 B'
4// Followed by R' U' F
diff --git a/test/051_compose_oriented/00_scrambled_noorient.out b/test/051_compose_oriented/00_scrambled_noorient.out
new file mode 100644
index 0000000..426e4fe
--- /dev/null
+++ b/test/051_compose_oriented/00_scrambled_noorient.out
@@ -0,0 +1 @@
QFSEDWPR=ZUbYFKSBTWAX=A
diff --git a/test/051_compose_oriented/01_Uw_Fw.in b/test/051_compose_oriented/01_Uw_Fw.in
new file mode 100644
index 0000000..d50425a
--- /dev/null
+++ b/test/051_compose_oriented/01_Uw_Fw.in
@@ -0,0 +1,2 @@
1ABHGEFCD=ABHGEFCDIJKL=B
2AXUDJFGK=ABCDEKJHIFGL=Q
diff --git a/test/051_compose_oriented/01_Uw_Fw.out b/test/051_compose_oriented/01_Uw_Fw.out
new file mode 100644
index 0000000..5b15c06
--- /dev/null
+++ b/test/051_compose_oriented/01_Uw_Fw.out
@@ -0,0 +1 @@
MBKGXFQD=ZBHYEFCDQWKL=J
diff --git a/test/051_compose_oriented/02_scrambled_scrambled.in b/test/051_compose_oriented/02_scrambled_scrambled.in
new file mode 100644
index 0000000..5b814bc
--- /dev/null
+++ b/test/051_compose_oriented/02_scrambled_scrambled.in
@@ -0,0 +1,4 @@
1JHFGDMQS=ZaUGRCFHQbTY=W
2DCNORMXQ=YbaDFECXWRJA=G
3// First cube: "F R Uw Lw' D E2 x y M"
4// Second cube: "x R U R' Fw2 Bw y' S3"
diff --git a/test/051_compose_oriented/02_scrambled_scrambled.out b/test/051_compose_oriented/02_scrambled_scrambled.out
new file mode 100644
index 0000000..e6a0684
--- /dev/null
+++ b/test/051_compose_oriented/02_scrambled_scrambled.out
@@ -0,0 +1 @@
VSMPGQJD=ZRHFLUCKAWYT=Q
diff --git a/test/051_compose_oriented/compose_oriented_tests.c b/test/051_compose_oriented/compose_oriented_tests.c
new file mode 100644
index 0000000..f677dd6
--- /dev/null
+++ b/test/051_compose_oriented/compose_oriented_tests.c
@@ -0,0 +1,24 @@
1#include "../test.h"
2
3oriented_cube_t compose_oriented(oriented_cube_t, oriented_cube_t);
4
5void run(void) {
6 char str[STRLENMAX];
7 oriented_cube_t c1, c2, c3;
8
9 fgets(str, STRLENMAX, stdin);
10 c1 = readcube(str);
11 fgets(str, STRLENMAX, stdin);
12 c2 = readcube(str);
13
14 c3 = compose_oriented(c1, c2);
15
16 if (iserror(c3)) {
17 printf("Error composing cubes\n");
18 } else if (!issolvable(c3)) {
19 printf("Composed cube is not solvable\n");
20 } else {
21 writecube(c3, NISSY_SIZE_CUBE, str);
22 printf("%s\n", str);
23 }
24}
diff --git a/test/062_transform_move/transform_move_tests.c b/test/062_transform_move/transform_move_tests.c
index 39e8619..17cb0b6 100644
--- a/test/062_transform_move/transform_move_tests.c
+++ b/test/062_transform_move/transform_move_tests.c
@@ -4,7 +4,8 @@
4 4
5cube_t applytrans(cube_t, const char *); 5cube_t applytrans(cube_t, const char *);
6uint8_t transform_move(uint8_t, uint8_t); 6uint8_t transform_move(uint8_t, uint8_t);
7int64_t readmoves(const char *, size_t n, uint8_t [n]); 7int64_t readmoves(const char *, size_t n, size_t m,
8 uint64_t *, uint64_t *, uint8_t [n], uint8_t [m]);
8oriented_cube_t move_extended(oriented_cube_t, uint8_t); 9oriented_cube_t move_extended(oriented_cube_t, uint8_t);
9oriented_cube_t applymoves(oriented_cube_t, const char *); 10oriented_cube_t applymoves(oriented_cube_t, const char *);
10uint8_t readtrans(const char[static NISSY_SIZE_TRANSFORMATION]); 11uint8_t readtrans(const char[static NISSY_SIZE_TRANSFORMATION]);
@@ -12,14 +13,19 @@ uint8_t readtrans(const char[static NISSY_SIZE_TRANSFORMATION]);
12void run(void) { 13void run(void) {
13 char movestr[STRLENMAX], transtr[STRLENMAX], cubestr[STRLENMAX]; 14 char movestr[STRLENMAX], transtr[STRLENMAX], cubestr[STRLENMAX];
14 uint8_t t, moves[MAXMOVES]; 15 uint8_t t, moves[MAXMOVES];
15 int i, n; 16 uint64_t i, n, ninv;
17 int64_t tot;
16 oriented_cube_t cube; 18 oriented_cube_t cube;
17 19
18 fgets(transtr, STRLENMAX, stdin); 20 fgets(transtr, STRLENMAX, stdin);
19 fgets(movestr, STRLENMAX, stdin); 21 fgets(movestr, STRLENMAX, stdin);
20 22
21 cube = solvedcube(); 23 cube = solvedcube();
22 n = readmoves(movestr, MAXMOVES, moves); 24 tot = readmoves(movestr, MAXMOVES, 0, &n, &ninv, moves, NULL);
25 if (tot < 0 || ninv != 0) {
26 printf("Test error reading moves\n");
27 return;
28 }
23 t = readtrans(transtr); 29 t = readtrans(transtr);
24 for (i = 0; i < n; i++) 30 for (i = 0; i < n; i++)
25 cube = move_extended(cube, transform_move(moves[i], t)); 31 cube = move_extended(cube, transform_move(moves[i], t));
diff --git a/test/130_appendsolution/00_empty.in b/test/130_appendsolution/00_empty.in
index c4cad6e..1100b95 100644
--- a/test/130_appendsolution/00_empty.in
+++ b/test/130_appendsolution/00_empty.in
@@ -1,5 +1,5 @@
1 1
2
30 20
41 31
5rotation UF 4rotation UF
50
diff --git a/test/130_appendsolution/01_simple_onlynormal_nounniss.in b/test/130_appendsolution/01_simple_onlynormal_nounniss.in
index 37b6f3d..fb1eaed 100644
--- a/test/130_appendsolution/01_simple_onlynormal_nounniss.in
+++ b/test/130_appendsolution/01_simple_onlynormal_nounniss.in
@@ -1,5 +1,5 @@
1U F R D2 B' 1U F R D2 B'
2
30 20
41 31
5rotation UF 4rotation UF
50
diff --git a/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.in b/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.in
index c4ff41a..db5f074 100644
--- a/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.in
+++ b/test/130_appendsolution/02_simple_onlynormal_nounnis_multitrans.in
@@ -1,8 +1,8 @@
1U F R 1U F R
2
30 20
44 34
5rotation UF 4rotation UF
6mirrored UR 5mirrored UR
7rotation BD 6rotation BD
8mirrored LB 7mirrored LB
80
diff --git a/test/130_appendsolution/03_simple_unniss.in b/test/130_appendsolution/03_simple_unniss.in
index 231f60c..2c5a331 100644
--- a/test/130_appendsolution/03_simple_unniss.in
+++ b/test/130_appendsolution/03_simple_unniss.in
@@ -1,5 +1,5 @@
1U F B2 1U F B2 (R' F D)
2R' F D
31 21
41 31
5rotation UF 4rotation UF
50
diff --git a/test/130_appendsolution/04_niss_nounniss.in b/test/130_appendsolution/04_niss_nounniss.in
index 39c6518..b07f970 100644
--- a/test/130_appendsolution/04_niss_nounniss.in
+++ b/test/130_appendsolution/04_niss_nounniss.in
@@ -1,5 +1,5 @@
1U F B2 1U F B2 (R' F D)
2R' F D
30 20
41 31
5rotation UF 4rotation UF
50
diff --git a/test/130_appendsolution/05_sort_parallel.in b/test/130_appendsolution/05_sort_parallel.in
index 7c8c4f5..bc1cf0f 100644
--- a/test/130_appendsolution/05_sort_parallel.in
+++ b/test/130_appendsolution/05_sort_parallel.in
@@ -1,5 +1,5 @@
1L R' B2 F 1L R' B2 F
2
30 20
41 31
5rotation UF 4rotation UF
50
diff --git a/test/130_appendsolution/06_unniss_trans_sort.in b/test/130_appendsolution/06_unniss_trans_sort.in
index 9be03a6..2ffab93 100644
--- a/test/130_appendsolution/06_unniss_trans_sort.in
+++ b/test/130_appendsolution/06_unniss_trans_sort.in
@@ -1,5 +1,5 @@
1B 1B (R2 F2)
2R2 F2
31 21
41 31
5rotation UR 4rotation UR
50
diff --git a/test/130_appendsolution/07_unniss_cancel_nosol.in b/test/130_appendsolution/07_unniss_cancel_nosol.in
index 561c909..6883d05 100644
--- a/test/130_appendsolution/07_unniss_cancel_nosol.in
+++ b/test/130_appendsolution/07_unniss_cancel_nosol.in
@@ -1,5 +1,5 @@
1B' F 1B' F (R2 B2)
2R2 B2
31 21
41 31
5rotation UF 4rotation UF
50
diff --git a/test/130_appendsolution/08_unniss_cancel_nosol_v2.in b/test/130_appendsolution/08_unniss_cancel_nosol_v2.in
index e707537..3d461f0 100644
--- a/test/130_appendsolution/08_unniss_cancel_nosol_v2.in
+++ b/test/130_appendsolution/08_unniss_cancel_nosol_v2.in
@@ -1,5 +1,5 @@
1F' B 1F' B (R2 F2)
2R2 F2
31 21
41 31
5rotation UF 4rotation UF
50
diff --git a/test/130_appendsolution/09_fullinverse_niss.in b/test/130_appendsolution/09_fullinverse_niss.in
index 33f0a26..bb2b640 100644
--- a/test/130_appendsolution/09_fullinverse_niss.in
+++ b/test/130_appendsolution/09_fullinverse_niss.in
@@ -1,5 +1,5 @@
1 1(F)
2F
30 20
41 31
5rotation UF 4rotation UF
50
diff --git a/test/130_appendsolution/10_rotated.in b/test/130_appendsolution/10_rotated.in
new file mode 100644
index 0000000..5210cd5
--- /dev/null
+++ b/test/130_appendsolution/10_rotated.in
@@ -0,0 +1,5 @@
1U2 F B L'
21
31
4rotation UF
57
diff --git a/test/130_appendsolution/10_rotated.out b/test/130_appendsolution/10_rotated.out
new file mode 100644
index 0000000..e70b2fe
--- /dev/null
+++ b/test/130_appendsolution/10_rotated.out
@@ -0,0 +1,4 @@
1D2 R L F'
2Number of solutions: 1
3Shortest solution length: 4
4Used bytes: 10
diff --git a/test/130_appendsolution/appendsolution_tests.c b/test/130_appendsolution/appendsolution_tests.c
index abff359..e1b7e98 100644
--- a/test/130_appendsolution/appendsolution_tests.c
+++ b/test/130_appendsolution/appendsolution_tests.c
@@ -1,11 +1,11 @@
1/* 1/*
2Input format for appendsolution tests: 2Input format for appendsolution tests:
3 3
4moves on normal 4moves on normal (with NISS notation)
5moves on inverse (without parentheses)
6unniss flag (0=false, 1=true) 5unniss flag (0=false, 1=true)
7number of transformations 6number of transformations
8transformations, one per line 7transformations, one per line
8the orientation of the cube, as a number from 0 to 23
9 9
10See below for the output format. 10See below for the output format.
11*/ 11*/
@@ -13,7 +13,8 @@ See below for the output format.
13#include "../test.h" 13#include "../test.h"
14 14
15uint8_t readtrans(const char [NISSY_SIZE_TRANSFORMATION]); 15uint8_t readtrans(const char [NISSY_SIZE_TRANSFORMATION]);
16int64_t readmoves(const char *, size_t n, uint8_t [n]); 16int64_t readmoves(const char *, size_t n, size_t m,
17 uint64_t *, uint64_t *, uint8_t [n], uint8_t [m]);
17void solution_moves_reset(solution_moves_t [static 1]); 18void solution_moves_reset(solution_moves_t [static 1]);
18bool solution_list_init(solution_list_t [static 1], size_t n, char [n]); 19bool solution_list_init(solution_list_t [static 1], size_t n, char [n]);
19int64_t appendsolution(const solution_moves_t [static 1], 20int64_t appendsolution(const solution_moves_t [static 1],
@@ -22,6 +23,8 @@ int64_t appendsolution(const solution_moves_t [static 1],
22 23
23void run(void) { 24void run(void) {
24 int i, ntrans; 25 int i, ntrans;
26 int64_t tot;
27 uint64_t nm, np;
25 char str[STRLENMAX], buf[STRLENMAX]; 28 char str[STRLENMAX], buf[STRLENMAX];
26 solution_moves_t moves; 29 solution_moves_t moves;
27 solution_settings_t settings; 30 solution_settings_t settings;
@@ -38,9 +41,13 @@ void run(void) {
38 }; 41 };
39 42
40 fgets(str, STRLENMAX, stdin); 43 fgets(str, STRLENMAX, stdin);
41 moves.nmoves = (uint8_t)readmoves(str, 20, moves.moves); 44 tot = readmoves(str, 20, 20, &nm, &np, moves.moves, moves.premoves);
42 fgets(str, STRLENMAX, stdin); 45 if (tot < 0) {
43 moves.npremoves = (uint8_t)readmoves(str, 20, moves.premoves); 46 printf("Test error reading moves\n");
47 return;
48 }
49 moves.nmoves = nm;
50 moves.npremoves = np;
44 fgets(str, STRLENMAX, stdin); 51 fgets(str, STRLENMAX, stdin);
45 settings.unniss = (bool)atoi(str); 52 settings.unniss = (bool)atoi(str);
46 fgets(str, STRLENMAX, stdin); 53 fgets(str, STRLENMAX, stdin);
@@ -49,6 +56,8 @@ void run(void) {
49 fgets(str, STRLENMAX, stdin); 56 fgets(str, STRLENMAX, stdin);
50 settings.tmask |= UINT64_C(1) << (uint64_t)readtrans(str); 57 settings.tmask |= UINT64_C(1) << (uint64_t)readtrans(str);
51 } 58 }
59 fgets(str, STRLENMAX, stdin);
60 settings.orientation = atoi(str);
52 61
53 appendsolution(&moves, &settings, &list, false, "Test"); 62 appendsolution(&moves, &settings, &list, false, "Test");
54 63

Generated with cgit - Back to sebastiano.tronto.net