home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume37 / magiccube / patch02 / patch3 < prev    next >
Encoding:
Text File  |  1993-05-25  |  9.3 KB  |  303 lines

  1. *** patchlevel.h    Mon May 24 09:54:40 1993
  2. --- patchlevel.h.02    Mon May 24 10:50:54 1993
  3. ***************
  4. *** 1,7 ****
  5. ! #define VERSION    "1.0.0"
  6. ! #define DATE    "10 May 1993"
  7.   
  8.   /*
  9.    *  patch1        14 May 93       :Fix to seed_cube in cube.h; Bug became manifest in gcc
  10.    *  patch2        14 May 93       :Fix to ldfile.c;  Bug became manifest in gcc
  11.    */
  12. --- 1,10 ----
  13. ! #define VERSION    "1.0.2"
  14. ! #define DATE    "24 May 1993"
  15.   
  16.   /*
  17.    *  patch1        14 May 93       :Fix to seed_cube in cube.h; Bug became manifest in gcc
  18.    *  patch2        14 May 93       :Fix to ldfile.c;  Bug became manifest in gcc
  19. +  *  patch3              24 May 93       :Patches for layer2.c, layer3.c, layer3twirl.c, and layer3flip.c.
  20. +  *                                      :Discovered when magicCube hung solving "Pons Asinorum"
  21.    */
  22. *** layer2.c    Fri May 21 11:26:32 1993
  23. --- layer2.c.02    Fri May 21 13:08:25 1993
  24. ***************
  25. *** 300,319 ****
  26.        * So a middle layer cube must be moved out to the bottom layer.
  27.        */
  28.     else {
  29. !     if(Front(5) == RIGHT &&
  30. !        Right(3) == FRONT){
  31.         F(1);D(2);L(1);D(1);L(-1);D(2);F(-1);     
  32.       }
  33. !     else if(Right(5) == BACK &&
  34. !         Back(5) == RIGHT){
  35.         R(1);D(2);F(1);D(1);F(-1);D(2);R(-1); 
  36.       }
  37. !     else if(Back(3) == LEFT &&
  38. !         Left(5) == BACK){
  39.         B(1);D(2);R(1);D(1);R(-1);D(2);B(-1); 
  40.       }
  41. !     else if(Left(3) == FRONT &&
  42. !         Front(3) == LEFT){
  43.         L(1);D(2);B(1);D(1);B(-1);D(2);L(-1);
  44.       }
  45.       return(False);
  46. --- 300,319 ----
  47.        * So a middle layer cube must be moved out to the bottom layer.
  48.        */
  49.     else {
  50. !     if(Front(5) != FRONT ||
  51. !        Right(3) != RIGHT){
  52.         F(1);D(2);L(1);D(1);L(-1);D(2);F(-1);     
  53.       }
  54. !     else if(Right(5) != RIGHT ||
  55. !         Back(5) != BACK){
  56.         R(1);D(2);F(1);D(1);F(-1);D(2);R(-1); 
  57.       }
  58. !     else if(Back(3) != BACK ||
  59. !         Left(5) != LEFT){
  60.         B(1);D(2);R(1);D(1);R(-1);D(2);B(-1); 
  61.       }
  62. !     else if(Left(3) != LEFT ||
  63. !         Front(3) != FRONT){
  64.         L(1);D(2);B(1);D(1);B(-1);D(2);L(-1);
  65.       }
  66.       return(False);
  67. *** layer3.c    Tue Apr 13 11:16:09 1993
  68. --- layer3.c.02    Mon May 24 10:19:41 1993
  69. ***************
  70. *** 292,298 ****
  71.         /* A solution(3 to 5 to 7 to 3) */
  72.         B(2);D(1);R(-1);L(1);B(2);R(1);L(-1);D(1);B(2);
  73.       }
  74. !     else if(Right(7) == LEFT || Bottom(5) == LEFT){
  75.         /* bottom(5) belongs in bottom(3) */
  76.         /* B solution(5 to 3 to 7 to 5) */
  77.         B(2);D(-1);R(-1);L(1);B(2);R(1);L(-1);D(-1);B(2);
  78. --- 292,298 ----
  79.         /* A solution(3 to 5 to 7 to 3) */
  80.         B(2);D(1);R(-1);L(1);B(2);R(1);L(-1);D(1);B(2);
  81.       }
  82. !      else if(Right(7) == LEFT || Bottom(5) == LEFT){
  83.         /* bottom(5) belongs in bottom(3) */
  84.         /* B solution(5 to 3 to 7 to 5) */
  85.         B(2);D(-1);R(-1);L(1);B(2);R(1);L(-1);D(-1);B(2);
  86. ***************
  87. *** 305,321 ****
  88.       if(Back(7) == FRONT || Bottom(7) == FRONT){
  89.         /* bottom(7) belongs in bottom(1) */
  90.         /* A solution(7 to 1 to 5 to 7) */
  91. !       L(2);D(1);F(-1);B(1);L(2);F(1);B(-1);D(1);L(2);
  92.       }
  93.       else if(Front(7) == BACK || Bottom(1) == BACK){
  94.         /* bottom(1) belongs in bottom(7) */
  95.         /* B solution(1 to 7 to 5 to 1) */
  96. !       L(2);D(-1);F(-1);B(1);L(2);F(1);B(-1);D(-1);L(2);
  97.       }
  98.       else{ ; } /* all edges in proper place */
  99.     }
  100.   
  101. !   else if(Right(7) == RIGHT || Bottom(3) == RIGHT){
  102.       /* bottom(5) ok */
  103.       if(Front(7) == BACK || Bottom(1) == BACK){
  104.         /* bottom(1) belongs in bottom(7) */
  105. --- 305,321 ----
  106.       if(Back(7) == FRONT || Bottom(7) == FRONT){
  107.         /* bottom(7) belongs in bottom(1) */
  108.         /* A solution(7 to 1 to 5 to 7) */
  109. !       R(2);D(1);F(-1);B(1);R(2);F(1);B(-1);D(1);R(2);
  110.       }
  111.       else if(Front(7) == BACK || Bottom(1) == BACK){
  112.         /* bottom(1) belongs in bottom(7) */
  113.         /* B solution(1 to 7 to 5 to 1) */
  114. !       R(2);D(-1);F(-1);B(1);R(2);F(1);B(-1);D(-1);R(2);
  115.       }
  116.       else{ ; } /* all edges in proper place */
  117.     }
  118.   
  119. !   else if(Right(7) == RIGHT || Bottom(5) == RIGHT){
  120.       /* bottom(5) ok */
  121.       if(Front(7) == BACK || Bottom(1) == BACK){
  122.         /* bottom(1) belongs in bottom(7) */
  123. ***************
  124. *** 330,336 ****
  125.       else{ ; } /* all edges in proper place */
  126.     }
  127.     
  128. !   else if(Back(7) == BACK || Bottom(3) == BACK){
  129.       /* bottom(7) ok */
  130.       if(Right(7) == LEFT || Bottom(5) == LEFT){
  131.         /* bottom(5) belongs in bottom(3) */
  132. --- 330,336 ----
  133.       else{ ; } /* all edges in proper place */
  134.     }
  135.     
  136. !   else if(Back(7) == BACK || Bottom(7) == BACK){
  137.       /* bottom(7) ok */
  138.       if(Right(7) == LEFT || Bottom(5) == LEFT){
  139.         /* bottom(5) belongs in bottom(3) */
  140. ***************
  141. *** 352,363 ****
  142.         /* D solution(1 to 3; 3 to 1; 5 to 7; 7 to 5) */
  143.         F(1);L(1);D(1);L(-1);D(-1);F(2);R(-1);D(-1);R(1);D(1);F(1);
  144.       }
  145. !     else if(Front(7) == BACK || Bottom(7) == BACK){
  146.         /* bottom(1) belongs in bottom(7) */
  147.         /* C solution(1 to 7; 7 to 1; 3 to 5; 5 to 3) */
  148.         R(2);L(2);U(1);R(2);L(2);D(2);R(2);L(2);U(1);R(2);L(2);
  149.       }
  150. !     else if(Front(7) == RIGHT || Bottom(5) == RIGHT){
  151.         /* bottom(1) belongs in bottom(5) */
  152.         /* D solution(1 to 5; 5 to 1; 3 to 7; 7 to 3) */
  153.         R(1);F(1);D(1);F(-1);D(-1);R(2);B(-1);D(-1);B(1);D(1);R(1);
  154. --- 352,363 ----
  155.         /* D solution(1 to 3; 3 to 1; 5 to 7; 7 to 5) */
  156.         F(1);L(1);D(1);L(-1);D(-1);F(2);R(-1);D(-1);R(1);D(1);F(1);
  157.       }
  158. !     else if(Front(7) == BACK || Bottom(1) == BACK){
  159.         /* bottom(1) belongs in bottom(7) */
  160.         /* C solution(1 to 7; 7 to 1; 3 to 5; 5 to 3) */
  161.         R(2);L(2);U(1);R(2);L(2);D(2);R(2);L(2);U(1);R(2);L(2);
  162.       }
  163. !     else if(Front(7) == RIGHT || Bottom(1) == RIGHT){
  164.         /* bottom(1) belongs in bottom(5) */
  165.         /* D solution(1 to 5; 5 to 1; 3 to 7; 7 to 3) */
  166.         R(1);F(1);D(1);F(-1);D(-1);R(2);B(-1);D(-1);B(1);D(1);R(1);
  167. ***************
  168. *** 368,370 ****
  169. --- 368,371 ----
  170.     }
  171.   
  172.   }
  173. *** layer3twirl.c    Thu May 20 11:26:41 1993
  174. --- layer3twirl.c.02    Thu May 20 14:21:13 1993
  175. ***************
  176. *** 51,57 ****
  177.        Back(8)  == BACK  &&
  178.        Left(8)  == LEFT)
  179.       return(True);
  180.     /* Here if not ok */
  181.     /* Twirl corners */
  182.     /* 3 possibilities:
  183. --- 51,57 ----
  184.        Back(8)  == BACK  &&
  185.        Left(8)  == LEFT)
  186.       return(True);
  187. !   
  188.     /* Here if not ok */
  189.     /* Twirl corners */
  190.     /* 3 possibilities:
  191. ***************
  192. *** 62,68 ****
  193.      * The twirl algorithm twirls one corner clockwise, and another anti-clockwise.
  194.      * This is repeated until all 4 corners are correct.
  195.      */
  196.     /* Find a corner that needs a clockwise twirl.
  197.      * (Note: all corners are in correct position.
  198.      * A corner needs a clockwise twirl if the front matches the top with
  199. --- 62,68 ----
  200.      * The twirl algorithm twirls one corner clockwise, and another anti-clockwise.
  201.      * This is repeated until all 4 corners are correct.
  202.      */
  203. !   
  204.     /* Find a corner that needs a clockwise twirl.
  205.      * (Note: all corners are in correct position.
  206.      * A corner needs a clockwise twirl if the front matches the top with
  207. ***************
  208. *** 69,75 ****
  209.      * said cube oriented in a top right-hand position.
  210.      * A corner needs an anti-clockwise twirl if the right-hand face matches the top.)
  211.      */
  212.     if(Front(6) == BOTTOM){
  213.       L(-1);U(1);L(1);F(1);U(1);F(-1);
  214.       /* Now search for cube that needs an anti-clockwise turn. */
  215. --- 69,75 ----
  216.      * said cube oriented in a top right-hand position.
  217.      * A corner needs an anti-clockwise twirl if the right-hand face matches the top.)
  218.      */
  219. !   
  220.     if(Front(6) == BOTTOM){
  221.       L(-1);U(1);L(1);F(1);U(1);F(-1);
  222.       /* Now search for cube that needs an anti-clockwise turn. */
  223. ***************
  224. *** 83,89 ****
  225.         F(1);U(-1);F(-1);L(-1);U(-1);L(1);
  226.         D(2);
  227.       }
  228. !     else if(Front(8) == BOTTOM){
  229.         D(-1);
  230.         F(1);U(-1);F(-1);L(-1);U(-1);L(1);
  231.         D(1);
  232. --- 83,96 ----
  233.         F(1);U(-1);F(-1);L(-1);U(-1);L(1);
  234.         D(2);
  235.       }
  236. !     else { 
  237. !       /* This is the default case.
  238. !        * Here Front(8) == BOTTOM or there
  239. !        * are no other cubes that need an anti-clockwise turn.
  240. !        * No other cubes that need an anti-clockwise turn means 
  241. !        * that we are in case 3 and 3 cubes
  242. !        * need a clockwise turn.
  243. !        */
  244.         D(-1);
  245.         F(1);U(-1);F(-1);L(-1);U(-1);L(1);
  246.         D(1);
  247. ***************
  248. *** 101,107 ****
  249.         R(1);U(-1);R(-1);F(-1);U(-1);F(1);
  250.         D(2);
  251.       }
  252. !     else if(Right(8) == BOTTOM){
  253.         D(-1);
  254.         R(1);U(-1);R(-1);F(-1);U(-1);F(1);
  255.         D(1);
  256. --- 108,114 ----
  257.         R(1);U(-1);R(-1);F(-1);U(-1);F(1);
  258.         D(2);
  259.       }
  260. !     else {
  261.         D(-1);
  262.         R(1);U(-1);R(-1);F(-1);U(-1);F(1);
  263.         D(1);
  264. ***************
  265. *** 119,125 ****
  266.         B(1);U(-1);B(-1);R(-1);U(-1);R(1);
  267.         D(2);
  268.       }
  269. !     else if(Back(6) == BOTTOM){
  270.         D(-1);
  271.         B(1);U(-1);B(-1);R(-1);U(-1);R(1);
  272.         D(1);
  273. --- 126,132 ----
  274.         B(1);U(-1);B(-1);R(-1);U(-1);R(1);
  275.         D(2);
  276.       }
  277. !     else {
  278.         D(-1);
  279.         B(1);U(-1);B(-1);R(-1);U(-1);R(1);
  280.         D(1);
  281. ***************
  282. *** 137,143 ****
  283.         L(1);U(-1);L(-1);B(-1);U(-1);B(1);
  284.         D(2);
  285.       }
  286. !     else if(Left(6) == BOTTOM){
  287.         D(-1);
  288.         L(1);U(-1);L(-1);B(-1);U(-1);B(1);
  289.         D(1);
  290. --- 144,150 ----
  291.         L(1);U(-1);L(-1);B(-1);U(-1);B(1);
  292.         D(2);
  293.       }
  294. !     else {
  295.         D(-1);
  296.         L(1);U(-1);L(-1);B(-1);U(-1);B(1);
  297.         D(1);
  298.