aboutsummaryrefslogtreecommitdiff
path: root/src/cube.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2022-02-27 15:36:02 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2022-02-27 15:36:02 +0100
commit48cd8b6b1779f34ba0507cb697492de83c4e9da8 (patch)
treec3a208fa64c3d37f328984acfb980b3f88e94060 /src/cube.c
parentde0352a2926b0708400a9629c1da813455a6f442 (diff)
downloadnissy-48cd8b6b1779f34ba0507cb697492de83c4e9da8.tar.gz
nissy-48cd8b6b1779f34ba0507cb697492de83c4e9da8.zip
Moved random_cube() from cube.c to commands.c and fixed a bug in corners only and edges
only scrambles. Added fmc scrambles (with R'U'F). Updated manpage for scramble and cleanup.
Diffstat (limited to '')
-rw-r--r--src/cube.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/cube.c b/src/cube.c
index 3a6234d..803fefd 100644
--- a/src/cube.c
+++ b/src/cube.c
@@ -4,7 +4,6 @@
4 4
5static void fix_eorleoud(CubeArray *arr); 5static void fix_eorleoud(CubeArray *arr);
6static void fix_cofbcorl(CubeArray *arr); 6static void fix_cofbcorl(CubeArray *arr);
7static Cube fourval_to_cube(int eofb, int ep, int coud, int cp);
8static void init_inverse(); 7static void init_inverse();
9static bool read_invtables_file(); 8static bool read_invtables_file();
10static bool write_invtables_file(); 9static bool write_invtables_file();
@@ -18,8 +17,6 @@ static uint16_t co_invtable[POW3TO7][FACTORIAL8];
18static uint16_t cp_invtable[FACTORIAL8]; 17static uint16_t cp_invtable[FACTORIAL8];
19static uint16_t cpos_invtable[FACTORIAL6]; 18static uint16_t cpos_invtable[FACTORIAL6];
20 19
21char *scrtypes[NSCRTYPES] = { "eo", "corners", "edges" };
22
23/* Functions implementation **************************************************/ 20/* Functions implementation **************************************************/
24 21
25int 22int
@@ -187,7 +184,7 @@ fix_cofbcorl(CubeArray *arr)
187 } 184 }
188} 185}
189 186
190static Cube 187Cube
191fourval_to_cube(int eofb, int ep, int coud, int cp) 188fourval_to_cube(int eofb, int ep, int coud, int cp)
192{ 189{
193 CubeArray *arr; 190 CubeArray *arr;
@@ -544,29 +541,6 @@ print_cube(Cube cube)
544 printf("\n"); 541 printf("\n");
545} 542}
546 543
547Cube
548random_cube(int scrt)
549{
550 int ep, cp, eo, co;
551
552 ep = rand() % FACTORIAL12;
553 cp = rand() % FACTORIAL8;
554 eo = rand() % POW2TO11;
555 co = rand() % POW3TO7;
556
557 if (scrt == 0) { /* EO */
558 eo = 0;
559 } else if (scrt == 1) { /* corners */
560 eo = 0;
561 ep = 0;
562 } else if (scrt == 2) { /* edges */
563 co = 0;
564 cp = 0;
565 }
566
567 return fourval_to_cube(eo, ep, co, cp);
568}
569
570Center 544Center
571what_center_at(Cube cube, Center c) 545what_center_at(Cube cube, Center c)
572{ 546{

Generated with cgit - Back to sebastiano.tronto.net