Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_21.ADF » G/rubik1

G/rubik1

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_21.ADF
Filename: G/rubik1
Read OK:
File size: 0F42 bytes
Load address: 24204556
Exec address: 6275722E
File contents
                            THE RUBIK CUBE
                            ~~~~~~~~~~~~~~
                            By John McHugh
              (Notes by Richard from info from John)

John sent in this excellent program many moons ago to include in my 
Programs section.  It seems that since then I have been involved in many
other things - I have often thought that the problem with the Elk is
that it gives me too many ideas!!!  I am sorry for the late delivery!!

When I asked for some notes on the way the program works and on solving
the cube, as I thought that this would be of interest to members, back
came a 'wad' of notes including six MODE 2 screen dumps showing 
routines for solving it!!  I think this would have to be serialised 
if anyone is interested.  In the the meantime, here are some notes on 
the program.

The program runs in MODE 2 and the screen is loaded as separate file. This
shows an 'exploded' view of the cube so that you can see all sides of it.
This also shows the keys to use for the two rotating cursors.

John has used a DATA file rather than arrays for the data on colours
and the x,y coordiates and VDU23 numbers for the two cursors so as to
save memory.  I give the details of the data as he has listed it -

 DATA FILE &900 -&96B
 ~~~~~~~~~~~~~~~~~~~~
 VARIABLE.  ADDRESS.  COLOURS. (POINTERS - ABCDEFGHIJKL)

 V            0900    05 05 05 05 05 05 05 05 05                 TOP
 .            0909    06 06 06 06 06 06 06 06 06                 REAR
 .            0912    02 02 02 02 02 02 02 02 02                 LEFT
 .            091B    03 03 03 03 03 03 03 03 03                 RIGHT
 .            0924    07 07 07 07 07 07 07 07 07                 FRONT
 .            092D    01 01 01 01 01 01 01 01 01                 BOTTOM

 .                    CYAN CURSOR. (POINTER W%)

 J%           0936    04 05 06 07 07 07 06 05 04 03 03 03        X% TAB
 K%           0942    0E 0E 0E 0F 10 11 12 12 12 11 10 0F        Y% TAB
 L%           094E    E6 E6 E6 E8 E8 E8 E7 E7 E7 E9 E9 E9        CHAR

 .                    GREEN CURSOR.  (POINTER E%)

 M%(+1)       095A    0D 0E 0F 0F 0E 0D                          O% TAB
 N%(+1)       0960    0B 0A 09 0D 0E 0F                          P% TAB
 Q%(+1)       0966    E6 E6 E6 E7 E7 E7                          CHAR

The main program uses multi-statement lines to save memory and to make
the program run quicker.

The lines 40 & 50 alter the auto repeat values and I found with my fumble
fingers that this made the cursors too fast!!  These lines can be deleted
if anyone finds them difficult to control.

Line 70 sets up the characters-
      CHR$ 225 to 227 for the cube colours
      CHR$ 230 to 233 for the cursors

Line 100 allocates names to frequently used variable values.

Lines 110 to 200 are the main loop -
   lines 130 to 160 vary the values of W% and E% to select the section
   to move and PROC X (cyan) and PROC Y (green) move the cursors.

Lines 170 and 180 select PROC M (cyan) and PROC N (green)

These 'move' the the section of the cube, by swapping the colours, through
PROC C and, where the top, bottom or sides move, through PROC B or PROC D
depending on which way the side moves.

The cube is printed using -

     VDU31,X,Y,col,char,....

and the procedures swap the colours using the indirection operator (?) -

eg       VDUa,Y,Z,b,V?A,c,b,V?B,c,..
becomes  VDU31,Y,Z,17,col,char,17,col,char,..

B%,C%,D% are used to hold three of the colours while the twelve colours of
the four sides are swapped.  In PROC B and PROC D only B% and C% are
needed as only eight colours are swapped as the centre remains the same.                                 

I hope this brief explanation is of interest and gives some idea of how
the program works.

Have fun shuffling the cube and trying to solve it.  I will try to give
some clues on how to do this if there is sufficient interest.

00000000  0d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00000010  20 20 20 20 20 20 20 20  20 20 20 20 20 54 48 45  |             THE|
00000020  20 52 55 42 49 4b 20 43  55 42 45 0d 20 20 20 20  | RUBIK CUBE.    |
00000030  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000040  20 20 20 20 20 20 20 20  7e 7e 7e 7e 7e 7e 7e 7e  |        ~~~~~~~~|
00000050  7e 7e 7e 7e 7e 7e 0d 20  20 20 20 20 20 20 20 20  |~~~~~~.         |
00000060  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000070  20 20 20 42 79 20 4a 6f  68 6e 20 4d 63 48 75 67  |   By John McHug|
00000080  68 0d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |h.              |
00000090  28 4e 6f 74 65 73 20 62  79 20 52 69 63 68 61 72  |(Notes by Richar|
000000a0  64 20 66 72 6f 6d 20 69  6e 66 6f 20 66 72 6f 6d  |d from info from|
000000b0  20 4a 6f 68 6e 29 0d 0d  4a 6f 68 6e 20 73 65 6e  | John)..John sen|
000000c0  74 20 69 6e 20 74 68 69  73 20 65 78 63 65 6c 6c  |t in this excell|
000000d0  65 6e 74 20 70 72 6f 67  72 61 6d 20 6d 61 6e 79  |ent program many|
000000e0  20 6d 6f 6f 6e 73 20 61  67 6f 20 74 6f 20 69 6e  | moons ago to in|
000000f0  63 6c 75 64 65 20 69 6e  20 6d 79 20 0d 50 72 6f  |clude in my .Pro|
00000100  67 72 61 6d 73 20 73 65  63 74 69 6f 6e 2e 20 20  |grams section.  |
00000110  49 74 20 73 65 65 6d 73  20 74 68 61 74 20 73 69  |It seems that si|
00000120  6e 63 65 20 74 68 65 6e  20 49 20 68 61 76 65 20  |nce then I have |
00000130  62 65 65 6e 20 69 6e 76  6f 6c 76 65 64 20 69 6e  |been involved in|
00000140  20 6d 61 6e 79 0d 6f 74  68 65 72 20 74 68 69 6e  | many.other thin|
00000150  67 73 20 2d 20 49 20 68  61 76 65 20 6f 66 74 65  |gs - I have ofte|
00000160  6e 20 74 68 6f 75 67 68  74 20 74 68 61 74 20 74  |n thought that t|
00000170  68 65 20 70 72 6f 62 6c  65 6d 20 77 69 74 68 20  |he problem with |
00000180  74 68 65 20 45 6c 6b 20  69 73 0d 74 68 61 74 20  |the Elk is.that |
00000190  69 74 20 67 69 76 65 73  20 6d 65 20 74 6f 6f 20  |it gives me too |
000001a0  6d 61 6e 79 20 69 64 65  61 73 21 21 21 20 20 49  |many ideas!!!  I|
000001b0  20 61 6d 20 73 6f 72 72  79 20 66 6f 72 20 74 68  | am sorry for th|
000001c0  65 20 6c 61 74 65 20 64  65 6c 69 76 65 72 79 21  |e late delivery!|
000001d0  21 0d 0d 57 68 65 6e 20  49 20 61 73 6b 65 64 20  |!..When I asked |
000001e0  66 6f 72 20 73 6f 6d 65  20 6e 6f 74 65 73 20 6f  |for some notes o|
000001f0  6e 20 74 68 65 20 77 61  79 20 74 68 65 20 70 72  |n the way the pr|
00000200  6f 67 72 61 6d 20 77 6f  72 6b 73 20 61 6e 64 20  |ogram works and |
00000210  6f 6e 20 73 6f 6c 76 69  6e 67 0d 74 68 65 20 63  |on solving.the c|
00000220  75 62 65 2c 20 61 73 20  49 20 74 68 6f 75 67 68  |ube, as I though|
00000230  74 20 74 68 61 74 20 74  68 69 73 20 77 6f 75 6c  |t that this woul|
00000240  64 20 62 65 20 6f 66 20  69 6e 74 65 72 65 73 74  |d be of interest|
00000250  20 74 6f 20 6d 65 6d 62  65 72 73 2c 20 62 61 63  | to members, bac|
00000260  6b 0d 63 61 6d 65 20 61  20 27 77 61 64 27 20 6f  |k.came a 'wad' o|
00000270  66 20 6e 6f 74 65 73 20  69 6e 63 6c 75 64 69 6e  |f notes includin|
00000280  67 20 73 69 78 20 4d 4f  44 45 20 32 20 73 63 72  |g six MODE 2 scr|
00000290  65 65 6e 20 64 75 6d 70  73 20 73 68 6f 77 69 6e  |een dumps showin|
000002a0  67 20 0d 72 6f 75 74 69  6e 65 73 20 66 6f 72 20  |g .routines for |
000002b0  73 6f 6c 76 69 6e 67 20  69 74 21 21 20 20 49 20  |solving it!!  I |
000002c0  74 68 69 6e 6b 20 74 68  69 73 20 77 6f 75 6c 64  |think this would|
000002d0  20 68 61 76 65 20 74 6f  20 62 65 20 73 65 72 69  | have to be seri|
000002e0  61 6c 69 73 65 64 20 0d  69 66 20 61 6e 79 6f 6e  |alised .if anyon|
000002f0  65 20 69 73 20 69 6e 74  65 72 65 73 74 65 64 2e  |e is interested.|
00000300  20 20 49 6e 20 74 68 65  20 74 68 65 20 6d 65 61  |  In the the mea|
00000310  6e 74 69 6d 65 2c 20 68  65 72 65 20 61 72 65 20  |ntime, here are |
00000320  73 6f 6d 65 20 6e 6f 74  65 73 20 6f 6e 20 0d 74  |some notes on .t|
00000330  68 65 20 70 72 6f 67 72  61 6d 2e 0d 0d 54 68 65  |he program...The|
00000340  20 70 72 6f 67 72 61 6d  20 72 75 6e 73 20 69 6e  | program runs in|
00000350  20 4d 4f 44 45 20 32 20  61 6e 64 20 74 68 65 20  | MODE 2 and the |
00000360  73 63 72 65 65 6e 20 69  73 20 6c 6f 61 64 65 64  |screen is loaded|
00000370  20 61 73 20 73 65 70 61  72 61 74 65 20 66 69 6c  | as separate fil|
00000380  65 2e 20 54 68 69 73 0d  73 68 6f 77 73 20 61 6e  |e. This.shows an|
00000390  20 27 65 78 70 6c 6f 64  65 64 27 20 76 69 65 77  | 'exploded' view|
000003a0  20 6f 66 20 74 68 65 20  63 75 62 65 20 73 6f 20  | of the cube so |
000003b0  74 68 61 74 20 79 6f 75  20 63 61 6e 20 73 65 65  |that you can see|
000003c0  20 61 6c 6c 20 73 69 64  65 73 20 6f 66 20 69 74  | all sides of it|
000003d0  2e 0d 54 68 69 73 20 61  6c 73 6f 20 73 68 6f 77  |..This also show|
000003e0  73 20 74 68 65 20 6b 65  79 73 20 74 6f 20 75 73  |s the keys to us|
000003f0  65 20 66 6f 72 20 74 68  65 20 74 77 6f 20 72 6f  |e for the two ro|
00000400  74 61 74 69 6e 67 20 63  75 72 73 6f 72 73 2e 0d  |tating cursors..|
00000410  0d 4a 6f 68 6e 20 68 61  73 20 75 73 65 64 20 61  |.John has used a|
00000420  20 44 41 54 41 20 66 69  6c 65 20 72 61 74 68 65  | DATA file rathe|
00000430  72 20 74 68 61 6e 20 61  72 72 61 79 73 20 66 6f  |r than arrays fo|
00000440  72 20 74 68 65 20 64 61  74 61 20 6f 6e 20 63 6f  |r the data on co|
00000450  6c 6f 75 72 73 0d 61 6e  64 20 74 68 65 20 78 2c  |lours.and the x,|
00000460  79 20 63 6f 6f 72 64 69  61 74 65 73 20 61 6e 64  |y coordiates and|
00000470  20 56 44 55 32 33 20 6e  75 6d 62 65 72 73 20 66  | VDU23 numbers f|
00000480  6f 72 20 74 68 65 20 74  77 6f 20 63 75 72 73 6f  |or the two curso|
00000490  72 73 20 73 6f 20 61 73  20 74 6f 0d 73 61 76 65  |rs so as to.save|
000004a0  20 6d 65 6d 6f 72 79 2e  20 20 49 20 67 69 76 65  | memory.  I give|
000004b0  20 74 68 65 20 64 65 74  61 69 6c 73 20 6f 66 20  | the details of |
000004c0  74 68 65 20 64 61 74 61  20 61 73 20 68 65 20 68  |the data as he h|
000004d0  61 73 20 6c 69 73 74 65  64 20 69 74 20 2d 0d 0d  |as listed it -..|
000004e0  20 44 41 54 41 20 46 49  4c 45 20 26 39 30 30 20  | DATA FILE &900 |
000004f0  2d 26 39 36 42 0d 20 7e  7e 7e 7e 7e 7e 7e 7e 7e  |-&96B. ~~~~~~~~~|
00000500  7e 7e 7e 7e 7e 7e 7e 7e  7e 7e 7e 0d 20 56 41 52  |~~~~~~~~~~~. VAR|
00000510  49 41 42 4c 45 2e 20 20  41 44 44 52 45 53 53 2e  |IABLE.  ADDRESS.|
00000520  20 20 43 4f 4c 4f 55 52  53 2e 20 28 50 4f 49 4e  |  COLOURS. (POIN|
00000530  54 45 52 53 20 2d 20 41  42 43 44 45 46 47 48 49  |TERS - ABCDEFGHI|
00000540  4a 4b 4c 29 0d 0d 20 56  20 20 20 20 20 20 20 20  |JKL).. V        |
00000550  20 20 20 20 30 39 30 30  20 20 20 20 30 35 20 30  |    0900    05 0|
00000560  35 20 30 35 20 30 35 20  30 35 20 30 35 20 30 35  |5 05 05 05 05 05|
00000570  20 30 35 20 30 35 20 20  20 20 20 20 20 20 20 20  | 05 05          |
00000580  20 20 20 20 20 20 20 54  4f 50 0d 20 2e 20 20 20  |       TOP. .   |
00000590  20 20 20 20 20 20 20 20  20 30 39 30 39 20 20 20  |         0909   |
000005a0  20 30 36 20 30 36 20 30  36 20 30 36 20 30 36 20  | 06 06 06 06 06 |
000005b0  30 36 20 30 36 20 30 36  20 30 36 20 20 20 20 20  |06 06 06 06     |
000005c0  20 20 20 20 20 20 20 20  20 20 20 20 52 45 41 52  |            REAR|
000005d0  0d 20 2e 20 20 20 20 20  20 20 20 20 20 20 20 30  |. .            0|
000005e0  39 31 32 20 20 20 20 30  32 20 30 32 20 30 32 20  |912    02 02 02 |
000005f0  30 32 20 30 32 20 30 32  20 30 32 20 30 32 20 30  |02 02 02 02 02 0|
00000600  32 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |2               |
00000610  20 20 4c 45 46 54 0d 20  2e 20 20 20 20 20 20 20  |  LEFT. .       |
00000620  20 20 20 20 20 30 39 31  42 20 20 20 20 30 33 20  |     091B    03 |
00000630  30 33 20 30 33 20 30 33  20 30 33 20 30 33 20 30  |03 03 03 03 03 0|
00000640  33 20 30 33 20 30 33 20  20 20 20 20 20 20 20 20  |3 03 03         |
00000650  20 20 20 20 20 20 20 20  52 49 47 48 54 0d 20 2e  |        RIGHT. .|
00000660  20 20 20 20 20 20 20 20  20 20 20 20 30 39 32 34  |            0924|
00000670  20 20 20 20 30 37 20 30  37 20 30 37 20 30 37 20  |    07 07 07 07 |
00000680  30 37 20 30 37 20 30 37  20 30 37 20 30 37 20 20  |07 07 07 07 07  |
00000690  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 46  |               F|
000006a0  52 4f 4e 54 0d 20 2e 20  20 20 20 20 20 20 20 20  |RONT. .         |
000006b0  20 20 20 30 39 32 44 20  20 20 20 30 31 20 30 31  |   092D    01 01|
000006c0  20 30 31 20 30 31 20 30  31 20 30 31 20 30 31 20  | 01 01 01 01 01 |
000006d0  30 31 20 30 31 20 20 20  20 20 20 20 20 20 20 20  |01 01           |
000006e0  20 20 20 20 20 20 42 4f  54 54 4f 4d 0d 0d 20 2e  |      BOTTOM.. .|
000006f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000700  20 20 20 20 43 59 41 4e  20 43 55 52 53 4f 52 2e  |    CYAN CURSOR.|
00000710  20 28 50 4f 49 4e 54 45  52 20 57 25 29 0d 0d 20  | (POINTER W%).. |
00000720  4a 25 20 20 20 20 20 20  20 20 20 20 20 30 39 33  |J%           093|
00000730  36 20 20 20 20 30 34 20  30 35 20 30 36 20 30 37  |6    04 05 06 07|
00000740  20 30 37 20 30 37 20 30  36 20 30 35 20 30 34 20  | 07 07 06 05 04 |
00000750  30 33 20 30 33 20 30 33  20 20 20 20 20 20 20 20  |03 03 03        |
00000760  58 25 20 54 41 42 0d 20  4b 25 20 20 20 20 20 20  |X% TAB. K%      |
00000770  20 20 20 20 20 30 39 34  32 20 20 20 20 30 45 20  |     0942    0E |
00000780  30 45 20 30 45 20 30 46  20 31 30 20 31 31 20 31  |0E 0E 0F 10 11 1|
00000790  32 20 31 32 20 31 32 20  31 31 20 31 30 20 30 46  |2 12 12 11 10 0F|
000007a0  20 20 20 20 20 20 20 20  59 25 20 54 41 42 0d 20  |        Y% TAB. |
000007b0  4c 25 20 20 20 20 20 20  20 20 20 20 20 30 39 34  |L%           094|
000007c0  45 20 20 20 20 45 36 20  45 36 20 45 36 20 45 38  |E    E6 E6 E6 E8|
000007d0  20 45 38 20 45 38 20 45  37 20 45 37 20 45 37 20  | E8 E8 E7 E7 E7 |
000007e0  45 39 20 45 39 20 45 39  20 20 20 20 20 20 20 20  |E9 E9 E9        |
000007f0  43 48 41 52 0d 0d 20 2e  20 20 20 20 20 20 20 20  |CHAR.. .        |
00000800  20 20 20 20 20 20 20 20  20 20 20 20 47 52 45 45  |            GREE|
00000810  4e 20 43 55 52 53 4f 52  2e 20 20 28 50 4f 49 4e  |N CURSOR.  (POIN|
00000820  54 45 52 20 45 25 29 0d  0d 20 4d 25 28 2b 31 29  |TER E%).. M%(+1)|
00000830  20 20 20 20 20 20 20 30  39 35 41 20 20 20 20 30  |       095A    0|
00000840  44 20 30 45 20 30 46 20  30 46 20 30 45 20 30 44  |D 0E 0F 0F 0E 0D|
00000850  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000860  20 20 20 20 20 20 20 20  20 20 4f 25 20 54 41 42  |          O% TAB|
00000870  0d 20 4e 25 28 2b 31 29  20 20 20 20 20 20 20 30  |. N%(+1)       0|
00000880  39 36 30 20 20 20 20 30  42 20 30 41 20 30 39 20  |960    0B 0A 09 |
00000890  30 44 20 30 45 20 30 46  20 20 20 20 20 20 20 20  |0D 0E 0F        |
000008a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000008b0  20 20 50 25 20 54 41 42  0d 20 51 25 28 2b 31 29  |  P% TAB. Q%(+1)|
000008c0  20 20 20 20 20 20 20 30  39 36 36 20 20 20 20 45  |       0966    E|
000008d0  36 20 45 36 20 45 36 20  45 37 20 45 37 20 45 37  |6 E6 E6 E7 E7 E7|
000008e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000008f0  20 20 20 20 20 20 20 20  20 20 43 48 41 52 0d 0d  |          CHAR..|
00000900  54 68 65 20 6d 61 69 6e  20 70 72 6f 67 72 61 6d  |The main program|
00000910  20 75 73 65 73 20 6d 75  6c 74 69 2d 73 74 61 74  | uses multi-stat|
00000920  65 6d 65 6e 74 20 6c 69  6e 65 73 1a 20 74 6f 1a  |ement lines. to.|
00000930  20 73 61 76 65 1a 20 6d  65 6d 6f 72 79 1a 20 61  | save. memory. a|
00000940  6e 64 20 74 6f 20 6d 61  6b 65 0d 74 68 65 20 70  |nd to make.the p|
00000950  72 6f 67 72 61 6d 20 72  75 6e 20 71 75 69 63 6b  |rogram run quick|
00000960  65 72 2e 0d 0d 54 68 65  20 6c 69 6e 65 73 20 34  |er...The lines 4|
00000970  30 20 26 20 35 30 1a 20  61 6c 74 65 72 20 74 68  |0 & 50. alter th|
00000980  65 20 61 75 74 6f 20 72  65 70 65 61 74 20 76 61  |e auto repeat va|
00000990  6c 75 65 73 20 61 6e 64  20 49 20 66 6f 75 6e 64  |lues and I found|
000009a0  20 77 69 74 68 20 6d 79  20 66 75 6d 62 6c 65 0d  | with my fumble.|
000009b0  66 69 6e 67 65 72 73 20  74 68 61 74 20 74 68 69  |fingers that thi|
000009c0  73 20 6d 61 64 65 20 74  68 65 20 63 75 72 73 6f  |s made the curso|
000009d0  72 73 1a 20 74 6f 6f 20  66 61 73 74 21 21 20 20  |rs. too fast!!  |
000009e0  54 68 65 73 65 20 6c 69  6e 65 73 20 63 61 6e 20  |These lines can |
000009f0  62 65 20 64 65 6c 65 74  65 64 0d 69 66 20 61 6e  |be deleted.if an|
00000a00  79 6f 6e 65 20 66 69 6e  64 73 20 74 68 65 6d 20  |yone finds them |
00000a10  64 69 66 66 69 63 75 6c  74 20 74 6f 20 63 6f 6e  |difficult to con|
00000a20  74 72 6f 6c 2e 0d 0d 4c  69 6e 65 20 37 30 20 73  |trol...Line 70 s|
00000a30  65 74 73 20 75 70 20 74  68 65 20 63 68 61 72 61  |ets up the chara|
00000a40  63 74 65 72 73 2d 0d 20  20 20 20 20 20 43 48 52  |cters-.      CHR|
00000a50  24 20 32 32 35 20 74 6f  20 32 32 37 20 66 6f 72  |$ 225 to 227 for|
00000a60  20 74 68 65 20 63 75 62  65 20 63 6f 6c 6f 75 72  | the cube colour|
00000a70  73 0d 20 20 20 20 20 20  43 48 52 24 20 32 33 30  |s.      CHR$ 230|
00000a80  20 74 6f 20 32 33 33 20  66 6f 72 20 74 68 65 20  | to 233 for the |
00000a90  63 75 72 73 6f 72 73 0d  0d 4c 69 6e 65 20 31 30  |cursors..Line 10|
00000aa0  30 20 61 6c 6c 6f 63 61  74 65 73 20 6e 61 6d 65  |0 allocates name|
00000ab0  73 20 74 6f 20 66 72 65  71 75 65 6e 74 6c 79 20  |s to frequently |
00000ac0  75 73 65 64 20 76 61 72  69 61 62 6c 65 20 76 61  |used variable va|
00000ad0  6c 75 65 73 2e 0d 0d 4c  69 6e 65 73 20 31 31 30  |lues...Lines 110|
00000ae0  20 74 6f 20 32 30 30 20  61 72 65 20 74 68 65 20  | to 200 are the |
00000af0  6d 61 69 6e 20 6c 6f 6f  70 20 2d 0d 20 20 20 6c  |main loop -.   l|
00000b00  69 6e 65 73 20 31 33 30  20 74 6f 20 31 36 30 20  |ines 130 to 160 |
00000b10  76 61 72 79 20 74 68 65  20 76 61 6c 75 65 73 20  |vary the values |
00000b20  6f 66 20 57 25 20 61 6e  64 20 45 25 20 74 6f 20  |of W% and E% to |
00000b30  73 65 6c 65 63 74 20 74  68 65 20 73 65 63 74 69  |select the secti|
00000b40  6f 6e 0d 20 20 20 74 6f  20 6d 6f 76 65 20 61 6e  |on.   to move an|
00000b50  64 20 50 52 4f 43 20 58  20 28 63 79 61 6e 29 20  |d PROC X (cyan) |
00000b60  61 6e 64 20 50 52 4f 43  20 59 20 28 67 72 65 65  |and PROC Y (gree|
00000b70  6e 29 20 6d 6f 76 65 20  74 68 65 20 63 75 72 73  |n) move the curs|
00000b80  6f 72 73 2e 0d 0d 4c 69  6e 65 73 20 31 37 30 20  |ors...Lines 170 |
00000b90  61 6e 64 20 31 38 30 20  73 65 6c 65 63 74 20 50  |and 180 select P|
00000ba0  52 4f 43 20 4d 20 28 63  79 61 6e 29 20 61 6e 64  |ROC M (cyan) and|
00000bb0  20 50 52 4f 43 20 4e 20  28 67 72 65 65 6e 29 0d  | PROC N (green).|
00000bc0  0d 54 68 65 73 65 20 27  6d 6f 76 65 27 20 74 68  |.These 'move' th|
00000bd0  65 20 74 68 65 20 73 65  63 74 69 6f 6e 20 6f 66  |e the section of|
00000be0  20 74 68 65 20 63 75 62  65 2c 20 62 79 20 73 77  | the cube, by sw|
00000bf0  61 70 70 69 6e 67 20 74  68 65 20 63 6f 6c 6f 75  |apping the colou|
00000c00  72 73 2c 20 74 68 72 6f  75 67 68 0d 50 52 4f 43  |rs, through.PROC|
00000c10  20 43 20 61 6e 64 2c 20  77 68 65 72 65 20 74 68  | C and, where th|
00000c20  65 1a 20 74 6f 70 2c 20  62 6f 74 74 6f 6d 20 6f  |e. top, bottom o|
00000c30  72 20 73 69 64 65 73 20  6d 6f 76 65 2c 20 74 68  |r sides move, th|
00000c40  72 6f 75 67 68 20 50 52  4f 43 20 42 20 6f 72 20  |rough PROC B or |
00000c50  50 52 4f 43 20 44 0d 64  65 70 65 6e 64 69 6e 67  |PROC D.depending|
00000c60  20 6f 6e 20 77 68 69 63  68 20 77 61 79 20 74 68  | on which way th|
00000c70  65 20 73 69 64 65 20 6d  6f 76 65 73 2e 0d 0d 54  |e side moves...T|
00000c80  68 65 20 63 75 62 65 20  69 73 20 70 72 69 6e 74  |he cube is print|
00000c90  65 64 20 75 73 69 6e 67  20 2d 0d 0d 20 20 20 20  |ed using -..    |
00000ca0  20 56 44 55 33 31 2c 58  2c 59 2c 63 6f 6c 2c 63  | VDU31,X,Y,col,c|
00000cb0  68 61 72 2c 2e 2e 2e 2e  0d 0d 61 6e 64 20 74 68  |har,......and th|
00000cc0  65 20 70 72 6f 63 65 64  75 72 65 73 20 73 77 61  |e procedures swa|
00000cd0  70 20 74 68 65 20 63 6f  6c 6f 75 72 73 20 75 73  |p the colours us|
00000ce0  69 6e 67 20 74 68 65 20  69 6e 64 69 72 65 63 74  |ing the indirect|
00000cf0  69 6f 6e 20 6f 70 65 72  61 74 6f 72 20 28 3f 29  |ion operator (?)|
00000d00  20 2d 0d 0d 65 67 20 20  20 20 20 20 20 56 44 55  | -..eg       VDU|
00000d10  61 2c 59 2c 5a 2c 62 2c  56 3f 41 2c 63 2c 62 2c  |a,Y,Z,b,V?A,c,b,|
00000d20  56 3f 42 2c 63 2c 2e 2e  0d 62 65 63 6f 6d 65 73  |V?B,c,...becomes|
00000d30  20 20 56 44 55 33 31 2c  59 2c 5a 2c 31 37 2c 63  |  VDU31,Y,Z,17,c|
00000d40  6f 6c 2c 63 68 61 72 2c  31 37 2c 63 6f 6c 2c 63  |ol,char,17,col,c|
00000d50  68 61 72 2c 2e 2e 0d 0d  42 25 2c 43 25 2c 44 25  |har,....B%,C%,D%|
00000d60  20 61 72 65 20 75 73 65  64 20 74 6f 20 68 6f 6c  | are used to hol|
00000d70  64 20 74 68 72 65 65 20  6f 66 20 74 68 65 20 63  |d three of the c|
00000d80  6f 6c 6f 75 72 73 20 77  68 69 6c 65 20 74 68 65  |olours while the|
00000d90  20 74 77 65 6c 76 65 20  63 6f 6c 6f 75 72 73 20  | twelve colours |
00000da0  6f 66 0d 74 68 65 20 66  6f 75 72 20 73 69 64 65  |of.the four side|
00000db0  73 20 61 72 65 20 73 77  61 70 70 65 64 2e 20 20  |s are swapped.  |
00000dc0  49 6e 20 50 52 4f 43 1a  20 42 1a 20 61 6e 64 1a  |In PROC. B. and.|
00000dd0  20 50 52 4f 43 1a 20 44  1a 20 6f 6e 6c 79 1a 20  | PROC. D. only. |
00000de0  42 25 20 61 6e 64 20 43  25 20 61 72 65 0d 6e 65  |B% and C% are.ne|
00000df0  65 64 65 64 20 61 73 20  6f 6e 6c 79 20 65 69 67  |eded as only eig|
00000e00  68 74 20 63 6f 6c 6f 75  72 73 20 61 72 65 20 73  |ht colours are s|
00000e10  77 61 70 70 65 64 20 61  73 20 74 68 65 20 63 65  |wapped as the ce|
00000e20  6e 74 72 65 20 72 65 6d  61 69 6e 73 20 74 68 65  |ntre remains the|
00000e30  20 73 61 6d 65 2e 20 20  20 20 20 20 20 20 20 20  | same.          |
00000e40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e50  20 20 20 20 20 20 20 0d  0d 49 20 68 6f 70 65 20  |       ..I hope |
00000e60  74 68 69 73 20 62 72 69  65 66 20 65 78 70 6c 61  |this brief expla|
00000e70  6e 61 74 69 6f 6e 20 69  73 1a 20 6f 66 1a 20 69  |nation is. of. i|
00000e80  6e 74 65 72 65 73 74 1a  20 61 6e 64 20 67 69 76  |nterest. and giv|
00000e90  65 73 20 73 6f 6d 65 20  69 64 65 61 20 6f 66 20  |es some idea of |
00000ea0  68 6f 77 0d 74 68 65 20  70 72 6f 67 72 61 6d 20  |how.the program |
00000eb0  77 6f 72 6b 73 2e 0d 0d  48 61 76 65 20 66 75 6e  |works...Have fun|
00000ec0  20 73 68 75 66 66 6c 69  6e 67 20 74 68 65 20 63  | shuffling the c|
00000ed0  75 62 65 20 61 6e 64 20  74 72 79 69 6e 67 20 74  |ube and trying t|
00000ee0  6f 20 73 6f 6c 76 65 1a  20 69 74 2e 1a 20 20 49  |o solve. it..  I|
00000ef0  1a 20 77 69 6c 6c 20 74  72 79 20 74 6f 20 67 69  |. will try to gi|
00000f00  76 65 0d 73 6f 6d 65 20  63 6c 75 65 73 20 6f 6e  |ve.some clues on|
00000f10  20 68 6f 77 20 74 6f 20  64 6f 20 74 68 69 73 20  | how to do this |
00000f20  69 66 20 74 68 65 72 65  20 69 73 20 73 75 66 66  |if there is suff|
00000f30  69 63 69 65 6e 74 20 69  6e 74 65 72 65 73 74 2e  |icient interest.|
00000f40  0d 0d                                             |..|
00000f42
G/rubik1.m0
G/rubik1.m1
G/rubik1.m2
G/rubik1.m4
G/rubik1.m5