home *** CD-ROM | disk | FTP | other *** search
- '+-------------------------------------------------------------------+
- '▌ ▌
- '▌ R U B O T ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- '<->
- DEFINT A-Z
- DECLARE SUB ziPublish (Printstring$, size, italic)
- ' Print a string at graphics cursor (advanced)
- ' Size = magnitude (per 8 pixels)
- ' Italic = +1 to make italic
- ' = +2 to make overprint (no background)
-
- DECLARE SUB ziPublishHere (Row, Col, Printstring$, size, italic)
- ' Print a string at the specified text position
-
- DECLARE SUB zsAlignGCursor ()
- ' Align graphic cursor to same as text cursor
- ' - sets Row, Col, GXloc, GYloc
-
- DECLARE SUB zsAlignTCursor ()
- ' Align text cursor to same as graphic cursor
- ' - sets Row, Col, GXloc, GYloc
-
- DECLARE SUB zsLocateGCursor (XCoord, YCoord)
- ' Locate graphic cursor to a named point
-
- DECLARE SUB zsPastel (XCoord, YCoord, Wide, Deep, colour1, colour2)
- ' Colour the defined oblong with a pastel mix of two colours
- ' Deep = 0 or 1 - square
- ' = n - Y-pixel depth
-
- DECLARE SUB zsSetScrnMode (Mode, HiRows, HiCols)
- ' Mode = 9, 12 or 13
- ' HiRows = 1 to make high number of rows
- ' HiCols = 1 to make high number of cols (80)
- ' Set SCREEN parameters and blank the screen
- ' - sets ScrnMode, Xmax, Ymax, Rows, Cols, XYRatio!
- ' - uses FG and optionally BG (colours)
-
- DECLARE SUB zsSubstitute (XCoord, YCoord, Wide, Deep, colour1, colour2)
- ' Substitute one colour with another within the defined oblong
- ' Deep = 0 or 1 - square
- ' = n - Y-pixel depth
-
- '/==============================================/
- '/ UK copyright (c) 2002 by Future Publishing /
- '/==============================================/
-
- CONST Pi! = 3.14159
- CONST Ex! = 2.71828
- CONST DegToRad! = .0174533
- CONST RadToDeg! = 57.2958
-
- DIM SHARED Bad
- DIM SHARED ScrnMode, Bg, Fg
- DIM SHARED Xmax, Ymax, GXloc, GYloc, XYratio!
- DIM SHARED Rows, Cols, Row, Col
- DIM SHARED Font(255, 7)
- DIM SHARED Shades(7, 4) AS STRING * 8
-
- '++++++++++++++++++++++++
- RANDOMIZE TIMER
- ON ERROR GOTO RESUMENEXT
- RESUMENEXT:
- IF ERR THEN
- Bad = ERR
- RESUME NEXT
- END IF
- '/==================================/'
- '/ End of Standard Piecrust code /'
- '/==================================/'
- '<+>
- Bg = 8: Fg = 0: zsSetScrnMode 12, 1, 1
-
- DIM Temp(15)
-
- CubeShape:
-
- XUpright = 49: YUpright = 36
- XInverse = -591: YInverse = -320
-
- ' outline (foreshortened view from above)
- DATA 999, 111, 0, 0, 54, 0,195
- DATA 111,288, 222,195, 222, 54, 111, 0
- DATA 0, 53, 111,125, 222, 53, 222, 55
- DATA 112,127, 112,288, 110,288, 110, 127
- DATA 0, 55, 0, 54, 111,126, 222, 54
- DATA 999, 111,126, 111,288
-
- ' lattice lines
- DATA 999, 74, 18, 185, 78, 185,226
- DATA 999, 37, 36, 148,102, 148,257
-
- DATA 999, 148, 18, 37, 78, 37,226
- DATA 999, 185, 36, 74,102, 74,257
-
- DATA 999, 0,101, 111,180, 222,101
- DATA 999, 0,148, 111,234, 222,148
-
- DATA 999,999
-
- ' Draw the cube TWICE: the second time, inverted
-
- XCorner = XUpright: YCorner = YUpright
- DO
- DO
- READ XCoord, YCoord
- IF XCoord = 999 THEN
- IF YCoord = 999 THEN EXIT DO
- XCoord = YCoord
- READ YCoord
- PSET (ABS(XCoord + XCorner), ABS(YCoord + YCorner))
- ELSE
- LINE -(ABS(XCoord + XCorner), ABS(YCoord + YCorner)), 0
- END IF
- LOOP
- IF XCorner < 0 THEN EXIT DO
- RESTORE CubeShape
- ' negative coordinates for inverted image
- XCorner = XInverse: YCorner = YInverse
- LOOP
-
- PAINT (0, 0), 11, 0
- Bg = 15
- LINE (213, 5)-STEP(190, 54), 0, B
- PAINT (214, 6), Bg, 0
- Fg = 4: zsLocateGCursor 216, 8
- ziPublish "ESC", 1, 2: Fg = 0: ziPublish "-End", 1, 3
- Fg = 4: zsLocateGCursor 312, 8
- ziPublish "HOME", 1, 2: Fg = 0: ziPublish "-Reset", 1, 3
- Fg = 4: zsLocateGCursor 216, 18
- ziPublish "DEL", 1, 2: Fg = 0: ziPublish "-Scramble", 1, 3
- Fg = 4: zsLocateGCursor 216, 28
- ziPublish " X ", 1, 2: Fg = 0: ziPublish "-Preset", 1, 3
- Fg = 4: zsLocateGCursor 320, 18
- ziPublish "TAB", 1, 2: Fg = 0: ziPublish "-Solve", 1, 3
- Fg = 4: zsLocateGCursor 320, 28
- ziPublish " Z ", 1, 2: Fg = 0: ziPublish "-CTR=0", 1, 3
- Fg = 4: zsLocateGCursor 216, 38
- ziPublish " [T] ", 1, 2: Fg = 0: ziPublish "-", 1, 3
- ziPublish "UP", 1, 2: ziPublish " or ", 1, 3: ziPublish "RIGHT", 1, 2
- Fg = 4: zsLocateGCursor 216, 48
- ziPublish "ctl+[T]", 1, 2: Fg = 0: ziPublish "-", 1, 3
- ziPublish "DOWN", 1, 2: ziPublish " or ", 1, 3: ziPublish "LEFT", 1, 2
-
- LINE (0, 0)-(100, 32), 0, BF
- zsLocateGCursor 5, 8: Fg = 15: ziPublish "RUbot!", 2, 2
-
-
-
- DIM VCube(6, 9)
- ' F, q --> face (1-6)
- ' p, C --> colour on face
-
- FOR i = 1 TO 6
- FOR j = 1 TO 9
- VCube(i, j) = i
- NEXT
- NEXT
-
- DIM Face(6, 9, 2)
- ' N, q, r --> N = face
- ' At the start, the pure cube has face 1 Red, face 2 White,
- ' face 3 Blue, face 4 Green, face 5 Yellow, face 6 Orange
- ' p, N, r --> colour within middle cell for each face
- ' p, q, 1 --> x co-ordinate
- ' p, q, 2 --> y co-ordinate
-
- ' LAYOUT OF CUBE: (at start)
-
- ' W3 W6 W9
- ' W2 W5 W8
- ' W1 W4 W7
-
- ' B7 B4 B1 R1 R2 R3 O9 O8 O7 G3 G6 G9
- ' B8 B5 B2 R4 R5 R6 O6 O5 O4 G2 G5 G8
- ' B9 B6 B3 R7 R8 R9 O3 O2 O1 G1 G4 G7
-
- ' Y9 Y8 Y7
- ' Y6 Y5 Y4
- ' Y3 Y2 Y1
-
- ' Note that the corner cubes are:
- ' R1-W1-B1 R3-W7-O9 R7-B3-Y9 R9-Y7-O3
- ' W3-B7-G9 W9-G3-O7 B9-G7-Y3 G1-Y1-O1
-
- ' ..and the edge cubes are:
- ' R2-W4 R4-B2 R8-Y8 R6-O6 W2-B4 W6-G6
- ' W8-O8 B8-G8 B6-Y6 G4-Y2 G2-O4 Y4-O2
-
- ' 'A' face co-ordinates
- DATA 129,151, 166,115, 203, 90
- DATA 129,193, 166,165, 203,138
- DATA 129,246, 166,216, 203,187
-
- ' 'B' face co-ordinates
- DATA 111,102, 74, 78, 37, 54
- DATA 148, 78, 111, 54, 74, 36
- DATA 185, 54, 148, 36, 111, 18
-
- ' 'C' co-ordinates
- DATA 93,151, 93,193, 93,246
- DATA 56,115, 56,165, 56,216
- DATA 18, 90, 18,138, 18,187
-
- FOR i = 1 TO 3
- FOR j = 1 TO 9
- READ M, n
- Face(i, j, 1) = M + XUpright
- Face(i, j, 2) = n + YUpright
- Face(7 - i, j, 1) = ABS(M + XInverse)
- Face(7 - i, j, 2) = ABS(n + YInverse)
- NEXT
- NEXT
-
- DIM Neighbours(4, 9)
- ' D, q --> direction (1=North, 2=East, 3=South, 4=West)
- ' p, V (1-6) --> virtual face in that direction
- ' p, C (7-9) --> border cells on virtual face
-
- ' Each face has three neighbours, and they border each
- ' other in this manner:
-
- ' North
- ' N1 N4 N7
-
- ' W1 F1 F2 F3 E9
-
- ' West W2 F4 F5 F6 E6 East
-
- ' W3 F7 F8 F9 E3
-
- ' S9 S8 S7
- ' South
-
-
- ' White Blue Red
- ' Blue RED Orange Red WHITE Green White BLUE Yellow
- ' Yellow Orange Green
-
- ' Orange Green Yellow
- ' Yellow GREEN White Orange YELLOW Blue Green ORANGE Red
- ' Blue Red White
-
- DATA 2,3,1,6,4,5, 1,4,7
- DATA 6,4,5,2,3,1, 9,6,3
- DATA 5,6,4,3,1,2, 7,8,9
- DATA 3,1,2,5,6,4, 3,2,1
-
- FOR i = 1 TO 4
- FOR j = 1 TO 9
- READ Neighbours(i, j)
- NEXT
- NEXT
-
- ' Colour control: RED = 1
- ' WHITE = 2
- ' BLUE = 3
- ' GREEN = 4
- ' YELLOW = 5
- ' ORANGE = 6
-
- ' Note that RED and GREEN are opposite;
- ' WHITE and YELLOW are opposite;
- ' BLUE and ORANGE are opposite
-
- DIM ColourTable(6)
- DATA 4, 15, 1, 2, 14, 12
-
- FOR i = 1 TO 6
- READ ColourTable(i)
- NEXT
-
- DIM Orient(40)
-
- DIM Horizontal(19)
- DATA 2,7, 0,1
- DATA 5,3, 0,1
- DATA 4,9, 6,7, 1,9, 3,3, 0,1
- DATA 999
- FOR i = 1 TO 19
- READ Horizontal(i)
- NEXT
-
- DIM Vertical(19)
- DATA 1,3, 0,1
- DATA 4,7, 0,1
- DATA 2,9, 3,7, 5,9, 6,3, 0,1
- DATA 999
- FOR i = 1 TO 19
- READ Vertical(i)
- NEXT
-
-
- ' put up labels for the slices
- Bg = 11: Fg = 0
- zsLocateGCursor 50, 260: ziPublish "L", 2, 0
- zsLocateGCursor 87, 291: ziPublish "M", 2, 0
- zsLocateGCursor 124, 322: ziPublish "R", 2, 0
-
- zsLocateGCursor 180, 322: ziPublish "F", 2, 0
- zsLocateGCursor 217, 291: ziPublish "V", 2, 0
- zsLocateGCursor 254, 260: ziPublish "A", 2, 0
-
- zsLocateGCursor 20, 103: ziPublish "T", 2, 0
- zsLocateGCursor 20, 150: ziPublish "H", 2, 0
- zsLocateGCursor 20, 197: ziPublish "B", 2, 0
-
- Fg = 12
- zsLocateGCursor 570, 80: ziPublish "F", 2, 0
- zsLocateGCursor 533, 49: ziPublish "V", 2, 0
- zsLocateGCursor 496, 18: ziPublish "A", 2, 0
-
- zsLocateGCursor 448, 18: ziPublish "L", 2, 0
- zsLocateGCursor 411, 49: ziPublish "M", 2, 0
- zsLocateGCursor 374, 80: ziPublish "R", 2, 0
-
- zsLocateGCursor 605, 143: ziPublish "T", 2, 0
- zsLocateGCursor 605, 190: ziPublish "H", 2, 0
- zsLocateGCursor 605, 237: ziPublish "B", 2, 0
-
- ' number the faces
- Fg = 15
- CIRCLE (285, 239), 15, 1: PAINT (285, 239), 1
- zsLocateGCursor 278, 231: ziPublish "1", 2, 2
- CIRCLE (160, 20), 15, 1: PAINT (160, 20), 1
- zsLocateGCursor 154, 12: ziPublish "2", 2, 2
- CIRCLE (35, 239), 15, 1: PAINT (35, 239), 1
- zsLocateGCursor 28, 231: ziPublish "3", 2, 2
-
- CIRCLE (355, 117), 15, 1: PAINT (355, 117), 1
- zsLocateGCursor 347, 109: ziPublish "6", 2, 2
- CIRCLE (480, 336), 15, 1: PAINT (480, 336), 1
- zsLocateGCursor 472, 328: ziPublish "5", 2, 2
- CIRCLE (605, 117), 15, 1: PAINT (605, 117), 1
- zsLocateGCursor 597, 109: ziPublish "4", 2, 2
-
- LINE (0, 350)-(Xmax, Ymax), 10, BF
- LINE (0, 349)-(Xmax, 350), 0, BF
- LINE (128, 350)-(129, Ymax), 0, BF
- LINE (422, 350)-(423, Ymax), 0, BF
-
- ' set out area for status of central squares
- DIM Centres(6)
-
- Bg = 11
- FOR i = 1 TO 6
- Centres(i) = i
- j = 353 + 16 * i
- LINE (44, j)-STEP(13, 13), 0, B
- PAINT (45, j + 1), ColourTable(i), 0
- zsLocateGCursor 32, j + 4
- Fg = 0: ziPublish MID$("RWBGYO", i, 1), 1, 2
- NEXT
-
- ' set out area for status of Edge Pieces
- DIM Edges(12, 5)
- ' P, y --> sequential number of piece (domino-style)
- ' x, 1 --> lower colour number (1=Red, etc)
- ' x, 2 --> higher colour number
- ' x, 3 --> face for lower colour
- ' x, 4 --> face for higher colour
- ' x, 5 --> status: 0 = wrong place
- ' 1 = correct place
- ' 2 = correct alignment
- ix = 0
- FOR i = 1 TO 5
- FOR j = i + 1 TO 6
- IF j - i <> 3 THEN
- ix = ix + 1
- Edges(ix, 1) = i
- Edges(ix, 2) = j
- Edges(ix, 3) = i
- Edges(ix, 4) = j
- jx = 353 + 16 * ((ix - 1) MOD 6 + 1)
- kx = 184 + 139 * ((ix - 1) \ 6)
- LINE (kx, jx)-STEP(13, 13), 0, B
- PAINT (kx + 1, jx + 1), ColourTable(i), 0
- LINE (kx + 13, jx)-STEP(13, 13), 0, B
- PAINT (kx + 14, jx + 1), ColourTable(j), 0
- Fg = 0: zsLocateGCursor kx - 20, jx + 4
- ziPublish MID$("RWBGYO", i, 1), 1, 2
- ziPublish MID$("RWBGYO", j, 1), 1, 2
- END IF
- NEXT
- NEXT
-
- ' set out area for status of Corner Pieces
- DIM Corners(8, 7)
- ' P, y --> sequential number of piece (domino-style)
- ' x, 1 --> lowest colour number (1=Red, etc)
- ' x, 2 --> higher colour number
- ' x, 3 --> highest colour
- ' x, 4 --> face for lowest colour
- ' x, 5 --> face for higher colour
- ' x, 6 --> face for highest colour
- ' x, 7 --> status: 0 = wrong place
- ' 1 = correct place
- ' 2 = correct alignment
- ix = 0
- FOR i = 1 TO 4
- FOR j = i + 1 TO 5
- FOR k = j + 1 TO 6
- IF j - i <> 3 THEN 'insure against opposite sides
- IF k - i <> 3 THEN
- IF k - j <> 3 THEN
- ix = ix + 1
- Corners(ix, 1) = i
- Corners(ix, 2) = j
- Corners(ix, 3) = k
- Corners(ix, 4) = i
- Corners(ix, 5) = j
- Corners(ix, 6) = k
- jx = 337 + 16 * ix
- LINE (488, jx)-STEP(13, 13), 0, B
- PAINT (489, jx + 1), ColourTable(i), 0
- LINE (501, jx)-STEP(13, 13), 0, B
- PAINT (502, jx + 1), ColourTable(j), 0
- LINE (514, jx)-STEP(13, 13), 0, B
- PAINT (515, jx + 1), ColourTable(k), 0
- Fg = 0: zsLocateGCursor 464, jx + 4
- ziPublish MID$("RWBGYO", i, 1), 1, 2
- ziPublish MID$("RWBGYO", j, 1), 1, 2
- ziPublish MID$("RWBGYO", k, 1), 1, 2
- END IF
- END IF
- END IF
- NEXT
- NEXT
- NEXT
- FOR i = 1 TO 6
- FOR j = 1 TO 9
- VCube(i, j) = i
- NEXT
- NEXT
-
- ' pre-recorded games
-
- DIM Setup(9, 25)
-
- DATA 2,4,6,3,1, 4,6,5,3,3, 5,2,5,6,1, 6,2,4,3,3, 6,6,6,3,4
- DATA 4,2,5,6,6, 4,5,5,5,3, 2,1,4,4,3, 5,1,6,6,1, 1,5,1,4,2
- DATA 1,5,1,6,1, 2,1,1,5,6, 3,2,2,1,4, 5,6,1,2,5, 5,6,2,5,5
- DATA 2,5,6,3,3, 2,4,5,2,5, 1,4,1,5,2, 6,5,1,2,2, 3,1,6,2,5
- DATA 4,5,2,2,1, 1,2,1,6,5, 4,6,4,6,6, 1,1,6,5,6, 3,6,2,2,4
- DATA 2,3,3,2,6, 5,1,1,5,6, 4,1,6,5,1, 4,4,3,3,2, 5,5,5,6,5
- DATA 3,2,4,1,6, 5,3,3,5,2, 6,6,6,2,6, 1,1,2,1,2, 6,3,4,6,2
- DATA 6,1,4,5,5, 2,2,1,5,2, 6,4,2,5,2, 4,6,2,5,4, 3,6,4,3,6
- DATA 6,4,4,6,4, 2,3,2,2,6, 4,3,6,4,3, 1,1,1,5,5, 3,2,1,1,5
- DATA 2,3,3,4,2, 2,5,1,2,1, 2,3,4,5,4, 4,3,1,2,3, 6,5,6,3,3
-
- FOR i = 0 TO 9
- FOR j = 1 TO 5
- jx = 5 * j - 5
- FOR k = 1 TO 5
- READ Setup(i, jx + k)
- NEXT
- NEXT
- NEXT
-
- DIM Macros(10, 10)
-
-
- '+-------------------------------------------------------------------+
- '▌ ACTUAL PROGRAM ▌
- '▌ ============== ▌
- '+-------------------------------------------------------------------+
- Responses$ = "YN"
- PerSecond! = 4
- DO
- FOR i = 1 TO 6
- FOR j = 1 TO 9
- Hue = ColourTable(VCube(i, j))
- PAINT (Face(i, j, 1), Face(i, j, 2)), Hue, 0
- NEXT
- NEXT
-
- GOSUB Establish
-
-
- ' get a keystroke
-
- RevFlag = 0
- GOSUB GetKey
- SELECT CASE lenx
- CASE 1
- NoGait = 1
- CommStr$ = UCASE$(x$)
- IF INSTR("THBLMRFVA", CommStr$) THEN GOSUB Interpret
- CommStr$ = CHR$(ASC(x$) + ASC("A") - 1) + "'"
- IF INSTR("THBLMRFVA", LEFT$(CommStr$, 1)) THEN GOSUB Interpret
- NoGait = 0
- SELECT CASE UCASE$(x$)
-
- CASE "X" 'preset puzzles
- Msg$ = "Select Game"
- Responses$ = "1234567890" + CHR$(27)
- GOSUB SetYorNMsg
- IF ASC(x$) <> 27 THEN
- FOR i = 1 TO 6
- FOR j = 1 TO 9
- VCube(i, j) = i
- NEXT
- NEXT
- i = VAL(x$)
- FOR j = 1 TO 25
- VFaceNum = Setup(i, j)
- GOSUB Rotate
- NEXT
- END IF
-
- CASE "Z" 'clear count
- OpCount = -1: OpCode$ = "": GOSUB ShowOpCode
-
- CASE CHR$(9) 'Tab -- SOLVE
- AutoSw = 1
-
- '+-------------------------------------------------------------------+
- '▌ PHASE 0: ORIENT CUBE SO THAT WHITE IS ON TOP ▌
- '+-------------------------------------------------------------------+
- OpCount = -1: OpCode$ = "": GOSUB ShowOpCode
- Tally1 = 0
-
- DO
- IF VCube(2, 5) = 2 THEN EXIT DO
- Tally1 = Tally1 + 1
- HorizontalSwitch = 2
- IF Tally1 = 4 THEN
- HorizontalSwitch = 1
- END IF
- GOSUB OrientTurn: GOSUB Establish: GOSUB Gait
- LOOP
- RevFlag = 0
- AutoSw = 0: CommStr$ = "": GOSUB Establish: AutoSw = 1
-
- '+-------------------------------------------------------------------+
- '▌ PHASE 1: TOP EDGES ▌
- '+-------------------------------------------------------------------+
- DO
- IF VCube(2, 2) = 2 THEN
- IF VCube(2, 4) = 2 THEN
- IF VCube(2, 6) = 2 THEN
- IF VCube(2, 8) = 2 THEN
- IF VCube(3, 4) = VCube(3, 5) THEN
- IF VCube(1, 2) = VCube(1, 5) THEN
- IF VCube(6, 8) = VCube(6, 5) THEN
- IF VCube(4, 6) = VCube(4, 5) THEN
- EXIT DO
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
-
- ' 1.A: move white edges to bottom surface
-
- DO
-
- ' (i) move white edge from top surface to bottom surface
- DO
- IF VCube(2, 2) <> 2 THEN EXIT DO
- GOSUB ClearBottom
- CommStr$ = "FF": GOSUB Interpret
- LOOP
-
- ' (ii) move white edge from left surface to bottom surface
- DO
- IF VCube(4, 8) <> 2 THEN EXIT DO
- GOSUB ClearBottom
- CommStr$ = "F'": GOSUB Interpret
- LOOP
-
- ' (iii) move white edge from right surface to bottom surface
- DO
- IF VCube(1, 4) <> 2 THEN EXIT DO
- GOSUB ClearBottom
- CommStr$ = "F'": GOSUB Interpret
- LOOP
-
- '(iv) move white edge from left to bottom surface
- DO
- IF VCube(3, 8) <> 2 THEN EXIT DO
- GOSUB ClearBottom
- CommStr$ = "B'L'": GOSUB Interpret
- LOOP
-
- '(v) move white edge from top to right
- DO
- IF VCube(3, 4) <> 2 THEN EXIT DO
- GOSUB ClearBottom
- CommStr$ = "F": GOSUB Interpret
- LOOP
-
- '(vi) move white edge from bottom to right
- DO
- IF VCube(3, 6) <> 2 THEN EXIT DO
- CommStr$ = "F'": GOSUB Interpret
- LOOP
-
- '(vii) move white edge from right to bottom surface
- DO
- IF VCube(3, 2) <> 2 THEN EXIT DO
- GOSUB ClearBottom
- CommStr$ = "BR'": GOSUB Interpret
- LOOP
-
- IF VCube(2, 2) <> 2 THEN
- IF VCube(4, 8) <> 2 THEN
- IF VCube(1, 4) <> 2 THEN
- IF VCube(3, 8) <> 2 THEN
- IF VCube(3, 4) <> 2 THEN
- IF VCube(3, 6) <> 2 THEN
- IF VCube(3, 2) <> 2 THEN
- EXIT DO
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
-
- LOOP
-
- ' when we get here, the face has been 'exhausted'
-
- IF VCube(5, 2) = 2 THEN
- IF VCube(5, 4) = 2 THEN
- IF VCube(5, 6) = 2 THEN
- IF VCube(5, 8) = 2 THEN
- EXIT DO
- END IF
- END IF
- END IF
- END IF
- CommStr$ = ">": GOSUB Interpret
-
- LOOP
- AutoSw = 0: CommStr$ = "": GOSUB Establish: AutoSw = 1
-
- ' when we get here, all the white edge faces are on the bottom
-
- ' 1.B: move white edges to correct place in top surface
-
- DO
- DO
- IF VCube(3, 6) <> VCube(3, 5) THEN EXIT DO
- IF VCube(5, 6) <> 2 THEN EXIT DO
- CommStr$ = "FF>": GOSUB Interpret
- LOOP
-
- IF VCube(2, 2) = 2 THEN
- IF VCube(2, 4) = 2 THEN
- IF VCube(2, 6) = 2 THEN
- IF VCube(2, 8) = 2 THEN
- EXIT DO
- END IF
- END IF
- END IF
- END IF
- CommStr$ = "B": GOSUB Interpret
-
- LOOP
- AutoSw = 0: CommStr$ = "": GOSUB Establish: AutoSw = 1
-
- '+-------------------------------------------------------------------+
- '▌ PHASE 2: TOP CORNERS ▌
- '+-------------------------------------------------------------------+
-
- DO
- ' retire when everything is correct
-
- IF VCube(2, 1) = 2 THEN
- IF VCube(2, 3) = 2 THEN
- IF VCube(2, 7) = 2 THEN
- IF VCube(2, 9) = 2 THEN
- IF VCube(3, 1) = VCube(3, 5) THEN
- IF VCube(3, 7) = VCube(3, 5) THEN
- IF VCube(6, 9) = VCube(6, 5) THEN
- IF VCube(6, 7) = VCube(6, 5) THEN
- EXIT DO
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
-
- DO
- ' continue when top front right (123) is already in place
- IF VCube(2, 1) = 2 THEN
- IF VCube(3, 1) = VCube(3, 5) THEN
- EXIT DO
- END IF
- END IF
- ' find the corner that goes in top front right
- i = VCube(1, 5): j = VCube(2, 5): k = VCube(3, 5)
- IF i > j THEN SWAP i, j
- IF i > k THEN SWAP i, k
- IF j > k THEN SWAP j, k
- L = 0
- DO
- L = L + 1
- IF Corners(L, 1) = i THEN
- IF Corners(L, 2) = j THEN
- IF Corners(L, 3) = k THEN
- i = Corners(L, 4)
- j = Corners(L, 5)
- k = Corners(L, 6)
- EXIT DO
- END IF
- END IF
- END IF
- LOOP
- IF j = 2 THEN SWAP i, j
- IF k = 2 THEN SWAP i, k
- IF j = 5 THEN SWAP i, j
- IF k = 5 THEN SWAP i, k
- IF j > k THEN SWAP j, k
- ' now we know the location of the cornerpiece that fits in top front right
- DO
- IF i = 2 THEN
- IF j = 1 THEN
- IF k = 3 THEN
- IF VCube(2, 1) = 2 THEN EXIT DO
- CommStr$ = "FBF'"
- ELSE
- CommStr$ = "AB'A'"
- END IF
- ELSE
- IF j = 3 THEN
- CommStr$ = "F'BFB"
- ELSE
- CommStr$ = "A'BBA"
- END IF
- END IF
- ELSE
- IF j = 1 THEN
- IF k = 3 THEN
- ELSE
- CommStr$ = "B'"
- END IF
- ELSE
- IF j = 3 THEN
- CommStr$ = "B"
- ELSE
- CommStr$ = "BB"
- END IF
- END IF
- END IF
- GOSUB Interpret
- ' now piece at front right bottom (135) is to go to front right top (123)
- IF VCube(1, 7) = 2 THEN
- CommStr$ = "R'B'R"
- ELSE
- IF VCube(3, 3) = 2 THEN
- CommStr$ = "FBF'"
- ELSE
- CommStr$ = "FBBF'B'FBF'"
- END IF
- END IF
- GOSUB Interpret
- EXIT DO
- LOOP
-
- ' now the piece 123 is correct
-
- EXIT DO
- LOOP
-
-
- IF VCube(2, 1) = 2 THEN
- IF VCube(2, 3) = 2 THEN
- IF VCube(2, 7) = 2 THEN
- IF VCube(2, 9) = 2 THEN
- IF VCube(3, 1) = VCube(3, 5) THEN
- IF VCube(3, 7) = VCube(3, 5) THEN
- IF VCube(6, 9) = VCube(6, 5) THEN
- IF VCube(6, 7) = VCube(6, 5) THEN
- EXIT DO
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- CommStr$ = ">": GOSUB Interpret
-
- LOOP
- AutoSw = 0: CommStr$ = "": GOSUB Establish: AutoSw = 1
-
-
- '+-------------------------------------------------------------------+
- '▌ PHASE 3: MIDDLE EDGES ▌
- '+-------------------------------------------------------------------+
-
- DO
- ' retire when all is well
- IF VCube(1, 4) = VCube(1, 5) THEN
- IF VCube(1, 6) = VCube(1, 5) THEN
- IF VCube(3, 2) = VCube(3, 5) THEN
- IF VCube(3, 8) = VCube(3, 5) THEN
- IF VCube(4, 2) = VCube(4, 5) THEN
- IF VCube(4, 8) = VCube(4, 5) THEN
- IF VCube(6, 4) = VCube(6, 5) THEN
- IF VCube(6, 6) = VCube(6, 5) THEN
- EXIT DO
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
- END IF
-
- ' get a candidate edge into the front face
-
- TallyTurn = 0
- DO
- IF VCube(3, 6) <> 5 THEN
- IF VCube(5, 6) <> 5 THEN
- TallyTurn = 0
- EXIT DO
- END IF
- END IF
- TallyTurn = TallyTurn + 1
- IF TallyTurn > 4 THEN
- ' if we get here, at least one piece is 'embedded'
- TallyTurn = 0
- DO
- IF VCube(3, 2) <> VCube(3, 5) THEN EXIT DO
- IF VCube(1, 4) <> VCube(1, 5) THEN EXIT DO
- CommStr$ = ">": GOSUB Interpret
- LOOP
- CommStr$ = "M'B'R'BMB'RB": GOSUB Interpret
- ELSE
- CommStr$ = ">": GOSUB Interpret
- END IF
- LOOP
-
- ' here is a candidate
-
- DO
- IF VCube(5, 6) = VCube(3, 5) THEN EXIT DO
- CommStr$ = "B<": GOSUB Interpret
- LOOP
- IF VCube(3, 6) = VCube(4, 5) THEN
- CommStr$ = "BBM'BL'B'MBL"
- ELSE
- CommStr$ = "BBM'B'R'BMB'R"
- END IF
- GOSUB Interpret
-
- LOOP
- AutoSw = 0: CommStr$ = "": GOSUB Establish: AutoSw = 1
-
- '+-------------------------------------------------------------------+
- '▌ PHASE 4: BOTTOM CORNERS ▌
- '+-------------------------------------------------------------------+
-
- ' (i) position the corners relative to each other
-
- DO
- DO
-
- ' Cnrx(1) details the content of FLB (345)
- ' Cnrx(2) details the content of FRB (315)
- ' Cnrx(3) details the content of ARB (615)
- ' Cnrx(4) details the content of ALB (645)
-
- ' value 1 is Red: 2 is Blue: 4 is Green: 8 is Orange
- ' the expected (cyclic) order is:
- ' 6 (G + B); 3 (B + R); 9 (R + O); 12 (O + G)
-
- x$ = "RWBGYO": y$ = "RBxGxxxO"
- Cnrx(1) = INSTR(y$, MID$(x$, VCube(3, 9), 1))
- Cnrx(1) = Cnrx(1) + INSTR(y$, MID$(x$, VCube(4, 7), 1))
- Cnrx(1) = Cnrx(1) + INSTR(y$, MID$(x$, VCube(5, 3), 1))
-
- Cnrx(2) = INSTR(y$, MID$(x$, VCube(1, 7), 1))
- Cnrx(2) = Cnrx(2) + INSTR(y$, MID$(x$, VCube(3, 3), 1))
- Cnrx(2) = Cnrx(2) + INSTR(y$, MID$(x$, VCube(5, 9), 1))
-
- Cnrx(3) = INSTR(y$, MID$(x$, VCube(1, 9), 1))
- Cnrx(3) = Cnrx(3) + INSTR(y$, MID$(x$, VCube(5, 7), 1))
- Cnrx(3) = Cnrx(3) + INSTR(y$, MID$(x$, VCube(6, 3), 1))
-
- Cnrx(4) = INSTR(y$, MID$(x$, VCube(4, 1), 1))
- Cnrx(4) = Cnrx(4) + INSTR(y$, MID$(x$, VCube(5, 1), 1))
- Cnrx(4) = Cnrx(4) + INSTR(y$, MID$(x$, VCube(6, 1), 1))
-
- i = 0: j = 5
- DO
- i = i + 1
- IF Cnrx(i) = 6 THEN EXIT DO
- LOOP
- i = i MOD 4 + 1
- DO
- Cnrx(j) = Cnrx(i)
- i = i MOD 4 + 1
- j = j + 1
- IF j = 8 THEN EXIT DO
- LOOP
- ' now Cnrx(5 to 7) has the second, third and fourth in order
-
- ' find a pair of correctly placed corners (with respect to each other)
- SELECT CASE Cnrx(5)
- CASE 3
- IF Cnrx(6) = 9 THEN EXIT DO 'no change necessary
- Cnrx(0) = 9
- CASE 9
- IF Cnrx(6) = 3 THEN
- Cnrx(0) = 6
- ELSE
- Cnrx(0) = 3
- END IF
- CASE ELSE
- IF Cnrx(6) = 3 THEN
- Cnrx(0) = 12
- ELSE
- Cnrx(0) = Cnrx(1)
- END IF
- END SELECT
- i = 0
- DO
- i = i + 1
- IF Cnrx(i) = Cnrx(0) THEN EXIT DO
- LOOP
-
- ' re-orient cube so that two contiguous corners can be swapped
- SELECT CASE i
- CASE 1
- CommStr$ = ""
- CASE 2
- CommStr$ = "<"
- CASE 3
- CommStr$ = ">>"
- CASE 4
- CommStr$ = ">"
- END SELECT
-
- ' swap contiguous corners and try again
- CommStr$ = CommStr$ + "R'BL'B'RBL"
- GOSUB Interpret
-
- LOOP
-
- ' turn the base until corners are in right place
-
- SELECT CASE Cnrx(1)
- CASE 3
- IF VCube(3, 5) = 1 THEN EXIT DO
- CASE 6
- IF VCube(1, 5) = 1 THEN EXIT DO
- CASE 9
- IF VCube(4, 5) = 1 THEN EXIT DO
- CASE 12
- IF VCube(6, 5) = 1 THEN EXIT DO
- END SELECT
-
- CommStr$ = "B": GOSUB Interpret
-
- LOOP
- AutoSw = 0: CommStr$ = "": GOSUB Establish: AutoSw = 1
-
-
- ' (ii) re-orient the corners as required
-
- DO
-
- ' determine which are set correctly
- IF VCube(5, 3) = 5 THEN
- BottomCorners = 0
- ELSE
- BottomCorners = 1
- END IF
- IF VCube(5, 9) <> 5 THEN
- BottomCorners = BottomCorners + 2
- END IF
- IF VCube(5, 7) <> 5 THEN
- BottomCorners = BottomCorners + 4
- END IF
- IF VCube(5, 1) <> 5 THEN
- BottomCorners = BottomCorners + 8
- END IF
-
- ' swap corners that are in wrong sequence
-
- SELECT CASE BottomCorners
- CASE 0
- EXIT DO
- CASE 2, 10, 14, 15
- CommStr$ = "R'B'RB'R'BBRBB"
- CASE 3
- CommStr$ = "R'B'RB'R'BBRBBL'BLBL'BBLBB"
- CASE ELSE
- CommStr$ = ">"
- END SELECT
-
- GOSUB Interpret
-
- LOOP
-
- AutoSw = 0: CommStr$ = "": GOSUB Establish: AutoSw = 1
-
-
- '+-------------------------------------------------------------------+
- '▌ PHASE 5: BOTTOM EDGES ▌
- '+-------------------------------------------------------------------+
-
- ' (i) ensure that edges are in the right place
-
- DO
- IF VCube(3, 6) + VCube(5, 6) - 5 = VCube(3, 5) THEN
- EdgeSum = VCube(3, 5)
- ELSE
- EdgeSum = 0
- END IF
- IF VCube(1, 8) + VCube(5, 8) - 5 = VCube(1, 5) THEN
- EdgeSum = EdgeSum + VCube(1, 5)
- END IF
- IF VCube(6, 2) + VCube(5, 4) - 5 = VCube(6, 5) THEN
- EdgeSum = EdgeSum + VCube(6, 5)
- END IF
- IF VCube(4, 4) + VCube(5, 2) - 5 = VCube(4, 5) THEN
- EdgeSum = EdgeSum + VCube(4, 5)
- END IF
-
- IF EdgeSum = 14 THEN EXIT DO 'all correct
-
- CommStr$ = ""
- DO
- SELECT CASE EdgeSum
- CASE 0, VCube(3, 5)'front face correct
- EXIT DO
- CASE ELSE
- CommStr$ = ">"'rotate until found
- GOSUB Interpret
- END SELECT
- LOOP
- CommStr$ = "M'B'MBBM'B'M"
- GOSUB Interpret
-
- LOOP
- AutoSw = 0: CommStr$ = "": GOSUB Establish: AutoSw = 1
-
- ' (ii) re-align the edges
-
- DO
- IF VCube(5, 6) = 5 THEN
- EdgeSum = 0
- ELSE
- EdgeSum = 3
- END IF
- IF VCube(5, 8) <> 5 THEN EdgeSum = EdgeSum + 1
- IF VCube(5, 4) <> 5 THEN EdgeSum = EdgeSum + 6
- IF VCube(5, 2) <> 5 THEN EdgeSum = EdgeSum + 4
-
- ' now EdgeSum is the sum of faces that need turning
-
- SELECT CASE EdgeSum
- CASE 0
- EXIT DO
- CASE 5, 9, 10, 14
- CommStr$ = "M'BMBM'BBMBBM'BMBM'BBMBB"
- CASE ELSE
- CommStr$ = ">"
- END SELECT
-
- GOSUB Interpret
-
- LOOP
- AutoSw = 0: CommStr$ = "": GOSUB Establish
-
- ' turn off the Auto-switch
- LINE (294, 200)-STEP(48, 11), 15, BF
-
- END SELECT
- '+-------------------------------------------------------------------+
- '▌ THE CUBE SHOULD NOW BE COMPLETELY RESTORED! PHEW!!! ▌
- '+-------------------------------------------------------------------+
-
-
-
-
- '+-------------------------------------------------------------------+
- '▌ THESE ARE MACROS USABLE IN MANUAL SOLUTION ▌
- '+-------------------------------------------------------------------+
-
- CASE 2
- ' for functions, turn on the MACRO switch
- IF ASC(x$) > 58 THEN
- IF ASC(x$) < 69 THEN
- MacroSw = 1
- END IF
- END IF
-
- SELECT CASE x$
-
- ' Phase 2: White on BFR on Right, under its destination
- CASE CHR$(59) 'F1
- CommStr$ = "R'B'R": GOSUB Interpret
-
- ' Phase 2: White on BFR on Front, under its destination
- CASE CHR$(60) 'F2
- CommStr$ = "FBF'": GOSUB Interpret
-
- ' Phase 2: White on BFR on Bottom, under its destination
- CASE CHR$(61) 'F3
- CommStr$ = "FBBF'B'FBF'": GOSUB Interpret
-
- ' Phase 3: Two colours on Front Bottom to go on Front Left
- CASE CHR$(62) 'F4
- CommStr$ = "BBM'BL'B'MBL": GOSUB Interpret
-
- ' Phase 3: Two colours on Front Bottom to go on Front Right
- CASE CHR$(63) 'F5
- CommStr$ = "BBM'B'R'BMB'R": GOSUB Interpret
-
- ' Phase 4: Swap BFL and BAL
- CASE CHR$(64) 'F6
- CommStr$ = "R'BL'B'RBL": GOSUB Interpret
-
- ' Phase 4: Reorient BLF, BRF, BLA, BRA on right
- CASE CHR$(65) 'F7
- CommStr$ = "R'B'RB'R'BBRBB": GOSUB Interpret
-
- ' Phase 4: Reorient BLF, BRF, BLA, BRA on left
- CASE CHR$(66) 'F8
- CommStr$ = "L'BLBL'BBLBB": GOSUB Interpret
-
- ' Phase 5: Swap BL, BR, BA
- CASE CHR$(67) 'F9
- CommStr$ = "M'B'MBBM'B'M": GOSUB Interpret
-
-
- ' Phase 5: Reorient BL, BA
- CASE CHR$(68) 'F10
-
- CommStr$ = "M'BMBM'BBMBBM'BMBM'BBMBB": GOSUB Interpret
-
- CASE "G" 'HOME (=reset)
-
- Msg$ = "RESET": GOSUB SetYorNMsg
- IF x$ = "Y" THEN
- FOR i = 1 TO 6
- k = VCube(i, 5)
- FOR j = 1 TO 4
- VCube(i, j) = k
- VCube(i, j + 5) = k
- NEXT
- NEXT
- LINE (283, 141)-STEP(73, 73), 11, BF
- OpCount = 0
- END IF
- x$ = ""
-
- CASE "S" 'DEL (=scramble)
-
- Msg$ = "SCRAMBLE": GOSUB SetYorNMsg
- IF x$ = "Y" THEN
- Scramble = 25
- DO
- VFaceNum = INT(6 * RND) + 1
- GOSUB Rotate
- Scramble = Scramble - 1
- LOOP UNTIL Scramble = 0
- LINE (283, 141)-STEP(73, 73), 11, BF
- OpCount = 0
- END IF
- x$ = ""
-
- CASE "K" 'LEFT ARROW
- HorizontalSwitch = 1
- GOSUB OrientTurn3
-
- CASE "M" 'RIGHT ARROW
- HorizontalSwitch = 1
- GOSUB OrientTurn
-
- CASE "H" 'UP ARROW
- HorizontalSwitch = 2
- GOSUB OrientTurn
-
- CASE "P" 'DOWN ARROW
- HorizontalSwitch = 2
- GOSUB OrientTurn3
-
- END SELECT
- END SELECT
- ' turn off the MACRO switch
- IF MacroSw <> 0 THEN
- MacroSw = 0
- LINE (290, 200)-STEP(56, 11), 15, BF
- END IF
-
- LOOP
-
- SYSTEM
-
- '+-------------------------------------------------------------------+
- '▌ SUBROUTINES ▌
- '▌ =========== ▌
- '+-------------------------------------------------------------------+
- '▌ Establish ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- Establish:
-
- ' find the centres
-
- Fg = 4: Bg = 10
- FOR ix = 1 TO 6
- jx = VCube(ix, 5)
- Centres(jx) = ix
- IF AutoSw + MacroSw = 0 THEN
- zsLocateGCursor 60, 353 + 16 * jx
- ziPublish LTRIM$(STR$(ix)), 2, 0
- END IF
- NEXT
-
- ' find the edges
-
- FOR ix = 1 TO 6
- FOR jx = 1 TO 4
- kx = VCube(ix, jx + jx) 'first colour
- lx = VAL(MID$("1423", jx, 1)) '(direction:N-E-S-W)
- mx = Neighbours(lx, ix) '(neighbouring face)
- nx = Neighbours(lx, 8) 'middle border square
- px = VCube(mx, nx)'its colour
- IF kx < px THEN 'look only in sequence
- ox = 0
- DO
- ox = ox + 1
- IF Edges(ox, 1) = kx THEN
- IF Edges(ox, 2) = px THEN
- EXIT DO 'found match!
- END IF
- END IF
- LOOP
- Edges(ox, 3) = ix 'report new location of piece
- Edges(ox, 4) = mx
- Edges(ox, 5) = 0
-
- ' report whether the edge pieces are in position
- IF VCube(ix, 5) = kx THEN
- IF VCube(mx, 5) = px THEN
- Edges(ox, 5) = 2
- END IF
- ELSE
- IF VCube(ix, 5) = px THEN
- IF VCube(mx, 5) = kx THEN
- Edges(ox, 5) = 1
- END IF
- END IF
- END IF
- END IF
- NEXT
- NEXT
- IF AutoSw + MacroSw = 0 THEN
- FOR ix = 1 TO 12
- jx = 353 + 16 * ((ix - 1) MOD 6 + 1)
- kx = 184 + 139 * ((ix - 1) \ 6)
- Fg = 4: Bg = 10
- zsLocateGCursor kx + 32, jx
- ziPublish LTRIM$(STR$(Edges(ix, 3))), 2, 0
- ziPublish LTRIM$(STR$(Edges(ix, 4))), 2, 0
- Fg = 1
- ziPublish MID$(" +*", Edges(ix, 5) + 1, 1), 2, 0
- NEXT
- END IF
-
- ' find the corner pieces
-
- FOR ix = 1 TO 4 STEP 3
- FOR jx = 1 TO 4 'direction of corner
- kx = VAL(MID$("1397", jx, 1)) 'cell number
- lx = VCube(ix, kx)' cell's colour
- mx = Neighbours(jx, ix)'adjoining side
- nx = Neighbours(jx, 7)' cell location on adjoining side
- ox = VCube(mx, nx)' its colour
- px = VAL(MID$("4123", jx, 1))'other direction of corner
- qx = Neighbours(px, ix)' other adjoinging side
- rx = Neighbours(px, 9)' cell location on that side
- sx = VCube(qx, rx)'its colour
- tx = ix ' avoid modifying an element used in FOR/NEXT
- ' reorganise the colours into sequence
- IF lx > ox THEN SWAP lx, ox: SWAP kx, nx: SWAP tx, mx
- IF ox > sx THEN SWAP ox, sx: SWAP nx, rx: SWAP mx, qx
- IF lx > ox THEN SWAP lx, ox: SWAP kx, nx: SWAP tx, mx
- ' find the record of this piece and publish it
- ux = 0
- DO
- ux = ux + 1
- IF Corners(ux, 1) = lx THEN
- IF Corners(ux, 2) = ox THEN
- IF Corners(ux, 3) = sx THEN
- EXIT DO
- END IF
- END IF
- END IF
- LOOP
- Corners(ux, 4) = tx
- Corners(ux, 5) = mx
- Corners(ux, 6) = qx
- x$ = ""
- FOR vx = 1 TO 3
- x$ = x$ + LTRIM$(STR$(Centres(Corners(ux, vx))))
- NEXT
- Corners(ux, 7) = 0
- ' see if the piece is in the correct corner
- IF INSTR(x$, LTRIM$(STR$(tx))) > 0 THEN
- IF INSTR(x$, LTRIM$(STR$(mx))) > 0 THEN
- IF INSTR(x$, LTRIM$(STR$(qx))) > 0 THEN
- Corners(ux, 7) = 1
- ' see if the piece has the correct orientation as well
- IF INSTR(x$, LTRIM$(STR$(tx))) = 1 THEN '(only need to match two sides!)
- IF INSTR(x$, LTRIM$(STR$(mx))) = 2 THEN
- Corners(ux, 7) = 2
- END IF
- END IF
- END IF
- END IF
- END IF
- IF AutoSw + MacroSw = 0 THEN
- vx = 337 + 16 * ux
- Fg = 4: Bg = 10
- zsLocateGCursor 536, vx
- Fg = 4: ziPublish LTRIM$(STR$(tx * 100 + mx * 10 + qx)), 2, 0
- Fg = 1: ziPublish MID$(" +*", Corners(ux, 7) + 1, 1), 2, 0
- END IF
- NEXT
- NEXT
-
- RETURN
-
- '+-------------------------------------------------------------------+
- '▌ ClearBottom ▌
- '▌ ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- ClearBottom:
-
- DO
- IF VCube(5, 6) <> 2 THEN EXIT DO
- CommStr$ = "B": GOSUB Interpret
- LOOP
-
- RETURN
-
- '+-------------------------------------------------------------------+
- '▌ Gait ▌
- '▌ ▌
- '▌ i/p: PerSecond! (default = 4) ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- Gait:
-
- IF NoGait = 1 THEN
- NoGait = 0
- RETURN
- END IF
- StopClock! = TIMER + 1 / PerSecond!
- DO
- Trial! = TIMER
- LOOP UNTIL Trial! > StopClock!
- FOR i = 1 TO 6
- FOR j = 1 TO 9
- Hue = ColourTable(VCube(i, j))
- PAINT (Face(i, j, 1), Face(i, j, 2)), Hue, 0
- NEXT
- NEXT
- PerSecond! = 4
-
- RETURN
-
- '+-------------------------------------------------------------------+
- '▌ Interpret ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- Interpret:
-
- DO
- IF LEN(CommStr$) = 0 THEN EXIT DO
- x$ = LEFT$(CommStr$, 1)
- OpCode$ = x$
- IF MID$(CommStr$, 2, 1) = "'" THEN
- OpCode$ = x$ + "'"
- RevFlag = 1
- CommStr$ = MID$(CommStr$, 3)
- ELSE
- RevFlag = 0
- CommStr$ = MID$(CommStr$, 2)
- END IF
- GOSUB ShowOpCode
-
- SELECT CASE x$
- CASE "T"
- VFaceNum = 2: GOSUB R3orR
- CASE "H"
- VFaceNum = 2: GOSUB RorR3
- VFaceNum = 5: GOSUB R3orR
- HorizontalSwitch = 1: GOSUB OorO3
- CASE "B"
- VFaceNum = 5: GOSUB RorR3
- CASE "L"
- VFaceNum = 4: GOSUB R3orR
- CASE "M"
- VFaceNum = 4: GOSUB RorR3
- VFaceNum = 1: GOSUB R3orR
- HorizontalSwitch = 2: GOSUB OorO3
- CASE "R"
- VFaceNum = 1: GOSUB RorR3
- CASE "F"
- VFaceNum = 3: GOSUB RorR3
- CASE "V"
- VFaceNum = 3: GOSUB R3orR
- VFaceNum = 6: GOSUB RorR3
- HorizontalSwitch = 2: GOSUB OorO3
- HorizontalSwitch = 1: GOSUB OrientTurn3
- HorizontalSwitch = 2: GOSUB O3orO
- CASE "A"
- VFaceNum = 6: GOSUB R3orR
- CASE "<"
- HorizontalSwitch = 1
- GOSUB OrientTurn3: GOSUB Establish
- CASE ">"
- HorizontalSwitch = 1
- GOSUB OrientTurn: GOSUB Establish
- END SELECT
- RevFlag = 0
- GOSUB Gait
-
- LOOP UNTIL LEN(CommStr$) = 0
-
- GOSUB ShowOpCode
- RETURN
-
- OorO3:
- IF RevFlag = 0 THEN GOSUB OrientTurn ELSE GOSUB OrientTurn3
- RETURN
-
- O3orO:
- IF RevFlag = 0 THEN GOSUB OrientTurn3 ELSE GOSUB OrientTurn
- RETURN
-
- RorR3:
- IF RevFlag = 0 THEN GOSUB Rotate ELSE GOSUB Rotate3
- RETURN
-
- R3orR:
- IF RevFlag = 0 THEN GOSUB Rotate3 ELSE GOSUB Rotate
- RETURN
-
- '+-------------------------------------------------------------------+
- '▌ OrientTurn ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- OrientTurn3:
-
- GOSUB OrientTurn
- GOSUB OrientTurn
-
- OrientTurn:
-
- IF HorizontalSwitch = 1 THEN
- FOR ix = 1 TO 19
- Orient(ix) = Horizontal(ix)
- NEXT
- ELSE
- FOR ix = 1 TO 19
- Orient(ix) = Vertical(ix)
- NEXT
- END IF
-
- ix = 1
- Destination = 0
- DO
- Origin = Orient(ix)
- Factor = Orient(ix + 1)
- FOR jx = 1 TO 9
- VCube(Destination, (jx * Factor) MOD 10) = VCube(Origin, jx)
- NEXT
- Destination = Origin
- ix = ix + 2
- LOOP UNTIL Orient(ix) = 999
-
- RETURN
-
- '+-------------------------------------------------------------------+
- '▌ Rotate ▌
- '▌ ▌
- '▌ i/p: VFaceNum (1 to 6) ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- Rotate3:
-
- GOSUB Rotate
- GOSUB Rotate
-
- Rotate:
-
- FOR ix = 1 TO 9
- VCube(0, ix) = VCube(VFaceNum, ix)
- NEXT
- ' move back the cells, rotated clockwise 90 degrees
- FOR ix = 1 TO 9
- VCube(VFaceNum, ix) = VCube(0, (ix * 7) MOD 10)
- NEXT
-
- ' collect bordering cells (on four faces)
- FOR ix = 1 TO 4
- NearbyCell = Neighbours(ix, VFaceNum)
- FOR jx = 7 TO 9
- kx = ix * 3 + jx - 6
- Temp(kx) = VCube(NearbyCell, Neighbours(ix, jx))
- NEXT
- NEXT
-
- ' rotate clockwise 90 degrees
- FOR ix = 1 TO 3
- Temp(ix) = Temp(ix + 12)
- NEXT
-
- ' copy back, having rotated clockwise 90 degrees
- FOR ix = 1 TO 4
- NearbyCell = Neighbours(ix, VFaceNum)
- FOR jx = 7 TO 9
- kx = ix * 3 + jx - 9
- VCube(NearbyCell, Neighbours(ix, jx)) = Temp(kx)
- NEXT
- NEXT
-
- RETURN
- '+-------------------------------------------------------------------+
- '▌ STANDARD SUBROUTINES ▌
- '▌ ======== =========== ▌
- '+-------------------------------------------------------------------+
- '▌ GetKey ▌
- '▌ ▌
- '▌ i/p: x$, lenx ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- GetKey:
-
- DO
- DO: LOOP UNTIL LEN(INKEY$) = 0
- DO: x$ = INKEY$: LOOP UNTIL LEN(x$) > 0
- DO: LOOP UNTIL LEN(INKEY$) = 0
- IF x$ = CHR$(27) THEN
- Msg$ = "QUIT": GOSUB SetYorNMsg
- IF x$ = "Y" THEN
- SYSTEM
- END IF
- x$ = ""
- END IF
- LOOP UNTIL LEN(x$) > 0
- lenx = LEN(x$)
- x$ = RIGHT$(x$, 1)
-
- RETURN
-
- '+-------------------------------------------------------------------+
- '▌ Oblong ▌
- '▌ ▌
- '▌ i/p: Xcorner,Ycorner,Xwidth,Ywidth,Bg,Fg ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- Oblong:
-
- xa = XCorner: xb = YCorner: xc = Xwidth: xd = Ywidth
- LINE (xa - 5, xb - 5)-STEP(xc + 9, xd + 9), Fg, BF
- LINE (xa - 1, xb - 1)-STEP(xc + 1, xd + 1), 15, BF
- ' upper left corner
- LINE (xa - 1, xb - 1)-STEP(1, 1), Fg, BF
- PSET (xa, xb), 15
- LINE (xa - 5, xb - 5)-STEP(4, 4), Bg, BF
- LINE (xa - 4, xb - 4)-STEP(3, 3), Fg, BF
- LINE (xa - 4, xb - 4)-STEP(1, 1), Bg1, BF
- PSET (xa - 3, xb - 3), Fg
- ' upper right corner
- xa = xa + xc - 1
- LINE (xa + 1, xb - 1)-STEP(-1, 1), Fg, BF
- PSET (xa, xb), 15
- LINE (xa + 5, xb - 5)-STEP(-4, 4), Bg, BF
- LINE (xa + 4, xb - 4)-STEP(-3, 3), Fg, BF
- LINE (xa + 4, xb - 4)-STEP(-1, 1), Bg, BF
- PSET (xa + 3, xb - 3), Fg
- ' lower right corner
- xb = xb + xd - 1
- LINE (xa + 1, xb + 1)-STEP(-1, -1), Fg, BF
- PSET (xa, xb), 15
- LINE (xa + 5, xb + 5)-STEP(-4, -4), Bg, BF
- LINE (xa + 4, xb + 4)-STEP(-3, -3), Fg, BF
- LINE (xa + 4, xb + 4)-STEP(-1, -1), Bg, BF
- PSET (xa + 3, xb + 3), Fg
- ' lower left corner
- xa = XCorner
- LINE (xa - 1, xb + 1)-STEP(1, -1), Fg, BF
- PSET (xa, xb), 15
- LINE (xa - 5, xb + 5)-STEP(4, -4), Bg, BF
- LINE (xa - 4, xb + 4)-STEP(3, -3), Fg, BF
- LINE (xa - 4, xb + 4)-STEP(1, -1), Bg, BF
- PSET (xa - 3, xb + 3), Fg
-
- RETURN
-
- '+-------------------------------------------------------------------+
- '▌ SetYorNMsg ▌
- '▌ ▌
- '▌ i/p: Msg$, (Responses$) ▌
- '▌ ▌
- '▌ o/p: x$ as Y or N (or number 0 - 9) ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- SetYorNMsg:
-
- XCorner = Xmax / 2 - 48 - 8 * LEN(Msg$)
- YCorner = Ymax - 160
- Xwidth = 16 * LEN(Msg$) + 16
- ' IF Responses$ = "YN" THEN
- Xwidth = Xwidth + 80
- ' END IF
- Ywidth = 22
- Bg = 11: Fg = 4: GOSUB Oblong
- zsLocateGCursor XCorner + 8, Ymax - 158
- x$ = Msg$
- IF Responses$ = "YN" THEN
- x$ = x$ + "? Y/N"
- ELSE
- x$ = x$ + " 0-9"
- END IF
- Fg = 0: ziPublish x$, 2, 2
- DO
- DO: LOOP UNTIL LEN(INKEY$) = 0
- DO: x$ = UCASE$(INKEY$): LOOP UNTIL LEN(x$) > 0
- DO: LOOP UNTIL LEN(INKEY$) = 0
- LOOP UNTIL INSTR(Responses$, x$) > 0
- LINE (XCorner - 5, YCorner - 5)-STEP(Xwidth + 9, Ywidth + 9), 11, BF
- Bg = 11: Fg = 0: zsLocateGCursor 180, 322: ziPublish "F", 2, 0
- Responses$ = "YN"
-
- RETURN
-
- '+-------------------------------------------------------------------+
- '▌ ShowOpcode ▌
- '▌ ▌
- '▌ i/p: Opcode$, Opcount ▌
- '▌ ▌
- '+-------------------------------------------------------------------+
- ShowOpCode:
-
- IF OpCount < 1 THEN
- FOR ix = 1 TO 3
- LINE (286 - ix, 144 - ix)-STEP(67 + ix + ix, 67 + ix + ix), 1, B
- LINE (287, 145)-STEP(65, 65), 15, BF
- NEXT
- END IF
- LINE (287, 162)-STEP(66, 49), 15, BF
- IF AutoSw = 1 THEN
- LINE (294, 200)-STEP(48, 12), 4, BF
- zsLocateGCursor 302, 202
- Fg = 15: ziPublish "AUTO", 1, 2
- END IF
- IF MacroSw = 1 THEN
- LINE (290, 200)-STEP(56, 12), 4, BF
- zsLocateGCursor 298, 202
- Fg = 15: ziPublish "MACRO", 1, 2
- END IF
- Bg = 15: Fg = 4
-
- ' display count
- IF INSTR("THBLMRFVA", LEFT$(OpCode$, 1)) > 0 THEN
- OpCount = OpCount + 1
- xx$ = LTRIM$(STR$(OpCount))
- zsLocateGCursor 320 - 8 * LEN(xx$), 146
- Bg = 15: Fg = 1: ziPublish xx$, 2, 0
- END IF
-
- ' display the opcode itself
- zsLocateGCursor 304, 168
- Bg = 15: Fg = 4: ziPublish OpCode$, 4, 2
-
- RETURN
-
- '<p>
- '<->
- '++++++++++++++++++++++++
- SUB ziPublish (Printstring$, size, italic)
-
- xx = POINT(0)
- yy = POINT(1)
- IF size THEN
- Scale = size
- ELSE
- Scale = 1
- END IF
-
- LenString = LEN(Printstring$)
-
- ExpScale = 8 * Scale
- limxx = xx + ExpScale * LenString - 1
- limyy = yy + ExpScale - 1
-
- IF italic AND 1 THEN
- limxx = limxx + 4 * Scale
- END IF
-
-
- IF italic AND 2 THEN
- ELSE
- LINE (xx, yy)-(limxx, limyy), Bg, BF
- END IF
-
-
- FOR a = 0 TO LenString - 1
- x = ASC(MID$(Printstring$, a + 1, 1))
- B = xx + ExpScale * a
- FOR y = 0 TO 7
- C = Font(x, y)
- d = y * Scale
- e = yy + d
- IF italic AND 1 THEN
- f = B + 4 * Scale - (d + Scale - 1) \ 2 - 1
- ELSE
- f = B
- END IF
- G = 128
- DO
- IF C AND G THEN
- FOR h = 0 TO Scale - 1
- FOR i = 0 TO Scale - 1
- PSET (f + h, e + i), Fg
- NEXT
- NEXT
- END IF
- f = f + Scale
- G = G \ 2
- LOOP UNTIL G = 0
- NEXT
- NEXT
- CALL zsLocateGCursor(limxx + 1, yy)
-
- END SUB
-
- SUB ziPublishHere (Row, Col, Printstring$, size, italic)
-
- IF Row + Col > 0 THEN
- LOCATE Row, Col
- END IF
- CALL zsAlignGCursor
- CALL ziPublish(Printstring$, size, italic)
- CALL zsAlignTCursor
-
- END SUB
-
- '<p>
- '++++++++++++++++++++++++
- SUB zsAlignGCursor
-
- Row = CSRLIN
- Col = POS(0)
- GXloc = (Col - 1) * ((Xmax + 1) \ Cols)
- GYloc = (Row - 1) * ((((Ymax + 1) \ Rows) * Rows + 1) \ Rows)
- CALL zsLocateGCursor(GXloc, GYloc)
-
- END SUB
-
- '<p>
- '++++++++++++++++++++++++
- SUB zsAlignTCursor
-
- GXloc = POINT(0)
- GYloc = POINT(1)
- a = (Xmax + 1) / Cols
- B = (Ymax + 1) / Rows
- Col = (GXloc + a - 1) \ a + 1
- Row = (GYloc + B - 1) \ B + 1
- LOCATE Row, Col
- CALL zsAlignGCursor
-
- END SUB
-
- '<p>
- '++++++++++++++++++++++++
- SUB zsLocateGCursor (XCoord, YCoord)
-
- GXloc = XCoord
- GYloc = YCoord
- PSET (GXloc, GYloc), POINT(GXloc, GYloc)
-
- END SUB
-
- '<p>
- '++++++++++++++++++++++++
- SUB zsPastel (XCoord, YCoord, Wide, Deep, colour1, colour2)
-
- IF Deep < 2 THEN
- a = Wide / XYratio!
- ELSE
- a = Deep
- END IF
-
- LINE (XCoord, YCoord)-(XCoord + Wide - 1, YCoord + a - 1), colour1, BF
- FOR B = XCoord TO XCoord + Wide - 1 STEP 2
- LINE (B, YCoord)-(B, YCoord + a - 1), colour2, , &H5555
- NEXT
- FOR B = XCoord + 1 TO XCoord + Wide - 1 STEP 2
- LINE (B, YCoord)-(B, YCoord + a - 1), colour2, , &HAAAA
- NEXT
-
- END SUB
-
- '<p>
- '++++++++++++++++++++++++
- SUB zsSetScrnMode (Mode, HiRows, HiCols)
-
- IF Font(1, 1) = 0 THEN
- FOR i = 0 TO 255
- FOR j = 0 TO 7
- Font(i, j) = 0
- NEXT
- NEXT
-
- i = 0
- j = i + 1
- Font(j, 0) = 126: Font(j, 1) = 129: Font(j, 2) = 165: Font(j, 3) = 129
- Font(j, 4) = 189: Font(j, 5) = 153: Font(j, 6) = 129: Font(j, 7) = 126
- j = i + 2
- Font(j, 0) = 126: Font(j, 1) = 255: Font(j, 2) = 219: Font(j, 3) = 255
- Font(j, 4) = 195: Font(j, 5) = 231: Font(j, 6) = 255: Font(j, 7) = 126
- j = i + 3
- Font(j, 0) = 68: Font(j, 1) = 238: Font(j, 2) = 254: Font(j, 3) = 254
- Font(j, 4) = 124: Font(j, 5) = 56: Font(j, 6) = 16
- j = i + 4
- Font(j, 0) = 16: Font(j, 1) = 56: Font(j, 2) = 124: Font(j, 3) = 254
- Font(j, 4) = 124: Font(j, 5) = 56: Font(j, 6) = 16
- j = i + 5
- Font(j, 0) = 24: Font(j, 1) = 60: Font(j, 2) = 219: Font(j, 3) = 255
- Font(j, 4) = 219: Font(j, 5) = 24: Font(j, 6) = 60
- j = i + 6
- Font(j, 0) = 24: Font(j, 1) = 60: Font(j, 2) = 126: Font(j, 3) = 255
- Font(j, 4) = 126: Font(j, 5) = 24: Font(j, 6) = 60
- j = i + 7
- Font(j, 0) = 24: Font(j, 1) = 60: Font(j, 2) = 126: Font(j, 3) = 255
- Font(j, 4) = 126: Font(j, 5) = 24: Font(j, 6) = 60
- j = i + 8
- Font(j, 0) = 255: Font(j, 1) = 255: Font(j, 2) = 195: Font(j, 3) = 195
- Font(j, 4) = 195: Font(j, 5) = 195: Font(j, 6) = 255: Font(j, 7) = 255
-
- i = 10
- j = i + 4
- Font(j, 0) = 63: Font(j, 1) = 99: Font(j, 2) = 127: Font(j, 3) = 99
- Font(j, 4) = 99: Font(j, 5) = 103: Font(j, 6) = 230: Font(j, 7) = 192
- j = i + 5
- Font(j, 0) = 219: Font(j, 1) = 219: Font(j, 2) = 60: Font(j, 3) = 231
- Font(j, 4) = 231: Font(j, 5) = 60: Font(j, 6) = 219: Font(j, 7) = 219
- j = i + 6
- Font(j, 0) = 192: Font(j, 1) = 240: Font(j, 2) = 248: Font(j, 3) = 254
- Font(j, 4) = 248: Font(j, 5) = 240: Font(j, 6) = 192
- j = i + 7
- Font(j, 0) = 6: Font(j, 1) = 30: Font(j, 2) = 62: Font(j, 3) = 254
- Font(j, 4) = 62: Font(j, 5) = 30: Font(j, 6) = 6
- j = i + 8
- Font(j, 0) = 48: Font(j, 1) = 120: Font(j, 2) = 252: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 252: Font(j, 6) = 120: Font(j, 7) = 48
- j = i + 9
- Font(j, 0) = 108: Font(j, 1) = 108: Font(j, 2) = 108: Font(j, 3) = 108
- Font(j, 4) = 108: Font(j, 6) = 108
-
- i = 20: j = i
- Font(j, 0) = 127: Font(j, 1) = 219: Font(j, 2) = 219: Font(j, 3) = 219
- Font(j, 4) = 123: Font(j, 5) = 27: Font(j, 6) = 27
- j = i + 1
- Font(j, 0) = 60: Font(j, 1) = 96: Font(j, 2) = 60: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 60: Font(j, 6) = 6: Font(j, 7) = 60
- j = i + 2
- Font(j, 4) = 254: Font(j, 5) = 254: Font(j, 6) = 254
- j = i + 3
- Font(j, 0) = 24: Font(j, 1) = 60: Font(j, 2) = 126: Font(j, 3) = 24
- Font(j, 4) = 126: Font(j, 5) = 60: Font(j, 6) = 24: Font(j, 7) = 126
- j = i + 4
- Font(j, 0) = 48: Font(j, 1) = 120: Font(j, 2) = 252: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 48
- j = i + 5
- Font(j, 0) = 48: Font(j, 1) = 48: Font(j, 2) = 48: Font(j, 3) = 48
- Font(j, 4) = 252: Font(j, 5) = 120: Font(j, 6) = 48
- j = i + 6
- Font(j, 1) = 8: Font(j, 2) = 12: Font(j, 3) = 254
- Font(j, 4) = 12: Font(j, 5) = 8
- j = i + 7
- Font(j, 1) = 32: Font(j, 2) = 96: Font(j, 3) = 254
- Font(j, 4) = 96: Font(j, 5) = 32
- j = i + 8
- Font(j, 1) = 32: Font(j, 2) = 96: Font(j, 3) = 254
- Font(j, 4) = 96: Font(j, 5) = 32
- j = i + 9
- Font(j, 1) = 32: Font(j, 2) = 96: Font(j, 3) = 254
- Font(j, 4) = 96: Font(j, 5) = 32
-
- i = 30: j = i
- Font(j, 1) = 32: Font(j, 2) = 96: Font(j, 3) = 254
- Font(j, 4) = 96: Font(j, 5) = 32
- j = i + 1
- Font(j, 1) = 32: Font(j, 2) = 96: Font(j, 3) = 254
- Font(j, 4) = 96: Font(j, 5) = 32
- j = i + 3
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 6) = 24
- j = i + 4
- Font(j, 0) = 204: Font(j, 1) = 204: Font(j, 2) = 204
- j = i + 5
- Font(j, 0) = 54: Font(j, 1) = 108: Font(j, 2) = 254: Font(j, 3) = 108
- Font(j, 4) = 254: Font(j, 5) = 108: Font(j, 6) = 216
- j = i + 6
- Font(j, 0) = 24: Font(j, 1) = 126: Font(j, 2) = 192: Font(j, 3) = 124
- Font(j, 4) = 6: Font(j, 5) = 252: Font(j, 6) = 48
- j = i + 7
- Font(j, 0) = 194: Font(j, 1) = 198: Font(j, 2) = 12: Font(j, 3) = 24
- Font(j, 4) = 48: Font(j, 5) = 102: Font(j, 6) = 198
- j = i + 8
- Font(j, 0) = 56: Font(j, 1) = 108: Font(j, 2) = 56: Font(j, 3) = 112
- Font(j, 4) = 222: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 9
- Font(j, 0) = 48: Font(j, 1) = 48: Font(j, 2) = 96
-
- i = 40: j = i
- Font(j, 0) = 12: Font(j, 1) = 24: Font(j, 2) = 48: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 24: Font(j, 6) = 12
- j = i + 1
- Font(j, 0) = 48: Font(j, 1) = 24: Font(j, 2) = 12: Font(j, 3) = 12
- Font(j, 4) = 12: Font(j, 5) = 24: Font(j, 6) = 48
- j = i + 2
- Font(j, 1) = 108: Font(j, 2) = 56: Font(j, 3) = 254
- Font(j, 4) = 56: Font(j, 5) = 108
- j = i + 3
- Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 126
- Font(j, 4) = 24: Font(j, 5) = 24
- j = i + 4
- Font(j, 5) = 24: Font(j, 6) = 24: Font(j, 7) = 48
- j = i + 5
- Font(j, 3) = 126
- j = i + 6
- Font(j, 5) = 24: Font(j, 6) = 24
- j = i + 7
- Font(j, 0) = 2: Font(j, 1) = 6: Font(j, 2) = 12: Font(j, 3) = 24
- Font(j, 4) = 48: Font(j, 5) = 96: Font(j, 6) = 192
- j = i + 8
- Font(j, 0) = 124: Font(j, 1) = 198: Font(j, 2) = 198: Font(j, 3) = 198
- Font(j, 4) = 198: Font(j, 5) = 198: Font(j, 6) = 124
- j = i + 9
- Font(j, 0) = 24: Font(j, 1) = 56: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 24: Font(j, 6) = 126
-
- i = 50: j = i
- Font(j, 0) = 124: Font(j, 1) = 198: Font(j, 2) = 6: Font(j, 3) = 28
- Font(j, 4) = 112: Font(j, 5) = 198: Font(j, 6) = 254
- j = i + 1
- Font(j, 0) = 124: Font(j, 1) = 198: Font(j, 2) = 6: Font(j, 3) = 28
- Font(j, 4) = 6: Font(j, 5) = 198: Font(j, 6) = 124
- j = i + 2
- Font(j, 0) = 28: Font(j, 1) = 60: Font(j, 2) = 108: Font(j, 3) = 204
- Font(j, 4) = 254: Font(j, 5) = 12: Font(j, 6) = 12
- j = i + 3
- Font(j, 0) = 254: Font(j, 1) = 192: Font(j, 2) = 252: Font(j, 3) = 6
- Font(j, 4) = 6: Font(j, 5) = 198: Font(j, 6) = 124
- j = i + 4
- Font(j, 0) = 60: Font(j, 1) = 96: Font(j, 2) = 192: Font(j, 3) = 252
- Font(j, 4) = 198: Font(j, 5) = 198: Font(j, 6) = 124
- j = i + 5
- Font(j, 0) = 254: Font(j, 1) = 198: Font(j, 2) = 12: Font(j, 3) = 24
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 48
- j = i + 6
- Font(j, 0) = 124: Font(j, 1) = 198: Font(j, 2) = 198: Font(j, 3) = 124
- Font(j, 4) = 198: Font(j, 5) = 198: Font(j, 6) = 124
- j = i + 7
- Font(j, 0) = 124: Font(j, 1) = 198: Font(j, 2) = 198: Font(j, 3) = 126
- Font(j, 4) = 6: Font(j, 5) = 12: Font(j, 6) = 120
- j = i + 8
- Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 5) = 24: Font(j, 6) = 24
- j = i + 9
- Font(j, 1) = 24: Font(j, 2) = 24
- Font(j, 5) = 24: Font(j, 6) = 24: Font(j, 7) = 48
-
- i = 60: j = i
- Font(j, 0) = 12: Font(j, 1) = 24: Font(j, 2) = 48: Font(j, 3) = 96
- Font(j, 4) = 48: Font(j, 5) = 24: Font(j, 6) = 12
- j = i + 1
- Font(j, 2) = 126: Font(j, 5) = 126
- j = i + 2
- Font(j, 0) = 48: Font(j, 1) = 24: Font(j, 2) = 12: Font(j, 3) = 6
- Font(j, 4) = 12: Font(j, 5) = 24: Font(j, 6) = 48
- j = i + 3
- Font(j, 0) = 60: Font(j, 1) = 102: Font(j, 2) = 6: Font(j, 3) = 12
- Font(j, 4) = 24: Font(j, 6) = 24
- j = i + 4
- Font(j, 0) = 124: Font(j, 1) = 198: Font(j, 2) = 222: Font(j, 3) = 222
- Font(j, 4) = 222: Font(j, 5) = 192: Font(j, 6) = 124
- j = i + 5
- Font(j, 0) = 56: Font(j, 1) = 108: Font(j, 2) = 198: Font(j, 3) = 198
- Font(j, 4) = 254: Font(j, 5) = 198: Font(j, 6) = 198
- j = i + 6
- Font(j, 0) = 252: Font(j, 1) = 110: Font(j, 2) = 102: Font(j, 3) = 124
- Font(j, 4) = 102: Font(j, 5) = 110: Font(j, 6) = 252
- j = i + 7
- Font(j, 0) = 62: Font(j, 1) = 98: Font(j, 2) = 192: Font(j, 3) = 192
- Font(j, 4) = 192: Font(j, 5) = 98: Font(j, 6) = 62
- j = i + 8
- Font(j, 0) = 248: Font(j, 1) = 108: Font(j, 2) = 102: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 108: Font(j, 6) = 248
- j = i + 9
- Font(j, 0) = 254: Font(j, 1) = 98: Font(j, 2) = 96: Font(j, 3) = 120
- Font(j, 4) = 96: Font(j, 5) = 98: Font(j, 6) = 254
-
- i = 70: j = i
- Font(j, 0) = 254: Font(j, 1) = 98: Font(j, 2) = 96: Font(j, 3) = 120
- Font(j, 4) = 96: Font(j, 5) = 96: Font(j, 6) = 240
- j = i + 1
- Font(j, 0) = 62: Font(j, 1) = 98: Font(j, 2) = 192: Font(j, 3) = 192
- Font(j, 4) = 206: Font(j, 5) = 102: Font(j, 6) = 62
- j = i + 2
- Font(j, 0) = 198: Font(j, 1) = 198: Font(j, 2) = 198: Font(j, 3) = 254
- Font(j, 4) = 198: Font(j, 5) = 198: Font(j, 6) = 198
- j = i + 3
- Font(j, 0) = 60: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 24: Font(j, 6) = 60
- j = i + 4
- Font(j, 0) = 30: Font(j, 1) = 12: Font(j, 2) = 12: Font(j, 3) = 12
- Font(j, 4) = 12: Font(j, 5) = 204: Font(j, 6) = 120
- j = i + 5
- Font(j, 0) = 230: Font(j, 1) = 102: Font(j, 2) = 108: Font(j, 3) = 120
- Font(j, 4) = 120: Font(j, 5) = 108: Font(j, 6) = 230
- j = i + 6
- Font(j, 0) = 240: Font(j, 1) = 96: Font(j, 2) = 96: Font(j, 3) = 96
- Font(j, 4) = 96: Font(j, 5) = 102: Font(j, 6) = 254
- j = i + 7
- Font(j, 0) = 198: Font(j, 1) = 238: Font(j, 2) = 254: Font(j, 3) = 214
- Font(j, 4) = 198: Font(j, 5) = 198: Font(j, 6) = 198
- j = i + 8
- Font(j, 0) = 198: Font(j, 1) = 230: Font(j, 2) = 246: Font(j, 3) = 254
- Font(j, 4) = 222: Font(j, 5) = 206: Font(j, 6) = 198
- j = i + 9
- Font(j, 0) = 124: Font(j, 1) = 198: Font(j, 2) = 198: Font(j, 3) = 198
- Font(j, 4) = 198: Font(j, 5) = 198: Font(j, 6) = 124
-
- i = 80: j = i
- Font(j, 0) = 248: Font(j, 1) = 102: Font(j, 2) = 102: Font(j, 3) = 120
- Font(j, 4) = 96: Font(j, 5) = 96: Font(j, 6) = 240
- j = i + 1
- Font(j, 0) = 124: Font(j, 1) = 198: Font(j, 2) = 198: Font(j, 3) = 214
- Font(j, 4) = 222: Font(j, 5) = 124: Font(j, 6) = 6
- j = i + 2
- Font(j, 0) = 252: Font(j, 1) = 102: Font(j, 2) = 102: Font(j, 3) = 124
- Font(j, 4) = 120: Font(j, 5) = 108: Font(j, 6) = 230
- j = i + 3
- Font(j, 0) = 124: Font(j, 1) = 198: Font(j, 2) = 224: Font(j, 3) = 56
- Font(j, 4) = 14: Font(j, 5) = 198: Font(j, 6) = 124
- j = i + 4
- Font(j, 0) = 126: Font(j, 1) = 90: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 24: Font(j, 6) = 60
- j = i + 5
- Font(j, 0) = 102: Font(j, 1) = 102: Font(j, 2) = 102: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 60
- j = i + 6
- Font(j, 0) = 102: Font(j, 1) = 102: Font(j, 2) = 102: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 60: Font(j, 6) = 24
- j = i + 7
- Font(j, 0) = 198: Font(j, 1) = 198: Font(j, 2) = 198: Font(j, 3) = 214
- Font(j, 4) = 254: Font(j, 5) = 254: Font(j, 6) = 198
- j = i + 8
- Font(j, 0) = 198: Font(j, 1) = 108: Font(j, 2) = 56: Font(j, 3) = 56
- Font(j, 4) = 108: Font(j, 5) = 198: Font(j, 6) = 198
- j = i + 9
- Font(j, 0) = 102: Font(j, 1) = 102: Font(j, 2) = 102: Font(j, 3) = 60
- Font(j, 4) = 24: Font(j, 5) = 24: Font(j, 6) = 60
-
- i = 90: j = i
- Font(j, 0) = 254: Font(j, 1) = 204: Font(j, 2) = 24: Font(j, 3) = 48
- Font(j, 4) = 96: Font(j, 5) = 198: Font(j, 6) = 254
- j = i + 1
- Font(j, 0) = 60: Font(j, 1) = 48: Font(j, 2) = 48: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 60
- j = i + 2
- Font(j, 0) = 128: Font(j, 1) = 192: Font(j, 2) = 96: Font(j, 3) = 48
- Font(j, 4) = 24: Font(j, 5) = 12: Font(j, 6) = 6
- j = i + 3
- Font(j, 0) = 60: Font(j, 1) = 12: Font(j, 2) = 12: Font(j, 3) = 12
- Font(j, 4) = 12: Font(j, 5) = 12: Font(j, 6) = 60
- j = i + 4
- Font(j, 0) = 24: Font(j, 1) = 60: Font(j, 2) = 102
- j = i + 5
- Font(j, 7) = 255
- j = i + 6
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 12
- j = i + 7
- Font(j, 2) = 56: Font(j, 3) = 12
- Font(j, 4) = 124: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 8
- Font(j, 0) = 96: Font(j, 1) = 96: Font(j, 2) = 96: Font(j, 3) = 124
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 124
- j = i + 9
- Font(j, 2) = 124: Font(j, 3) = 196
- Font(j, 4) = 192: Font(j, 5) = 196: Font(j, 6) = 124
-
- i = 100: j = i
- Font(j, 0) = 12: Font(j, 1) = 12: Font(j, 2) = 12: Font(j, 3) = 124
- Font(j, 4) = 204: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 1
- Font(j, 2) = 120: Font(j, 3) = 204
- Font(j, 4) = 252: Font(j, 5) = 192: Font(j, 6) = 124
- j = i + 2
- Font(j, 0) = 56: Font(j, 1) = 108: Font(j, 2) = 96: Font(j, 3) = 248
- Font(j, 4) = 96: Font(j, 5) = 96: Font(j, 6) = 240
- j = i + 3
- Font(j, 2) = 118: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 124: Font(j, 6) = 12: Font(j, 7) = 120
- j = i + 4
- Font(j, 0) = 224: Font(j, 1) = 96: Font(j, 2) = 96: Font(j, 3) = 124
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 102
- j = i + 5
- Font(j, 0) = 48: Font(j, 2) = 112: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 120
- j = i + 6
- Font(j, 0) = 12: Font(j, 2) = 28: Font(j, 3) = 12
- Font(j, 4) = 12: Font(j, 5) = 204: Font(j, 6) = 204: Font(j, 7) = 120
- j = i + 7
- Font(j, 0) = 224: Font(j, 1) = 96: Font(j, 2) = 102: Font(j, 3) = 108
- Font(j, 4) = 120: Font(j, 5) = 108: Font(j, 6) = 230
- j = i + 8
- Font(j, 0) = 112: Font(j, 1) = 48: Font(j, 2) = 48: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 120
- j = i + 9
- Font(j, 2) = 204: Font(j, 3) = 254
- Font(j, 4) = 214: Font(j, 5) = 198: Font(j, 6) = 198
-
- i = 110: j = i
- Font(j, 2) = 220: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 102
- j = i + 1
- Font(j, 2) = 60: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 60
- j = i + 2
- Font(j, 2) = 220: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 124: Font(j, 6) = 96: Font(j, 7) = 240
- j = i + 3
- Font(j, 2) = 118: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 124: Font(j, 6) = 12: Font(j, 7) = 30
- j = i + 4
- Font(j, 2) = 220: Font(j, 3) = 118
- Font(j, 4) = 96: Font(j, 5) = 96: Font(j, 6) = 240
- j = i + 5
- Font(j, 2) = 120: Font(j, 3) = 192
- Font(j, 4) = 120: Font(j, 5) = 12: Font(j, 6) = 120
- j = i + 6
- Font(j, 0) = 16: Font(j, 1) = 48: Font(j, 2) = 120: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 52: Font(j, 6) = 24
- j = i + 7
- Font(j, 2) = 204: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 8
- Font(j, 2) = 102: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 60: Font(j, 6) = 24
- j = i + 9
- Font(j, 2) = 198: Font(j, 3) = 198
- Font(j, 4) = 214: Font(j, 5) = 254: Font(j, 6) = 108
-
- i = 120: j = i
- Font(j, 2) = 204: Font(j, 3) = 120
- Font(j, 4) = 48: Font(j, 5) = 120: Font(j, 6) = 204
- j = i + 1
- Font(j, 2) = 204: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 124: Font(j, 6) = 12: Font(j, 7) = 120
- j = i + 2
- Font(j, 2) = 252: Font(j, 3) = 24
- Font(j, 4) = 48: Font(j, 5) = 96: Font(j, 6) = 252
- j = i + 3
- Font(j, 0) = 14: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 112
- Font(j, 4) = 24: Font(j, 5) = 24: Font(j, 6) = 14
- j = i + 4
- Font(j, 0) = 48: Font(j, 1) = 48: Font(j, 2) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 48
- j = i + 5
- Font(j, 0) = 112: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 14
- Font(j, 4) = 24: Font(j, 5) = 24: Font(j, 6) = 112
- j = i + 6
- Font(j, 1) = 118: Font(j, 2) = 220
- j = i + 7
- Font(j, 0) = 16: Font(j, 1) = 56: Font(j, 2) = 108: Font(j, 3) = 198
- Font(j, 4) = 198: Font(j, 5) = 198: Font(j, 6) = 254
- j = i + 8
- Font(j, 0) = 120: Font(j, 1) = 204: Font(j, 2) = 192: Font(j, 3) = 204
- Font(j, 4) = 120: Font(j, 5) = 48: Font(j, 6) = 24: Font(j, 7) = 112
- j = i + 9
- Font(j, 1) = 204: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 204: Font(j, 6) = 118
-
- i = 130: j = i
- Font(j, 0) = 28: Font(j, 2) = 120: Font(j, 3) = 204
- Font(j, 4) = 252: Font(j, 5) = 192: Font(j, 6) = 124
- j = i + 1
- Font(j, 0) = 48: Font(j, 1) = 204: Font(j, 2) = 120: Font(j, 3) = 12
- Font(j, 4) = 124: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 2
- Font(j, 0) = 204: Font(j, 2) = 120: Font(j, 3) = 12
- Font(j, 4) = 124: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 3
- Font(j, 0) = 224: Font(j, 2) = 120: Font(j, 3) = 12
- Font(j, 4) = 124: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 4
- Font(j, 0) = 48: Font(j, 1) = 48: Font(j, 2) = 120: Font(j, 3) = 12
- Font(j, 4) = 124: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 5
- Font(j, 1) = 124: Font(j, 2) = 192: Font(j, 3) = 192
- Font(j, 4) = 124: Font(j, 5) = 24: Font(j, 6) = 120
- j = i + 6
- Font(j, 0) = 48: Font(j, 1) = 204: Font(j, 2) = 120: Font(j, 3) = 204
- Font(j, 4) = 252: Font(j, 5) = 192: Font(j, 6) = 124
- j = i + 7
- Font(j, 0) = 204: Font(j, 2) = 120: Font(j, 3) = 204
- Font(j, 4) = 252: Font(j, 5) = 192: Font(j, 6) = 124
- j = i + 8
- Font(j, 0) = 224: Font(j, 2) = 120: Font(j, 3) = 204
- Font(j, 4) = 252: Font(j, 5) = 192: Font(j, 6) = 124
- j = i + 9
- Font(j, 0) = 204: Font(j, 2) = 48: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 120
-
- i = 140: j = i
- Font(j, 0) = 48: Font(j, 1) = 204: Font(j, 2) = 48: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 120
- j = i + 1
- Font(j, 0) = 224: Font(j, 2) = 48: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 120
- j = i + 2
- Font(j, 0) = 204: Font(j, 2) = 48: Font(j, 3) = 120
- Font(j, 4) = 204: Font(j, 5) = 252: Font(j, 6) = 204
- j = i + 3
- Font(j, 0) = 48: Font(j, 1) = 72: Font(j, 2) = 48: Font(j, 3) = 120
- Font(j, 4) = 204: Font(j, 5) = 252: Font(j, 6) = 204
- j = i + 4
- Font(j, 0) = 56: Font(j, 2) = 124: Font(j, 3) = 96
- Font(j, 4) = 120: Font(j, 5) = 96: Font(j, 6) = 124
- j = i + 5
- Font(j, 1) = 126: Font(j, 2) = 26: Font(j, 3) = 126
- Font(j, 4) = 216: Font(j, 5) = 218: Font(j, 6) = 126
- j = i + 6
- Font(j, 0) = 62: Font(j, 1) = 108: Font(j, 2) = 204: Font(j, 3) = 206
- Font(j, 4) = 252: Font(j, 5) = 204: Font(j, 6) = 206
- j = i + 7
- Font(j, 0) = 24: Font(j, 1) = 102: Font(j, 3) = 60
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 60
- j = i + 8
- Font(j, 1) = 102: Font(j, 3) = 60
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 60
- j = i + 9
- Font(j, 1) = 112: Font(j, 3) = 60
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 60
-
- i = 150: j = i
- Font(j, 0) = 48: Font(j, 1) = 204: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 1
- Font(j, 1) = 224: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 2
- Font(j, 1) = 204: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 124: Font(j, 6) = 12: Font(j, 7) = 120
- j = i + 3
- Font(j, 0) = 204: Font(j, 1) = 48: Font(j, 2) = 120: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 120: Font(j, 6) = 48
- j = i + 4
- Font(j, 0) = 204: Font(j, 2) = 204: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 204: Font(j, 6) = 120
- j = i + 5
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 124: Font(j, 3) = 192
- Font(j, 4) = 192: Font(j, 5) = 124: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 6
- Font(j, 0) = 56: Font(j, 1) = 108: Font(j, 2) = 96: Font(j, 3) = 240
- Font(j, 4) = 96: Font(j, 5) = 236: Font(j, 6) = 252
- j = i + 7
- Font(j, 0) = 204: Font(j, 1) = 204: Font(j, 2) = 120: Font(j, 3) = 48
- Font(j, 4) = 252: Font(j, 5) = 48: Font(j, 6) = 252: Font(j, 7) = 48
- j = i + 8
- Font(j, 0) = 248: Font(j, 1) = 204: Font(j, 2) = 204: Font(j, 3) = 248
- Font(j, 4) = 204: Font(j, 5) = 222: Font(j, 6) = 204: Font(j, 7) = 206
- j = i + 9
- Font(j, 0) = 14: Font(j, 1) = 27: Font(j, 2) = 24: Font(j, 3) = 126
- Font(j, 4) = 24: Font(j, 5) = 24: Font(j, 6) = 216: Font(j, 7) = 112
-
- i = 160: j = i
- Font(j, 0) = 28: Font(j, 2) = 120: Font(j, 3) = 12
- Font(j, 4) = 124: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 1
- Font(j, 0) = 28: Font(j, 2) = 48: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 120
- j = i + 2
- Font(j, 1) = 14: Font(j, 3) = 60
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 60
- j = i + 3
- Font(j, 1) = 28: Font(j, 3) = 204
- Font(j, 4) = 204: Font(j, 5) = 204: Font(j, 6) = 118
- j = i + 4
- Font(j, 1) = 252: Font(j, 3) = 220
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 102
- j = i + 5
- Font(j, 0) = 126: Font(j, 2) = 102: Font(j, 3) = 118
- Font(j, 4) = 126: Font(j, 5) = 110: Font(j, 6) = 102
- j = i + 6
- Font(j, 0) = 120: Font(j, 1) = 216: Font(j, 2) = 216: Font(j, 3) = 124
- Font(j, 5) = 252
- j = i + 7
- Font(j, 0) = 120: Font(j, 1) = 204: Font(j, 2) = 204: Font(j, 3) = 120
- Font(j, 5) = 252
- j = i + 8
- Font(j, 0) = 24: Font(j, 2) = 24: Font(j, 3) = 48
- Font(j, 4) = 96: Font(j, 5) = 102: Font(j, 6) = 60
- j = i + 9
- Font(j, 3) = 254: Font(j, 4) = 192: Font(j, 5) = 192
-
- i = 170: j = i
- Font(j, 3) = 254: Font(j, 4) = 6: Font(j, 5) = 6
- j = i + 1
- Font(j, 0) = 198: Font(j, 1) = 204: Font(j, 2) = 216: Font(j, 3) = 54
- Font(j, 4) = 107: Font(j, 5) = 198: Font(j, 6) = 143
- j = i + 2
- Font(j, 0) = 198: Font(j, 1) = 204: Font(j, 2) = 218: Font(j, 3) = 54
- Font(j, 4) = 106: Font(j, 5) = 223: Font(j, 6) = 130
- j = i + 3
- Font(j, 0) = 48: Font(j, 1) = 48: Font(j, 3) = 48
- Font(j, 4) = 48: Font(j, 5) = 48: Font(j, 6) = 48
- j = i + 4
- Font(j, 1) = 54: Font(j, 2) = 108: Font(j, 3) = 216
- Font(j, 4) = 108: Font(j, 5) = 54
- j = i + 5
- Font(j, 1) = 216: Font(j, 2) = 108: Font(j, 3) = 54
- Font(j, 4) = 108: Font(j, 5) = 216
- j = i + 6
- Font(j, 0) = 68: Font(j, 1) = 17: Font(j, 2) = 68: Font(j, 3) = 17
- Font(j, 4) = 68: Font(j, 5) = 17: Font(j, 6) = 68: Font(j, 7) = 17
- j = i + 7
- Font(j, 0) = 170: Font(j, 1) = 85: Font(j, 2) = 170: Font(j, 3) = 85
- Font(j, 4) = 170: Font(j, 5) = 85: Font(j, 6) = 170: Font(j, 7) = 85
- j = i + 8
- Font(j, 0) = 187: Font(j, 1) = 238: Font(j, 2) = 187: Font(j, 3) = 238
- Font(j, 4) = 187: Font(j, 5) = 238: Font(j, 6) = 187: Font(j, 7) = 238
- j = i + 9
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 24: Font(j, 6) = 24: Font(j, 7) = 24
-
- i = 180: j = i
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 248: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 1
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 248
- Font(j, 4) = 24: Font(j, 5) = 248: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 2
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 54
- Font(j, 4) = 54: Font(j, 5) = 246: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 3
- Font(j, 5) = 254: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 4
- Font(j, 3) = 248
- Font(j, 4) = 24: Font(j, 5) = 248: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 5
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 246
- Font(j, 4) = 6: Font(j, 5) = 246: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 6
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 54
- Font(j, 4) = 54: Font(j, 5) = 54: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 7
- Font(j, 3) = 254
- Font(j, 4) = 6: Font(j, 5) = 246: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 8
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 246
- Font(j, 4) = 6: Font(j, 5) = 254
- j = i + 9
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 54
- Font(j, 4) = 54: Font(j, 5) = 254
-
- i = 190: j = i
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 248
- Font(j, 4) = 24: Font(j, 5) = 248
- j = i + 1
- Font(j, 5) = 248: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 2
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 31
- j = i + 3
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 255
- j = i + 4
- Font(j, 5) = 255: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 5
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 31: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 6
- Font(j, 5) = 255
- j = i + 7
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 255: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 8
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 31
- Font(j, 4) = 24: Font(j, 5) = 31: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 9
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 54
- Font(j, 4) = 54: Font(j, 5) = 55: Font(j, 6) = 54: Font(j, 7) = 54
-
- i = 200: j = i
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 55
- Font(j, 4) = 48: Font(j, 5) = 63
- j = i + 1
- Font(j, 3) = 63
- Font(j, 4) = 48: Font(j, 5) = 55: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 2
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 247
- Font(j, 5) = 255
- j = i + 3
- Font(j, 3) = 255: Font(j, 5) = 247: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 4
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 55
- Font(j, 4) = 48: Font(j, 5) = 55: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 5
- Font(j, 3) = 255: Font(j, 5) = 255
- j = i + 6
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 247
- Font(j, 5) = 247: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 7
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 255
- Font(j, 5) = 255
- j = i + 8
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 54
- Font(j, 4) = 54: Font(j, 5) = 255
- j = i + 9
- Font(j, 3) = 255: Font(j, 5) = 255: Font(j, 6) = 24: Font(j, 7) = 24
-
- i = 210: j = i
- Font(j, 5) = 255: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 1
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 54
- Font(j, 4) = 54: Font(j, 5) = 63
- j = i + 2
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 31
- Font(j, 4) = 24: Font(j, 5) = 31
- j = i + 3
- Font(j, 3) = 31
- Font(j, 4) = 24: Font(j, 5) = 31: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 4
- Font(j, 5) = 63: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 5
- Font(j, 0) = 54: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 54
- Font(j, 4) = 54: Font(j, 5) = 255: Font(j, 6) = 54: Font(j, 7) = 54
- j = i + 6
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 255
- Font(j, 4) = 24: Font(j, 5) = 255: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 7
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 24: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 5) = 248
- j = i + 8
- Font(j, 5) = 31: Font(j, 6) = 24: Font(j, 7) = 24
- j = i + 9
- Font(j, 0) = 255: Font(j, 1) = 255: Font(j, 2) = 255: Font(j, 3) = 255
- Font(j, 4) = 255: Font(j, 5) = 255: Font(j, 6) = 255: Font(j, 7) = 255
-
- i = 220: j = i
- Font(j, 4) = 255: Font(j, 5) = 255: Font(j, 6) = 255: Font(j, 7) = 255
- j = i + 1
- Font(j, 0) = 240: Font(j, 1) = 240: Font(j, 2) = 240: Font(j, 3) = 240
- Font(j, 4) = 240: Font(j, 5) = 240: Font(j, 6) = 240: Font(j, 7) = 240
- j = i + 2
- Font(j, 0) = 15: Font(j, 1) = 15: Font(j, 2) = 15: Font(j, 3) = 15
- Font(j, 4) = 15: Font(j, 5) = 15: Font(j, 6) = 15: Font(j, 7) = 15
- j = i + 3
- Font(j, 0) = 255: Font(j, 1) = 255: Font(j, 2) = 255: Font(j, 3) = 255
- j = i + 4
- Font(j, 2) = 118: Font(j, 3) = 220
- Font(j, 4) = 216: Font(j, 5) = 220: Font(j, 6) = 118
- j = i + 5
- Font(j, 1) = 60: Font(j, 2) = 102: Font(j, 3) = 124
- Font(j, 4) = 102: Font(j, 5) = 124: Font(j, 6) = 96: Font(j, 7) = 96
- j = i + 6
- Font(j, 1) = 126: Font(j, 2) = 102: Font(j, 3) = 96
- Font(j, 4) = 96: Font(j, 5) = 96: Font(j, 6) = 96
- j = i + 7
- Font(j, 1) = 254: Font(j, 2) = 108: Font(j, 3) = 108
- Font(j, 4) = 108: Font(j, 5) = 236
- j = i + 8
- Font(j, 0) = 126: Font(j, 1) = 102: Font(j, 2) = 48: Font(j, 3) = 24
- Font(j, 4) = 48: Font(j, 5) = 102: Font(j, 6) = 126
- j = i + 9
- Font(j, 1) = 126: Font(j, 2) = 216: Font(j, 3) = 216
- Font(j, 4) = 216: Font(j, 5) = 112
-
- i = 230: j = i
- Font(j, 1) = 108: Font(j, 2) = 108: Font(j, 3) = 108
- Font(j, 4) = 118: Font(j, 5) = 96: Font(j, 6) = 192
- j = i + 1
- Font(j, 1) = 118: Font(j, 2) = 220: Font(j, 3) = 216
- Font(j, 4) = 24: Font(j, 5) = 24: Font(j, 6) = 24
- j = i + 2
- Font(j, 0) = 126: Font(j, 1) = 24: Font(j, 2) = 60: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 60: Font(j, 6) = 24: Font(j, 7) = 126
- j = i + 3
- Font(j, 0) = 56: Font(j, 1) = 124: Font(j, 2) = 198: Font(j, 3) = 254
- Font(j, 4) = 198: Font(j, 5) = 124: Font(j, 6) = 56
- j = i + 4
- Font(j, 0) = 56: Font(j, 1) = 108: Font(j, 2) = 198: Font(j, 3) = 198
- Font(j, 4) = 198: Font(j, 5) = 108: Font(j, 6) = 238
- j = i + 5
- Font(j, 0) = 56: Font(j, 1) = 96: Font(j, 2) = 48: Font(j, 3) = 120
- Font(j, 4) = 204: Font(j, 5) = 204: Font(j, 6) = 120
- j = i + 6
- Font(j, 2) = 126: Font(j, 3) = 216: Font(j, 4) = 216: Font(j, 5) = 126
- j = i + 7
- Font(j, 0) = 6: Font(j, 1) = 12: Font(j, 2) = 126: Font(j, 3) = 219
- Font(j, 4) = 219: Font(j, 5) = 126: Font(j, 6) = 48: Font(j, 7) = 96
- j = i + 8
- Font(j, 0) = 28: Font(j, 1) = 48: Font(j, 2) = 96: Font(j, 3) = 120
- Font(j, 4) = 96: Font(j, 5) = 48: Font(j, 6) = 28
- j = i + 9
- Font(j, 0) = 60: Font(j, 1) = 102: Font(j, 2) = 102: Font(j, 3) = 102
- Font(j, 4) = 102: Font(j, 5) = 102: Font(j, 6) = 102
-
- i = 240: j = i
- Font(j, 1) = 126: Font(j, 3) = 126: Font(j, 5) = 126
- j = i + 1
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 2) = 126: Font(j, 3) = 24
- Font(j, 4) = 24: Font(j, 6) = 126
- j = i + 2
- Font(j, 0) = 48: Font(j, 1) = 24: Font(j, 2) = 12: Font(j, 3) = 24
- Font(j, 4) = 48: Font(j, 6) = 126
- j = i + 3
- Font(j, 0) = 12: Font(j, 1) = 24: Font(j, 2) = 48: Font(j, 3) = 24
- Font(j, 4) = 12: Font(j, 6) = 126
- j = i + 4
- Font(j, 0) = 56: Font(j, 1) = 108: Font(j, 2) = 108: Font(j, 3) = 96
- Font(j, 4) = 96: Font(j, 5) = 96: Font(j, 6) = 96: Font(j, 7) = 96
- j = i + 5
- Font(j, 0) = 12: Font(j, 1) = 12: Font(j, 2) = 12: Font(j, 3) = 12
- Font(j, 4) = 12: Font(j, 5) = 108: Font(j, 6) = 108: Font(j, 7) = 56
- j = i + 6
- Font(j, 0) = 24: Font(j, 1) = 24: Font(j, 3) = 126
- Font(j, 5) = 24: Font(j, 6) = 24
- j = i + 7
- Font(j, 1) = 118: Font(j, 2) = 220: Font(j, 4) = 118: Font(j, 5) = 220
- j = i + 8
- Font(j, 0) = 28: Font(j, 1) = 54: Font(j, 2) = 54: Font(j, 3) = 28
- j = i + 9
- Font(j, 3) = 56: Font(j, 4) = 56
-
- i = 250: j = i
- Font(j, 4) = 48
- j = i + 1
- Font(j, 0) = 15: Font(j, 1) = 12: Font(j, 2) = 12: Font(j, 3) = 12
- Font(j, 4) = 204: Font(j, 5) = 108: Font(j, 6) = 60: Font(j, 7) = 28
- j = i + 2
- Font(j, 0) = 216: Font(j, 1) = 108: Font(j, 2) = 108: Font(j, 3) = 108
- Font(j, 4) = 108
- j = i + 3
- Font(j, 0) = 56: Font(j, 1) = 12: Font(j, 2) = 24: Font(j, 3) = 48
- Font(j, 4) = 60
- j = i + 4
- Font(j, 2) = 124: Font(j, 3) = 124: Font(j, 4) = 124: Font(j, 5) = 124
-
- a$ = CHR$(&H55): B$ = CHR$(&HAA): C$ = CHR$(&HFF): d$ = CHR$(0)
- ' Blue
- Shades(1, 0) = a$ + d$ + d$ + a$ + B$ + d$ + d$ + B$
- Shades(1, 1) = a$ + d$ + d$ + C$ + B$ + d$ + d$ + C$
- Shades(1, 2) = C$ + d$ + d$ + C$ + C$ + d$ + d$ + C$
- Shades(1, 3) = C$ + B$ + d$ + a$ + C$ + a$ + d$ + B$
- Shades(1, 4) = C$ + a$ + d$ + C$ + C$ + B$ + d$ + C$
- ' Green
- Shades(2, 0) = d$ + a$ + d$ + d$ + d$ + B$ + d$ + d$
- Shades(2, 1) = d$ + B$ + d$ + a$ + d$ + a$ + d$ + B$
- Shades(2, 2) = d$ + a$ + d$ + C$ + d$ + B$ + d$ + C$
- Shades(2, 3) = B$ + C$ + B$ + a$ + a$ + C$ + a$ + B$
- Shades(2, 4) = a$ + C$ + a$ + C$ + B$ + C$ + B$ + C$
- ' Cyan
- Shades(3, 0) = a$ + a$ + d$ + d$ + B$ + B$ + d$ + d$
- Shades(3, 1) = B$ + B$ + d$ + a$ + a$ + a$ + d$ + B$
- Shades(3, 2) = a$ + a$ + d$ + C$ + B$ + B$ + d$ + C$
- Shades(3, 3) = C$ + C$ + B$ + a$ + C$ + C$ + a$ + B$
- Shades(3, 4) = C$ + C$ + a$ + C$ + C$ + C$ + B$ + C$
- ' Red
- Shades(4, 0) = d$ + d$ + a$ + d$ + d$ + d$ + B$ + d$
- Shades(4, 1) = d$ + d$ + C$ + d$ + d$ + d$ + C$ + d$
- Shades(4, 2) = d$ + d$ + C$ + a$ + d$ + d$ + C$ + B$
- Shades(4, 3) = d$ + d$ + C$ + C$ + d$ + d$ + C$ + C$
- Shades(4, 4) = a$ + a$ + C$ + C$ + B$ + B$ + C$ + C$
- ' Magenta
- Shades(5, 0) = a$ + d$ + a$ + a$ + B$ + d$ + B$ + B$
- Shades(5, 1) = a$ + d$ + a$ + C$ + B$ + d$ + B$ + C$
- Shades(5, 2) = a$ + d$ + C$ + a$ + B$ + d$ + C$ + B$
- Shades(5, 3) = C$ + d$ + C$ + C$ + C$ + d$ + C$ + C$
- Shades(5, 4) = C$ + a$ + C$ + C$ + C$ + B$ + C$ + C$
- ' Yellow
- Shades(6, 0) = d$ + B$ + a$ + d$ + d$ + a$ + B$ + d$
- Shades(6, 1) = d$ + a$ + a$ + a$ + d$ + B$ + B$ + B$
- Shades(6, 2) = d$ + B$ + a$ + C$ + d$ + a$ + B$ + C$
- Shades(6, 3) = B$ + C$ + C$ + a$ + a$ + C$ + C$ + B$
- Shades(6, 4) = a$ + C$ + C$ + C$ + B$ + C$ + C$ + C$
- ' White
- Shades(7, 0) = d$ + d$ + d$ + C$ + d$ + d$ + d$ + C$
- Shades(7, 1) = B$ + B$ + B$ + a$ + a$ + a$ + a$ + B$
- Shades(7, 2) = a$ + a$ + a$ + C$ + B$ + B$ + B$ + C$
- Shades(7, 3) = C$ + C$ + C$ + a$ + C$ + C$ + C$ + B$
- Shades(7, 4) = C$ + C$ + C$ + C$ + C$ + C$ + C$ + C$
-
- END IF
-
- ScrnMode = Mode
- SELECT CASE Mode
- CASE 9
- SCREEN 9
- IF HiRows THEN
- Rows = 43
- ELSE
- Rows = 25
- END IF
- Xmax = 639
- Ymax = 349
- CASE 12
- SCREEN 12
- IF HiRows THEN
- Rows = 60
- ELSE
- Rows = 30
- END IF
- Xmax = 639
- Ymax = 479
- CASE 13
- SCREEN 13
- Rows = 25
- Cols = 40
- Xmax = 319
- Ymax = 199
- CASE ELSE
- RETURN
- END SELECT
-
- IF Mode <> 13 THEN
- IF HiCols THEN
- Cols = 80
- ELSE
- Cols = 40
- END IF
- END IF
- WIDTH Cols, Rows
- CLS
- IF Mode = 9 THEN COLOR Fg, 0
-
- LINE (0, 0)-(Xmax, Ymax), Bg, BF
- LOCATE 1, 1, 0
- PSET (0, 0), Bg
- XYratio! = .75 * (Xmax + 1) / (Ymax + 1)
-
- END SUB
-
- '<p>
- '++++++++++++++++++++++++
- SUB zsSubstitute (XCoord, YCoord, Wide, Deep, colour1, colour2)
-
- IF Deep < 2 THEN
- a = Wide / XYratio!
- ELSE
- a = Deep
- END IF
- FOR B = XCoord TO XCoord + Wide - 1
- FOR C = YCoord TO YCoord + a - 1
- IF POINT(B, C) = colour1 THEN
- PSET (B, C), colour2
- END IF
- NEXT
- NEXT
-
- END SUB
-
-