# Commits

committed 6002fb9

solve is void, not int. cleanup

• Participants
• Parent commits c826553

# File stand_alone/2_solve.c

` /*`
`  * generic pruning table initialization`
`  */`
`-// store the depth in the first nibble, the face we turned to get there in the second nibble`
`+// store the depth in the bits 0-3`
`+// store the number of turnsin 4-5`
`+// store the face we turned in 6-7`
` #define PD(x) ((x) & 0x0f)`
`+#define PN(x) (((x) & 0x30) >> 4)`
` #define PF(x) (((x) & 0xc0) >> 6)`
`-#define PN(x) (((x) & 0x30) >> 4)`
` void init_prune(uint16_t trans_tablei[][3], uint16_t trans_tablej[][3], int maxi, int maxj, uint8_t prune_table[maxi][maxj], int mdepth)`
` {`
` 	int d, i, j, k, face;`
` `
`-	prune_table[0][0] = 0xc0;`
`+	prune_table[0][0] = 0xf0;`
` `
` 	for (d = 0; d < mdepth; d++) {`
` 		for (i = 0; i < maxi; i++) {`
` /*`
`  * solve`
`  */`
`-int solve(int cp_coord, int co_coord)`
`+void solve(int cp_coord, int co_coord)`
` {`
` 	char *faces = "UFL", *nums = " 2'";`
` 	int face, num, i, distance = PD(cpco_prune[cp_coord][co_coord]);`
` 	init_trans(co_trans,  729, set_co_coord, get_co_coord );`
` 	init_prune(cp_trans, co_trans, 5040, 729, cpco_prune, 11);`
` `
`-	// this will solve every possible cube, without the need to parse them (set_cube() is slow)`
`-	/*`
`+	/* this will solve every possible cube without the need to parse them`
`+	 * set_cube() is slow`
` 	int i, j;`
` 	for (i = 0; i < 5040; i++)`
` 		for (j = 0; j < 729; j++)`