|
Post by B+ on May 26, 2018 3:33:50 GMT
Here is my start with the cube, in 2D to work out the bugs before 3D drawing: 'Rubic.txt for Just Basic v2 B+ started 2018-05-25
global xmax, ymax, cmd$ xmax = 420 ymax = 330 nomainwin WindowWidth = xmax + 8 WindowHeight = ymax + 32 UpperLeftX = (1200 - xmax) / 2 UpperLeftY = (700 - ymax) / 2
open "Rubic, press h for help..." for graphics_nsb_nf as #gr #gr "setfocus" #gr "trapclose quit" #gr "when leftButtonUp lButtonUp" #gr "when characterInput charIn" #gr "down" #gr "fill 128 128 128" #gr "size 3" dim fx(5) : dim fy(5) fx(0) = 120 : fy(0) = 120 fx(1) = 210 : fy(1) = 120 fx(2) = 300 : fy(2) = 120 fx(3) = 30 : fy(3) = 120 fx(4) = 120 : fy(4) = 30 fx(5) = 120 : fy(5) = 210
dim c(53) '54 colors for squares for i = 0 to 53 f = int(i / 9) select case f case 0 : c(i) = 50 ' front face is green case 1 : c(i) = 700 ' right face red case 2 : c(i) = 8 ' back face blue case 3 : c(i) = 940 ' left face orange case 4 : c(i) = 999 ' top face white (which is why the black background case 5 : c(i) = 990 ' bottom face yellow end select next call update #gr "flush" wait
sub update for i = 0 to 53 f = int(i/9) xoff = fx(f) : yoff = fy(f) row = int((i - f * 9)/3) : col = i mod 3 call rgb c(i) call fbox xoff + col * 30, yoff + row * 30, xoff + col * 30 + 30, yoff + row * 30 + 30 next 'draw grids call rgb 0 for f = 0 to 5 xoff = fx(f) : yoff = fy(f) for i = 0 TO 3 #gr "line ";xoff + 30 * i;" ";yoff;" ";xoff + 30 * i;" ";yoff + 90 #gr "line ";xoff;" ";yoff + 30 * i;" ";xoff + 90;" ";yoff + 30 * i next next end sub
'JB Library of procedures
sub rgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "color ";r;" ";g;" ";b #gr "backcolor ";r;" ";g;" ";b end sub
sub fbox x0, y0, x1, y1 #gr "place ";x0;" ";y0 #gr "boxfilled ";x1+1;" ";y1+1 end sub
sub lButtonUp H$, mx, my call quit H$ end sub
sub charIn H$, c$
'notice "*";c$;"*" 'debug 2nd character not found in INSTR, also 4th???? 'nstr$ = "1 2 3" 'there is some kind of bug such that the 2nd and 4th position in string is not found if c$ = "h" then call help if instr("xyz",c$) then cmd$ = c$ if (c$ = "1" or c$ = "2" or c$ = "3") and cmd$ <> "" then select case cmd$ case "x" select case c$ case "1" call cs 0, 3, 6, 45, 48, 51, 18, 21, 24, 36, 39, 42 call cs 29, 32, 35, 35, 34, 33, 33, 30, 27, 27, 28, 29 case "2" call cs 1, 4, 7, 46, 49, 52, 19, 22, 25, 37, 40, 43 case "3" call cs 2, 5, 8, 47, 50, 53, 20, 23, 26, 38, 41, 44 call cs 9, 12, 15, 15, 16, 17, 17, 14, 11, 11, 10, 9 end select case "y" select case c$ case "1" call cs 0, 1, 2, 9, 10, 11, 18, 19, 20, 27, 28, 29 call cs 42, 43, 44, 44, 41, 38, 38, 37, 36, 36, 39, 42 case "2" call cs 3, 4, 5, 12, 13, 14, 21, 22, 23, 30, 31, 32 case "3" call cs 33, 34, 35, 6, 7, 8, 15, 16, 17, 24, 25, 26 call cs 45, 46, 47, 47, 50, 53, 53, 52, 51, 51, 48, 45 end select case "z" select case c$ case "1" call cs 0, 1, 2, 2, 5, 8, 8, 7, 6, 6, 3, 0 call cs 9, 12, 15, 47, 46, 45, 35, 32, 29, 42, 43, 44 case "2" call cs 10, 13, 16, 50, 49, 48, 34, 31, 28, 39, 40, 41 case "3" call cs 36, 37, 38, 11, 14, 17, 53, 52, 51, 33, 30, 27 call cs 24, 25, 26, 26, 23, 20, 20, 19, 18, 18, 21, 24 end select end select call update cmd$ = "" end if if c$ = "q" then call quit H$ end sub
'color shifter, these are all indexes to the c() array sub cs k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12 ks1 = c(k10) : ks2 = c(k11) : ks3 = c(k12) 'save first three c(k10) = c(k7) : c(k11) = c(k8) : c(k12) = c(k9) c(k7) = c(k4) : c(k8) = c(k5) : c(k9) = c(k6) c(k4) = c(k1) : c(k5) = c(k2) : c(k6) = c(k3) c(k1) = ks1 : c(k2) = ks2 : c(k3) = ks3 end sub
'Need line: #gr "trapclose quit" sub quit H$ close #gr end end sub
sub help nl$ = Chr$(13) s$ = "****************** Rubic Help *******************" + nl$ s$ = s$ + "Let's call the 9 small cubes that make up 1/3" + nl$ s$ = s$ + "of the entire cube a 'layer'. Now, we need a" +nl$ s$ = s$ + "shorthand method to specify which layer to rotate." + nl$ s$ = s$ + "The x axis is layered left to right 1, 2, 3." + nl$ s$ = s$ + "The y axis is layered top down 1, 2, 3." + nl$ s$ = s$ + "The z axis is layered front to back 1, 2, 3." + nl$ s$ = s$ + "So, to command a rotation:"+ nl$ s$ = s$ + "Key press the axis and then the layer number." + nl$ s$ = s$ + "Can also press h for this help, or q to quit." notice s$ end sub
Screen shot is start plus 3 rotations x1, y1, z1 (all rotations are right handed or clockwise).
|
|
|
Post by B+ on May 27, 2018 14:16:54 GMT
Hmm... I guess I had index numbers for back side (the face all the way right) messed up for the x rotations. OK so based on this new reworked scheme: Rubix Color Index Layout:
: 26 25 24 : : 23 22 21 : >>>> I had back of cube lined up wrong to this: : 20 19 18 : V V : 36 37 38 : V : 39 40 41 : V : 42 43 44 : : 27 28 29 : 0 1 2 : 9 10 11 : 18 19 20 : : 30 31 32 : 3 4 5 : 12 13 14 : 21 22 23 : : 33 34 35 : 6 7 8 : 15 16 17 : 24 25 26 : : 45 46 47 : : 48 49 50 : : 51 52 53 : ROTATIONS WERE BASED ON LOOKING AT THE FRONT GREEN FACE OF CUBE:
The x axis was left to right 1, 2, 3 right hand side clockwise when looking at front face.
The y axis was top to bottom 1, 2, 3 right hand above cube front face turning clockwise,
The z axis was front to back 1, 2, 3 turning clockwise while facing front of cube.
I have Rubix code: 'Rubic.txt for Just Basic v2 B+ started 2018-05-27 revised
global xmax, ymax, cmd$ xmax = 420 ymax = 330 nomainwin WindowWidth = xmax + 8 WindowHeight = ymax + 32 UpperLeftX = (1200 - xmax) / 2 UpperLeftY = (700 - ymax) / 2
open "Rubic, press h for help..." for graphics_nsb_nf as #gr #gr "setfocus" #gr "trapclose quit" #gr "when leftButtonUp lButtonUp" #gr "when characterInput charIn" #gr "down" #gr "fill 128 128 128" #gr "size 3" dim fx(5) : dim fy(5) fx(0) = 120 : fy(0) = 120 fx(1) = 210 : fy(1) = 120 fx(2) = 300 : fy(2) = 120 fx(3) = 30 : fy(3) = 120 fx(4) = 120 : fy(4) = 30 fx(5) = 120 : fy(5) = 210
dim c(53) '54 colors for squares for i = 0 to 53 f = int(i / 9) select case f case 0 : c(i) = 40 ' front face is green case 1 : c(i) = 700 ' right face red case 2 : c(i) = 8 ' back face blue case 3 : c(i) = 940 ' left face orange case 4 : c(i) = 999 ' top face white (which is why the black background case 5 : c(i) = 990 ' bottom face yellow end select next call update #gr "flush" wait
' ====================================== procedures this window sub quit H$ close #gr end end sub
sub lButtonUp H$, mx, my call quit H$ end sub
sub charIn H$, c$ 'notice "*";c$;"*" 'debug 2nd character not found in INSTR, also 4th???? 'nstr$ = "1 2 3" 'there is some kind of bug such that the 2nd and 4th position in string is not found if c$ = "h" then call help if instr("xyz",c$) then cmd$ = c$ if (c$ = "1" or c$ = "2" or c$ = "3") and cmd$ <> "" then select case cmd$ case "x" select case c$ case "1" call cs 0, 3, 6, 36, 39, 42, 26, 23, 20, 45, 48, 51 call cs 29, 32, 35, 27, 28, 29, 33, 30, 27, 35, 34, 33 case "2" call cs 1, 4, 7, 37, 40, 43, 25, 22, 19, 46, 49, 52 case "3" call cs 2, 5, 8, 38, 41, 44, 24, 21, 18, 47, 50, 53 call cs 9, 12, 15, 11, 10, 9, 17, 14, 11, 15, 16, 17 end select case "y" select case c$ case "1" call cs 0, 1, 2, 9, 10, 11, 18, 19, 20, 27, 28, 29 call cs 42, 43, 44, 44, 41, 38, 38, 37, 36, 36, 39, 42 case "2" call cs 3, 4, 5, 12, 13, 14, 21, 22, 23, 30, 31, 32 case "3" call cs 33, 34, 35, 6, 7, 8, 15, 16, 17, 24, 25, 26 call cs 51, 48, 45, 45, 46, 47, 47, 50, 53, 53, 52, 51 end select case "z" select case c$ case "1" call cs 0, 1, 2, 2, 5, 8, 8, 7, 6, 6, 3, 0 call cs 42, 43, 44, 9, 12, 15, 47, 46, 45, 35, 32, 29 case "2" call cs 10, 13, 16, 50, 49, 48, 34, 31, 28, 39, 40, 41 case "3" call cs 36, 37, 38, 11, 14, 17, 53, 52, 51, 33, 30, 27 call cs 24, 25, 26, 18, 21, 24, 24, 25, 26, 26, 23, 20 end select end select call update cmd$ = "" end if if c$ = "q" then call quit H$ end sub
' ====================================== JB Library of procedures
sub rgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "color ";r;" ";g;" ";b #gr "backcolor ";r;" ";g;" ";b end sub
sub fbox x0, y0, x1, y1 #gr "place ";x0;" ";y0 #gr "boxfilled ";x1+1;" ";y1+1 end sub
'=============================================== procedures this app
sub update for i = 0 to 53 f = int(i/9) xoff = fx(f) : yoff = fy(f) row = int((i - f * 9)/3) : col = i mod 3 call rgb c(i) call fbox xoff + col * 30, yoff + row * 30, xoff + col * 30 + 30, yoff + row * 30 + 30 next 'draw grids call rgb 0 for f = 0 to 5 xoff = fx(f) : yoff = fy(f) for i = 0 TO 3 #gr "line ";xoff + 30 * i;" ";yoff;" ";xoff + 30 * i;" ";yoff + 90 #gr "line ";xoff;" ";yoff + 30 * i;" ";xoff + 90;" ";yoff + 30 * i next next end sub
'color shifter, these are all indexes to the c() array sub cs k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12 ks1 = c(k10) : ks2 = c(k11) : ks3 = c(k12) 'save first three c(k10) = c(k7) : c(k11) = c(k8) : c(k12) = c(k9) c(k7) = c(k4) : c(k8) = c(k5) : c(k9) = c(k6) c(k4) = c(k1) : c(k5) = c(k2) : c(k6) = c(k3) c(k1) = ks1 : c(k2) = ks2 : c(k3) = ks3 end sub
sub help nl$ = Chr$(13) s$ = "****************** Rubic Help *******************" + nl$ s$ = s$ + "Let's call the 9 small cubes that make up 1/3" + nl$ s$ = s$ + "of the entire cube a 'layer'. Now, we need a" +nl$ s$ = s$ + "shorthand method to specify which layer to rotate." + nl$ s$ = s$ + "The x axis is layered left to right 1, 2, 3." + nl$ s$ = s$ + "The y axis is layered top down 1, 2, 3." + nl$ s$ = s$ + "The z axis is layered front to back 1, 2, 3." + nl$ s$ = s$ + "So, to command a rotation:"+ nl$ s$ = s$ + "Key press the axis and then the layer number." + nl$ s$ = s$ + "Can also press h for this help, or q to quit." notice s$ end sub
and rotations x1 y1 z1 now looks like this: EDIT: dang the x axis rotations were turning counter-clockwise, now clockwise (I hope).
|
|
|
Rubix
May 28, 2018 1:26:01 GMT
Post by B+ on May 28, 2018 1:26:01 GMT
Still not right! So I added original index labels and added a new sub to spin the square colors in cube faces separate from sides because needed to save more information before swapping colors around. With labels I could see better how the face spins were working out, so now I may have it right. 'Rubic 2.txt for Just Basic v2 B+ started 2018-05-27 revised again
'now with original index labels to track rotations and new spinFace sub
global xmax, ymax, cmd$ xmax = 420 ymax = 330 nomainwin WindowWidth = xmax + 8 WindowHeight = ymax + 32 UpperLeftX = (1200 - xmax) / 2 UpperLeftY = (700 - ymax) / 2
open "Rubic 2, press h for help..." for graphics_nsb_nf as #gr #gr "setfocus" #gr "trapclose quit" #gr "when leftButtonUp lButtonUp" #gr "when characterInput charIn" #gr "down" #gr "fill 128 128 128" #gr "size 3" dim fx(5) : dim fy(5) fx(0) = 120 : fy(0) = 120 fx(1) = 210 : fy(1) = 120 fx(2) = 300 : fy(2) = 120 fx(3) = 30 : fy(3) = 120 fx(4) = 120 : fy(4) = 30 fx(5) = 120 : fy(5) = 210
dim c(53) '54 colors for squares dim l$(53) 'labels for squares = original index dim spin(8) dim spinl$(8) for i = 0 to 53 f = int(i / 9) select case f case 0 : c(i) = 40 ' front face is green case 1 : c(i) = 700 ' right face red case 2 : c(i) = 8 ' back face blue case 3 : c(i) = 940 ' left face orange case 4 : c(i) = 999 ' top face white (which is why the black background case 5 : c(i) = 990 ' bottom face yellow end select l$(i) = str$(i) next call update #gr "flush" wait
' ====================================== procedures this window sub quit H$ close #gr end end sub
sub lButtonUp H$, mx, my call quit H$ end sub
sub charIn H$, c$ 'notice "*";c$;"*" 'debug 2nd character not found in INSTR, also 4th???? 'nstr$ = "1 2 3" 'there is some kind of bug such that the 2nd and 4th position in string is not found if c$ = "h" then call help if instr("xyz",c$) then cmd$ = c$ if (c$ = "1" or c$ = "2" or c$ = "3") and cmd$ <> "" then select case cmd$ case "x" select case c$ case "1" call cs 0, 3, 6, 36, 39, 42, 26, 23, 20, 45, 48, 51 'call cs 29, 32, 35, 27, 28, 29, 33, 30, 27, 35, 34, 33 call spinFace 3 case "2" call cs 1, 4, 7, 37, 40, 43, 25, 22, 19, 46, 49, 52 case "3" call cs 2, 5, 8, 38, 41, 44, 24, 21, 18, 47, 50, 53 'call cs 9, 12, 15, 11, 10, 9, 17, 14, 11, 15, 16, 17 call spinFace 1 'ok end select case "y" select case c$ case "1" call cs 0, 1, 2, 27, 28, 29, 18, 19, 20, 9, 10, 11 'call cs 42, 43, 44, 38, 41, 44, 36, 37, 38, 36, 39, 42 call spinFace 4 'not ok backwards case "2" call cs 3, 4, 5, 30, 31, 32, 21, 22, 23, 12, 13, 14 case "3" call cs 33, 34, 35, 24, 25, 26, 15, 16, 17, 6, 7, 8 'call cs 51, 48, 45, 45, 46, 47, 47, 50, 53, 53, 52, 51 call spinFace 5 end select case "z" select case c$ case "1" 'call cs 0, 1, 2, 2, 5, 8, 8, 7, 6, 6, 3, 0 call spinFace 0 'ok call cs 42, 43, 44, 9, 12, 15, 47, 46, 45, 35, 32, 29 case "2" call cs 10, 13, 16, 50, 49, 48, 34, 31, 28, 39, 40, 41 case "3" call cs 36, 37, 38, 11, 14, 17, 53, 52, 51, 33, 30, 27 'call cs 24, 25, 26, 18, 21, 24, 24, 25, 26, 26, 23, 20 call spinFace 2 end select end select call update cmd$ = "" end if if c$ = "q" then call quit H$ end sub
' ====================================== JB Library of procedures
sub rgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "color ";r;" ";g;" ";b #gr "backcolor ";r;" ";g;" ";b end sub
sub frgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "color ";r;" ";g;" ";b end sub
sub brgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "backcolor ";r;" ";g;" ";b end sub
sub label fColor, bColor, x, y, text$ call frgb fColor call brgb bColor #gr "place ";x;" ";y;";\";text$ end sub
sub fbox x0, y0, x1, y1 #gr "place ";x0;" ";y0 #gr "boxfilled ";x1+1;" ";y1+1 end sub
'=============================================== procedures this app
sub update for i = 0 to 53 f = int(i/9) xoff = fx(f) : yoff = fy(f) row = int((i - f * 9)/3) : col = i mod 3 call rgb c(i) call fbox xoff + col * 30, yoff + row * 30, xoff + col * 30 + 30, yoff + row * 30 + 30 call label 0, 999, xoff + col * 30 + 8, yoff + row * 30 + 20, l$(i) next 'draw grids call rgb 0 for f = 0 to 5 xoff = fx(f) : yoff = fy(f) for i = 0 TO 3 #gr "line ";xoff + 30 * i;" ";yoff;" ";xoff + 30 * i;" ";yoff + 90 #gr "line ";xoff;" ";yoff + 30 * i;" ";xoff + 90;" ";yoff + 30 * i next next end sub
'color shifter, these are all indexes to the c() array sub cs k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12 ks1 = c(k10) : ks2 = c(k11) : ks3 = c(k12) 'save first three ls1$ = l$(k10) : ls2$ = l$(k11) : ls3$ = l$(k12) 'save first three
c(k10) = c(k7) : c(k11) = c(k8) : c(k12) = c(k9) l$(k10) = l$(k7) : l$(k11) = l$(k8) : l$(k12) = l$(k9)
c(k7) = c(k4) : c(k8) = c(k5) : c(k9) = c(k6) l$(k7) = l$(k4) : l$(k8) = l$(k5) : l$(k9) = l$(k6)
c(k4) = c(k1) : c(k5) = c(k2) : c(k6) = c(k3) l$(k4) = l$(k1) : l$(k5) = l$(k2) : l$(k6) = l$(k3)
c(k1) = ks1 : c(k2) = ks2 : c(k3) = ks3 l$(k1) = ls1$ : l$(k2) = ls2$ : l$(k3) = ls3$ end sub
sub spinFace face for i = 0 to 8 'save data row = int(i / 3) : col = i mod 3 idx = face * 9 + 3 * row + col spin(i) = c(idx) spinl$(i) = l$(idx) next if face = 0 or face = 1 or face = 4 then for i = 0 to 8 'swap data row = int(i / 3) : col = i mod 3 idx = face * 9 + 3 * row + col select case i case 0 : c(idx) = spin(6) : l$(idx) = spinl$(6) case 1 : c(idx) = spin(3) : l$(idx) = spinl$(3) case 2 : c(idx) = spin(0) : l$(idx) = spinl$(0) case 3 : c(idx) = spin(7) : l$(idx) = spinl$(7) case 5 : c(idx) = spin(1) : l$(idx) = spinl$(1) case 6 : c(idx) = spin(8) : l$(idx) = spinl$(8) case 7 : c(idx) = spin(5) : l$(idx) = spinl$(5) case 8 : c(idx) = spin(2) : l$(idx) = spinl$(2) end select next else 'reverse for i = 0 to 8 'swap data row = int(i / 3) : col = i mod 3 idx = face * 9 + 3 * row + col select case i case 0 : c(idx) = spin(2) : l$(idx) = spinl$(2) case 1 : c(idx) = spin(5) : l$(idx) = spinl$(5) case 2 : c(idx) = spin(8) : l$(idx) = spinl$(8) case 3 : c(idx) = spin(1) : l$(idx) = spinl$(1) case 5 : c(idx) = spin(7) : l$(idx) = spinl$(7) case 6 : c(idx) = spin(0) : l$(idx) = spinl$(0) case 7 : c(idx) = spin(3) : l$(idx) = spinl$(3) case 8 : c(idx) = spin(6) : l$(idx) = spinl$(6) end select next end if end sub
sub help nl$ = Chr$(13) s$ = "****************** Rubic Help *******************" + nl$ s$ = s$ + "Let's call the 9 small cubes that make up 1/3" + nl$ s$ = s$ + "of the entire cube a 'layer'. Now, we need a" +nl$ s$ = s$ + "shorthand method to specify which layer to rotate." + nl$ s$ = s$ + "The x axis is layered left to right 1, 2, 3." + nl$ s$ = s$ + "The y axis is layered top down 1, 2, 3." + nl$ s$ = s$ + "The z axis is layered front to back 1, 2, 3." + nl$ s$ = s$ + "So, to command a rotation:"+ nl$ s$ = s$ + "Key press the axis and then the layer number." + nl$ s$ = s$ + "Can also press h for this help, or q to quit." notice s$ end sub
once again x1 y1 z1
|
|
|
Rubix
May 28, 2018 2:00:28 GMT
Post by B+ on May 28, 2018 2:00:28 GMT
OK now I can solve anything you spin up! Just make a bunch of rotations, get it good and scrambled then press s for solve! 'Rubic 3.txt for Just Basic v2 B+ started 2018-05-27 revised again ' from Rubic 2.txt
'now for my next trick, solve anything you can rotate up!
global xmax, ymax, cmd$, record$ xmax = 420 ymax = 330 nomainwin WindowWidth = xmax + 8 WindowHeight = ymax + 32 UpperLeftX = (1200 - xmax) / 2 UpperLeftY = (700 - ymax) / 2
open "Rubic 3, press h for help..." for graphics_nsb_nf as #gr #gr "setfocus" #gr "trapclose quit" #gr "when leftButtonUp lButtonUp" #gr "when characterInput charIn" #gr "down" #gr "fill 128 128 128" #gr "size 3" dim fx(5) : dim fy(5) fx(0) = 120 : fy(0) = 120 fx(1) = 210 : fy(1) = 120 fx(2) = 300 : fy(2) = 120 fx(3) = 30 : fy(3) = 120 fx(4) = 120 : fy(4) = 30 fx(5) = 120 : fy(5) = 210
dim c(53) '54 colors for squares dim l$(53) 'labels for squares = original index dim spin(8) dim spinl$(8) for i = 0 to 53 f = int(i / 9) select case f case 0 : c(i) = 40 ' front face is green case 1 : c(i) = 700 ' right face red case 2 : c(i) = 8 ' back face blue case 3 : c(i) = 940 ' left face orange case 4 : c(i) = 999 ' top face white (which is why the black background case 5 : c(i) = 990 ' bottom face yellow end select l$(i) = str$(i) next call update #gr "flush" wait
' ====================================== procedures this window
sub quit H$ close #gr end end sub
sub lButtonUp H$, mx, my call quit H$ end sub
sub charIn H$, c$ 'notice "*";c$;"*" 'debug 2nd character not found in INSTR, also 4th???? 'nstr$ = "1 2 3" 'there is some kind of bug such that the 2nd and 4th position in string is not found if c$ = "h" then call help if instr("xyz",c$) then cmd$ = c$ if (c$ = "1" or c$ = "2" or c$ = "3") and cmd$ <> "" then call cwRotate c$ cmd$ = "" end if if c$ = "s" then call solve if c$ = "q" then call quit H$ end sub
sub cwRotate level$ select case cmd$ case "x" select case level$ case "1" call cs 0, 3, 6, 36, 39, 42, 26, 23, 20, 45, 48, 51 call spinFace 3 case "2" call cs 1, 4, 7, 37, 40, 43, 25, 22, 19, 46, 49, 52 case "3" call cs 2, 5, 8, 38, 41, 44, 24, 21, 18, 47, 50, 53 call spinFace 1 end select case "y" select case level$ case "1" call cs 0, 1, 2, 27, 28, 29, 18, 19, 20, 9, 10, 11 call spinFace 4 case "2" call cs 3, 4, 5, 30, 31, 32, 21, 22, 23, 12, 13, 14 case "3" call cs 33, 34, 35, 24, 25, 26, 15, 16, 17, 6, 7, 8 call spinFace 5 end select case "z" select case level$ case "1" call spinFace 0 'ok call cs 42, 43, 44, 9, 12, 15, 47, 46, 45, 35, 32, 29 case "2" call cs 10, 13, 16, 50, 49, 48, 34, 31, 28, 39, 40, 41 case "3" call cs 36, 37, 38, 11, 14, 17, 53, 52, 51, 33, 30, 27 call spinFace 2 end select end select record$ = record$ + cmd$;level$ + " " call update end sub
' ====================================== JB Library of procedures
sub rgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "color ";r;" ";g;" ";b #gr "backcolor ";r;" ";g;" ";b end sub
sub frgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "color ";r;" ";g;" ";b end sub
sub brgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "backcolor ";r;" ";g;" ";b end sub
sub label fColor, bColor, x, y, text$ call frgb fColor call brgb bColor #gr "place ";x;" ";y;";\";text$ end sub
sub fbox x0, y0, x1, y1 #gr "place ";x0;" ";y0 #gr "boxfilled ";x1+1;" ";y1+1 end sub
sub pause mil 'tsh version has scan built-in t0 = time$("ms") while time$("ms") < t0 + mil : scan : wend end sub
'=============================================== procedures this app
sub update for i = 0 to 53 f = int(i/9) xoff = fx(f) : yoff = fy(f) row = int((i - f * 9)/3) : col = i mod 3 call rgb c(i) call fbox xoff + col * 30, yoff + row * 30, xoff + col * 30 + 30, yoff + row * 30 + 30 call label 0, 999, xoff + col * 30 + 8, yoff + row * 30 + 20, l$(i) next 'draw grids call rgb 0 for f = 0 to 5 xoff = fx(f) : yoff = fy(f) for i = 0 TO 3 #gr "line ";xoff + 30 * i;" ";yoff;" ";xoff + 30 * i;" ";yoff + 90 #gr "line ";xoff;" ";yoff + 30 * i;" ";xoff + 90;" ";yoff + 30 * i next next end sub
'color shifter, these are all indexes to the c() array sub cs k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12 ks1 = c(k10) : ks2 = c(k11) : ks3 = c(k12) 'save first three ls1$ = l$(k10) : ls2$ = l$(k11) : ls3$ = l$(k12) 'save first three
c(k10) = c(k7) : c(k11) = c(k8) : c(k12) = c(k9) l$(k10) = l$(k7) : l$(k11) = l$(k8) : l$(k12) = l$(k9)
c(k7) = c(k4) : c(k8) = c(k5) : c(k9) = c(k6) l$(k7) = l$(k4) : l$(k8) = l$(k5) : l$(k9) = l$(k6)
c(k4) = c(k1) : c(k5) = c(k2) : c(k6) = c(k3) l$(k4) = l$(k1) : l$(k5) = l$(k2) : l$(k6) = l$(k3)
c(k1) = ks1 : c(k2) = ks2 : c(k3) = ks3 l$(k1) = ls1$ : l$(k2) = ls2$ : l$(k3) = ls3$ end sub
sub spinFace face for i = 0 to 8 'save data row = int(i / 3) : col = i mod 3 idx = face * 9 + 3 * row + col spin(i) = c(idx) spinl$(i) = l$(idx) next if face = 0 or face = 1 or face = 4 then for i = 0 to 8 'swap data row = int(i / 3) : col = i mod 3 idx = face * 9 + 3 * row + col select case i case 0 : c(idx) = spin(6) : l$(idx) = spinl$(6) case 1 : c(idx) = spin(3) : l$(idx) = spinl$(3) case 2 : c(idx) = spin(0) : l$(idx) = spinl$(0) case 3 : c(idx) = spin(7) : l$(idx) = spinl$(7) case 5 : c(idx) = spin(1) : l$(idx) = spinl$(1) case 6 : c(idx) = spin(8) : l$(idx) = spinl$(8) case 7 : c(idx) = spin(5) : l$(idx) = spinl$(5) case 8 : c(idx) = spin(2) : l$(idx) = spinl$(2) end select next else 'reverse for i = 0 to 8 'swap data row = int(i / 3) : col = i mod 3 idx = face * 9 + 3 * row + col select case i case 0 : c(idx) = spin(2) : l$(idx) = spinl$(2) case 1 : c(idx) = spin(5) : l$(idx) = spinl$(5) case 2 : c(idx) = spin(8) : l$(idx) = spinl$(8) case 3 : c(idx) = spin(1) : l$(idx) = spinl$(1) case 5 : c(idx) = spin(7) : l$(idx) = spinl$(7) case 6 : c(idx) = spin(0) : l$(idx) = spinl$(0) case 7 : c(idx) = spin(3) : l$(idx) = spinl$(3) case 8 : c(idx) = spin(6) : l$(idx) = spinl$(6) end select next end if end sub
sub solve i = 1 'cnt moves while word$(record$, i) <> "" scan cnt = cnt + 1 i = i + 1 wend for i = cnt to 1 step -1 scan cmd$ = left$(word$(record$, i), 1) lv$ = right$(word$(record$, i), 1) for j = 1 to 3 scan call cwRotate lv$ call pause 100 next next cmd$ = "" record$ = "" end sub
sub help nl$ = Chr$(13) s$ = "****************** Rubic Help *******************" + nl$ s$ = s$ + "Let's call the 9 small cubes that make up 1/3" + nl$ s$ = s$ + "of the entire cube a 'layer'. Now, we need a" +nl$ s$ = s$ + "shorthand method to specify which layer to rotate." + nl$ s$ = s$ + "The x axis is layered left to right 1, 2, 3." + nl$ s$ = s$ + "The y axis is layered top down 1, 2, 3." + nl$ s$ = s$ + "The z axis is layered front to back 1, 2, 3." + nl$ s$ = s$ + "So, to command a rotation:"+ nl$ s$ = s$ + "Key press the axis and then the layer number." + nl$ s$ = s$ + "Can also press h for this help, or q to quit." + nl$ + nl$ s$ = s$ + "SOLVE!, press s to solve the cube." notice s$ end sub
|
|
|
Post by B+ on May 29, 2018 23:19:33 GMT
Now in 3D! 'Rubic 4.txt for Just Basic v2 B+ started 2018-05-27 revised again ' post 2018-05-29 edited 2-3 times swap faces at bottom cube view and spin bottom face ' from Rubic 3.txt
'now for my next trick, 3D
global xmax, ymax, pi, cmd$, record$, c6, s6 xmax = 606 ymax = 450 pi = acs(-1) c6 = 30 * cos(pi/6) s6 = 30 * sin(pi/6) nomainwin WindowWidth = xmax + 8 WindowHeight = ymax + 32 UpperLeftX = (1200 - xmax) / 2 UpperLeftY = (700 - ymax) / 2
open "Rubic 4, press h for help..." for graphics_nsb_nf as #gr #gr "setfocus" #gr "trapclose quit" #gr "when leftButtonUp lButtonUp" #gr "when characterInput charIn" #gr "down" #gr "fill 115 115 115" #gr "size 3" dim fx(5) : dim fy(5) fx(0) = 120 : fy(0) = 180 fx(1) = 210 : fy(1) = 180 fx(2) = 300 : fy(2) = 180 fx(3) = 30 : fy(3) = 180 fx(4) = 120 : fy(4) = 90 fx(5) = 120 : fy(5) = 270
dim c(53) '54 colors for squares dim l$(53) 'labels for squares = original index dim spin(8) dim spinl$(8) for i = 0 to 53 f = int(i / 9) select case f case 0 : c(i) = 40 ' front face is green case 1 : c(i) = 700 ' right face red case 2 : c(i) = 8 ' back face blue case 3 : c(i) = 940 ' left face orange case 4 : c(i) = 999 ' top face white (which is why the black background case 5 : c(i) = 990 ' bottom face yellow end select l$(i) = str$(i) next call update #gr "flush" wait
' ====================================== procedures this window
sub quit H$ close #gr end end sub
sub lButtonUp H$, mx, my call quit H$ end sub
sub charIn H$, c$ 'notice "*";c$;"*" 'debug 2nd character not found in INSTR, also 4th???? 'nstr$ = "1 2 3" 'there is some kind of bug such that the 2nd and 4th position in string is not found if c$ = "h" then call help if instr("xyz",c$) then cmd$ = c$ if (c$ = "1" or c$ = "2" or c$ = "3") and cmd$ <> "" then call cwRotate c$ cmd$ = "" end if if c$ = "s" then call solve if c$ = "q" then call quit H$ end sub
sub cwRotate level$ select case cmd$ case "x" select case level$ case "1" call cs 0, 3, 6, 36, 39, 42, 26, 23, 20, 45, 48, 51 call spinFace 3 case "2" call cs 1, 4, 7, 37, 40, 43, 25, 22, 19, 46, 49, 52 case "3" call cs 2, 5, 8, 38, 41, 44, 24, 21, 18, 47, 50, 53 call spinFace 1 end select case "y" select case level$ case "1" call cs 0, 1, 2, 27, 28, 29, 18, 19, 20, 9, 10, 11 call spinFace 4 case "2" call cs 3, 4, 5, 30, 31, 32, 21, 22, 23, 12, 13, 14 case "3" call cs 33, 34, 35, 24, 25, 26, 15, 16, 17, 6, 7, 8 call spinFace 5 end select case "z" select case level$ case "1" call spinFace 0 'ok call cs 42, 43, 44, 9, 12, 15, 47, 46, 45, 35, 32, 29 case "2" call cs 10, 13, 16, 50, 49, 48, 34, 31, 28, 39, 40, 41 case "3" call cs 36, 37, 38, 11, 14, 17, 53, 52, 51, 33, 30, 27 call spinFace 2 end select end select record$ = record$ + cmd$;level$ + " " call update end sub
' ====================================== JB Library of procedures
sub rgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "color ";r;" ";g;" ";b #gr "backcolor ";r;" ";g;" ";b end sub
sub frgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "color ";r;" ";g;" ";b end sub
sub brgb n3 s3$ = right$("000";str$(n3), 3) r = 28 * val(mid$(s3$, 1, 1)) + 3 g = 28 * val(mid$(s3$, 2, 1)) + 3 b = 28 * val(mid$(s3$, 3, 1)) + 3 #gr "backcolor ";r;" ";g;" ";b end sub
sub label fColor, bColor, x, y, text$ call frgb fColor call brgb bColor #gr "place ";x;" ";y;";\";text$ end sub
sub fbox x0, y0, x1, y1 #gr "place ";x0;" ";y0 #gr "boxfilled ";x1+1;" ";y1+1 end sub
sub pause mil 'tsh version has scan built-in t0 = time$("ms") while time$("ms") < t0 + mil : scan : wend end sub
'=============================================== procedures this app
sub update for i = 0 to 53 f = int(i/9) xoff = fx(f) : yoff = fy(f) row = int((i - f * 9)/3) : col = i mod 3 call rgb c(i) fore = 999 - c(i) : bk = c(i) call fbox xoff + col * 30, yoff + row * 30, xoff + col * 30 + 30, yoff + row * 30 + 30 call label fore, bk, xoff + col * 30 + 8, yoff + row * 30 + 20, right$(" ";l$(i), 2) next 'draw grids call rgb 0 for f = 0 to 5 xoff = fx(f) : yoff = fy(f) for i = 0 TO 3 #gr "line ";xoff + 30 * i;" ";yoff;" ";xoff + 30 * i;" ";yoff + 90 #gr "line ";xoff;" ";yoff + 30 * i;" ";xoff + 90;" ";yoff + 30 * i next next
'3D views #gr "size 1" for face = 0 to 5 fi = face * 9 select case face case 0 : fx = 420 : fy = 75 for row = 0 to 2 for col = 0 to 2 x = fx + col * c6 y = fy + row * 30 + 15 * col call rgb c(fi + row * 3 + col) call d1 x, y next next case 1 : fx = 498 : fy = 120 for row = 0 to 2 for col = 0 to 2 x = fx + col * c6 y = fy + row * 30 - 15 * col call rgb c(fi + row * 3 + col) call d2 x, y next next case 3 : fx = 498 : fy = 240 'back side is mirror of front view for row = 0 to 2 for col = 0 to 2 x = fx + col * c6 y = fy + row * 30 + 15 * col call rgb c(fi + row * 3 + (col)) call d1 x, y next next case 2 : fx = 420 : fy = 285 for row = 0 to 2 for col = 0 to 2 x = fx + col * c6 y = fy + row * 30 - 15 * col call rgb c(fi + row * 3 + (col)) call d2 x, y next next case 4 : fx = 498 : fy = 30 for row = 0 to 2 for col = 0 to 2 x = fx + col * 26 - row * 26 y = fy + row * 15 + 15 * col call rgb c(fi + row * 3 + col) call d3 x, y next next case 5 : fx = 498 : fy = 330 for row = 0 to 2 for col = 0 to 2 x = fx + col * 26 - row * 26 y = fy + row * 15 + 15 * col 'spin the face i = row * 3 + col select case i case 0 : j = 6 case 1 : j = 3 case 2 : j = 0 case 3 : j = 7 case 4 : j = 4 case 5 : j = 1 case 6 : j = 8 case 7 : j = 5 case 8 : j = 2 end select call rgb c(fi + j) call d3 x, y next next end select next call label 999, 444, 426, 20, "Top Front Right View:" call label 999, 444, 425, 440, "Back Left Bottom View:" end sub
sub d1 x, y for yo = 0 to 30 #gr "line ";x;" ";y + yo;" ";x + c6;" ";y + yo + s6 next #gr "size 4" #gr "color black" #gr "line ";x;" ";y;" ";x + c6;" ";y + s6 #gr "line ";x;" ";y;" ";x;" ";y + 30 #gr "line ";x + c6;" ";y + s6;" ";x + c6;" ";y + 30 + s6 #gr "line ";x;" ";y + 30;" ";x + c6;" ";y + 30 + s6 end sub
sub d2 x, y for yo = 0 to 30 #gr "line ";x;" ";y + yo;" ";x + c6;" ";y + yo - s6 next #gr "size 4" #gr "color black" #gr "line ";x;" ";y;" ";x + c6;" ";y - s6 #gr "line ";x;" ";y;" ";x;" ";y + 30 #gr "line ";x + c6;" ";y - s6;" ";x + c6;" ";y + 30 - s6 #gr "line ";x;" ";y + 30;" ";x + c6;" ";y + 30 - s6 end sub
sub d3 x, y yy = y + 15 for xx = 0 to 26 fx = 15 - 15/26 * xx #gr "line ";x + xx;" ";yy - fx;" ";x + xx;" ";yy + fx #gr "line ";x - xx;" ";yy - fx;" ";x - xx;" ";yy + fx next #gr "size 4" #gr "color black" #gr "place ";x;" ";y #gr "north" #gr "turn 120" #gr "go 30" #gr "turn 120" #gr "go 30" #gr "turn 60" #gr "go 30" #gr "turn 120" #gr "go 30" end sub
'color shifter, these are all indexes to the c() array sub cs k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12 ks1 = c(k10) : ks2 = c(k11) : ks3 = c(k12) 'save first three ls1$ = l$(k10) : ls2$ = l$(k11) : ls3$ = l$(k12) 'save first three
c(k10) = c(k7) : c(k11) = c(k8) : c(k12) = c(k9) l$(k10) = l$(k7) : l$(k11) = l$(k8) : l$(k12) = l$(k9)
c(k7) = c(k4) : c(k8) = c(k5) : c(k9) = c(k6) l$(k7) = l$(k4) : l$(k8) = l$(k5) : l$(k9) = l$(k6)
c(k4) = c(k1) : c(k5) = c(k2) : c(k6) = c(k3) l$(k4) = l$(k1) : l$(k5) = l$(k2) : l$(k6) = l$(k3)
c(k1) = ks1 : c(k2) = ks2 : c(k3) = ks3 l$(k1) = ls1$ : l$(k2) = ls2$ : l$(k3) = ls3$ end sub
sub spinFace face for i = 0 to 8 'save data row = int(i / 3) : col = i mod 3 idx = face * 9 + 3 * row + col spin(i) = c(idx) spinl$(i) = l$(idx) next if face = 0 or face = 1 or face = 4 then for i = 0 to 8 'swap data row = int(i / 3) : col = i mod 3 idx = face * 9 + 3 * row + col select case i case 0 : c(idx) = spin(6) : l$(idx) = spinl$(6) case 1 : c(idx) = spin(3) : l$(idx) = spinl$(3) case 2 : c(idx) = spin(0) : l$(idx) = spinl$(0) case 3 : c(idx) = spin(7) : l$(idx) = spinl$(7) case 5 : c(idx) = spin(1) : l$(idx) = spinl$(1) case 6 : c(idx) = spin(8) : l$(idx) = spinl$(8) case 7 : c(idx) = spin(5) : l$(idx) = spinl$(5) case 8 : c(idx) = spin(2) : l$(idx) = spinl$(2) end select next else 'reverse for i = 0 to 8 'swap data row = int(i / 3) : col = i mod 3 idx = face * 9 + 3 * row + col select case i case 0 : c(idx) = spin(2) : l$(idx) = spinl$(2) case 1 : c(idx) = spin(5) : l$(idx) = spinl$(5) case 2 : c(idx) = spin(8) : l$(idx) = spinl$(8) case 3 : c(idx) = spin(1) : l$(idx) = spinl$(1) case 5 : c(idx) = spin(7) : l$(idx) = spinl$(7) case 6 : c(idx) = spin(0) : l$(idx) = spinl$(0) case 7 : c(idx) = spin(3) : l$(idx) = spinl$(3) case 8 : c(idx) = spin(6) : l$(idx) = spinl$(6) end select next end if end sub
sub solve i = 1 'cnt moves while word$(record$, i) <> "" scan cnt = cnt + 1 i = i + 1 wend for i = cnt to 1 step -1 scan cmd$ = left$(word$(record$, i), 1) lv$ = right$(word$(record$, i), 1) for j = 1 to 3 scan call cwRotate lv$ call pause 100 next next cmd$ = "" record$ = "" end sub
sub help nl$ = Chr$(13) s$ = "****************** Rubic Help *******************" + nl$ s$ = s$ + "Let's call the 9 small cubes that make up 1/3" + nl$ s$ = s$ + "of the entire cube a 'layer'. Now, we need a" +nl$ s$ = s$ + "shorthand method to specify which layer to rotate." + nl$ s$ = s$ + "The x axis is layered left to right 1, 2, 3." + nl$ s$ = s$ + "The y axis is layered top down 1, 2, 3." + nl$ s$ = s$ + "The z axis is layered front to back 1, 2, 3." + nl$ s$ = s$ + "So, to command a rotation:"+ nl$ s$ = s$ + "Key press the axis and then the layer number." + nl$ s$ = s$ + "Can also press h for this help, or q to quit." + nl$ + nl$ s$ = s$ + "SOLVE!, press s to solve the cube." notice s$ end sub
Edited 2-3 times, I had to swap sides in the bottom cube and then I had to spin the bottom face in the bottom cube. Then I centered 2D floor plan view and polished up the labels. Now with solver, this is better than owning a cube! ;-))
|
|
|
Rubix
Jun 3, 2018 6:07:23 GMT
Post by bluatigro on Jun 3, 2018 6:07:23 GMT
I can not run this now
what do you think of adding a pause to the solver so we see a animation ?
|
|
|
Rubix
Jun 3, 2018 15:32:48 GMT
Post by B+ on Jun 3, 2018 15:32:48 GMT
I can not run this now what do you think of adding a pause to the solver so we see a animation ? It has a pause already at 100 ms for each rotation, you can increase if you like: sub solve i = 1 'cnt moves while word$(record$, i) <> "" scan cnt = cnt + 1 i = i + 1 wend for i = cnt to 1 step -1 scan cmd$ = left$(word$(record$, i), 1) '<<< remember cmd$ is a global variable, so is record$ for that matter! lv$ = right$(word$(record$, i), 1) for j = 1 to 3 scan call cwRotate lv$ call pause 100 '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< increase if not a long enough pause next next cmd$ = "" record$ = "" end sub
The trick to this solver is to undo each rotation from end to start by making that rotation 3 more times (which was why each move was recoded). Pretty clever huh? No? Have some cube expert tell you how to solve a cube, can they use as few words? Would it be so obvious why it works?
|
|
|
Rubix
Jun 5, 2018 2:13:32 GMT
Post by bluatigro on Jun 5, 2018 2:13:32 GMT
? : possible ? q : not jet done b : boring t : tried w : working s : solver rubix's 4 1 b 4 2 b 4 3 q 4 n q 6 1 b 6 2 t by me 6 3 w by b+ 6 n q 8 1 b 8 2 ? 8 3 q 8 n ? 12 1 b 12 2 ? 12 3 q 12 n ? 20 1 b 20 2 ? 20 3 q 20 n ?
|
|
|
Rubix
Jan 9, 2019 12:30:58 GMT
Post by danmaz on Jan 9, 2019 12:30:58 GMT
I would suggest You to use the standard code for rubik's cube solvers
L=Left B=Back R=Right F=Front U=Upper D=Down for the faces
L2 = double rotation L = clockwise rotation L' = counterclockwise rotation etc.. for the rotations
The rotation of the middle layer in not considered in this notation, nor it is useful. It can be substituted by opposite faces rotation.
I see that in your rubik's model it isn't allowed to choose the rotation (clockwise or counterclockwise), a thing that usually happens with real cube.
Anyway the code seems to work preperly ... nice job !
Regards
Daniele
|
|
|
Rubix
Jan 9, 2019 19:11:23 GMT
Post by B+ on Jan 9, 2019 19:11:23 GMT
Hi Daniele,
Thanks for your feed back. I did this purely as coding challenge without an actual puzzle at hand, so I had to look up the layout from Internet images. Not an enthusiast so unfamiliar with standard code. At one point, I was so confused about the back view I made a paper cube model.
Ha! so nobody rotates the middle section, makes sense.
I recommend to everyone to use the real cube because the back view is more confusing than helpful, at least in my view.
|
|