Listing 3. The rest --------------------- SUB Init FOR n= 1 TO 6: FOR i= 1 TO 3: FOR j= 1 TO 3 c(n, i, j) = n: NEXT j: NEXT i: NEXT n END SUB SUB MidLayer (fac) 'temporary message LOCATE 3, 58: PRINT face(fac); "whole cube" END SUB SUB Mouse (axx) 'Reset, show or hide mouse 'inregs.ax = axx 'load ax register 'CALL INTERRUPT(&H33, inregs, outregs) 'QuickBasic above, QBasic below SHARED a() 'machine code array a(2) = axx 'sets register ax DEF SEG = VARSEG(a(1)) 'find address CALL ABSOLUTE(VARPTR(a(1))) DEF SEG 'bx,cx,dx now in a(15 to 17) END SUB SUB MouseLimit 'Restrict mouse to top panel 'inregs.ax =7: inregs.cx =60: inregs.dx =420 'CALL INTERRUPT(&H33, inregs, outregs) 'inregs.ax =8: inregs.cx =40: inregs.dx = 88 'CALL INTERRUPT(&H33,inregs,outregs) 'QuickBasic above. QBasic below SHARED b() 'machine code array b(2) = 7: b(4) = 60: b(6) = 420 'ax,cx,dx DEF SEG = VARSEG(b(1)) 'find address CALL ABSOLUTE(VARPTR(b(1))) DEF SEG 'x moves restricted b(2) = 8: b(4) = 40: b(6) = 88 'ax,cx,dx DEF SEG = VARSEG(b(1)) 'find address CALL ABSOLUTE(VARPTR(b(1))) DEF SEG 'y moves restricted END SUB SUB PrStr (st$, row)'Prints a string, col 58 LOCATE row, 58: PRINT st$ END SUB SUB Redraw 'recolour all squares FOR n= 1 TO 6: FOR i= 1 TO 3: FOR j= 1 TO 3 PAINT(x(n,i,j), y(n,i,j)), c(n,i,j), 15 NEXT j: NEXT i: NEXT n END SUB SUB Rotate (fac, rot) 'temporary message LOCATE 3,58: PRINT face(fac); rot*90 END SUB SUB Solve 'temporary message PrStr "Solve chosen ", 3 END SUB ---------------- End of Listing 3