Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_20.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_20.ADF |
Filename: | G/rubik1 |
Read OK: | ✔ |
File size: | 0A2E bytes |
Load address: | 24204556 |
Exec address: | 6275722E |
File contents
�PBoff 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 wey 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.
00000000 80 50 42 6f 66 66 0d 20 20 20 20 20 20 20 20 20 |.PBoff. | 00000010 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000020 20 20 20 54 48 45 20 52 55 42 49 4b 20 43 55 42 | THE RUBIK CUB| 00000030 45 0d 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |E. | 00000040 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7e 7e | ~~| 00000050 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 0d 20 20 20 |~~~~~~~~~~~~. | 00000060 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000070 20 20 20 20 20 20 20 20 20 42 79 20 4a 6f 68 6e | By John| 00000080 20 4d 63 48 75 67 68 0d 20 20 20 20 20 20 20 20 | McHugh. | 00000090 20 20 20 20 20 20 28 4e 6f 74 65 73 20 62 79 20 | (Notes by | 000000a0 52 69 63 68 61 72 64 20 66 72 6f 6d 20 69 6e 66 |Richard from inf| 000000b0 6f 20 66 72 6f 6d 20 4a 6f 68 6e 29 0d 0d 4a 6f |o from John)..Jo| 000000c0 68 6e 20 73 65 6e 74 20 69 6e 20 74 68 69 73 20 |hn sent in this | 000000d0 65 78 63 65 6c 6c 65 6e 74 20 70 72 6f 67 72 61 |excellent progra| 000000e0 6d 20 6d 61 6e 79 20 6d 6f 6f 6e 73 20 61 67 6f |m many moons ago| 000000f0 20 74 6f 20 69 6e 63 6c 75 64 65 20 69 6e 20 6d | to include in m| 00000100 79 20 0d 50 72 6f 67 72 61 6d 73 20 73 65 63 74 |y .Programs sect| 00000110 69 6f 6e 2e 20 20 49 74 20 73 65 65 6d 73 20 74 |ion. It seems t| 00000120 68 61 74 20 73 69 6e 63 65 20 74 68 65 6e 20 49 |hat since then I| 00000130 20 68 61 76 65 20 62 65 65 6e 20 69 6e 76 6f 6c | have been invol| 00000140 76 65 64 20 69 6e 20 6d 61 6e 79 0d 6f 74 68 65 |ved in many.othe| 00000150 72 20 74 68 69 6e 67 73 20 2d 20 49 20 68 61 76 |r things - I hav| 00000160 65 20 6f 66 74 65 6e 20 74 68 6f 75 67 68 74 20 |e often thought | 00000170 74 68 61 74 20 74 68 65 20 70 72 6f 62 6c 65 6d |that the problem| 00000180 20 77 69 74 68 20 74 68 65 20 45 6c 6b 20 69 73 | with the Elk is| 00000190 0d 74 68 61 74 20 69 74 20 67 69 76 65 73 20 6d |.that it gives m| 000001a0 65 20 74 6f 6f 20 6d 61 6e 79 20 69 64 65 61 73 |e too many ideas| 000001b0 21 21 21 20 20 49 20 61 6d 20 73 6f 72 72 79 20 |!!! I am sorry | 000001c0 66 6f 72 20 74 68 65 20 6c 61 74 65 20 64 65 6c |for the late del| 000001d0 69 76 65 72 79 21 21 0d 0d 57 68 65 6e 20 49 20 |ivery!!..When I | 000001e0 61 73 6b 65 64 20 66 6f 72 20 73 6f 6d 65 20 6e |asked for some n| 000001f0 6f 74 65 73 20 6f 6e 20 74 68 65 20 77 65 79 20 |otes on the wey | 00000200 74 68 65 20 70 72 6f 67 72 61 6d 20 77 6f 72 6b |the program work| 00000210 73 20 61 6e 64 20 6f 6e 20 73 6f 6c 76 69 6e 67 |s and on solving| 00000220 0d 74 68 65 20 63 75 62 65 2c 20 61 73 20 49 20 |.the cube, as I | 00000230 74 68 6f 75 67 68 74 20 74 68 61 74 20 74 68 69 |thought that thi| 00000240 73 20 77 6f 75 6c 64 20 62 65 20 6f 66 20 69 6e |s would be of in| 00000250 74 65 72 65 73 74 20 74 6f 20 6d 65 6d 62 65 72 |terest to member| 00000260 73 2c 20 62 61 63 6b 0d 63 61 6d 65 20 61 20 27 |s, back.came a '| 00000270 77 61 64 27 20 6f 66 20 6e 6f 74 65 73 20 69 6e |wad' of notes in| 00000280 63 6c 75 64 69 6e 67 20 73 69 78 20 4d 4f 44 45 |cluding six MODE| 00000290 20 32 20 73 63 72 65 65 6e 20 64 75 6d 70 73 20 | 2 screen dumps | 000002a0 73 68 6f 77 69 6e 67 20 0d 72 6f 75 74 69 6e 65 |showing .routine| 000002b0 73 20 66 6f 72 20 73 6f 6c 76 69 6e 67 20 69 74 |s for solving it| 000002c0 21 21 20 20 49 20 74 68 69 6e 6b 20 74 68 69 73 |!! I think this| 000002d0 20 77 6f 75 6c 64 20 68 61 76 65 20 74 6f 20 62 | would have to b| 000002e0 65 20 73 65 72 69 61 6c 69 73 65 64 20 0d 69 66 |e serialised .if| 000002f0 20 61 6e 79 6f 6e 65 20 69 73 20 69 6e 74 65 72 | anyone is inter| 00000300 65 73 74 65 64 2e 20 20 49 6e 20 74 68 65 20 74 |ested. In the t| 00000310 68 65 20 6d 65 61 6e 74 69 6d 65 2c 20 68 65 72 |he meantime, her| 00000320 65 20 61 72 65 20 73 6f 6d 65 20 6e 6f 74 65 73 |e are some notes| 00000330 20 6f 6e 20 0d 74 68 65 20 70 72 6f 67 72 61 6d | on .the program| 00000340 2e 0d 0d 54 68 65 20 70 72 6f 67 72 61 6d 20 72 |...The program r| 00000350 75 6e 73 20 69 6e 20 4d 4f 44 45 20 32 20 61 6e |uns in MODE 2 an| 00000360 64 20 74 68 65 20 73 63 72 65 65 6e 20 69 73 20 |d the screen is | 00000370 6c 6f 61 64 65 64 20 61 73 20 73 65 70 61 72 61 |loaded as separa| 00000380 74 65 20 66 69 6c 65 2e 20 54 68 69 73 0d 73 68 |te file. This.sh| 00000390 6f 77 73 20 61 6e 20 27 65 78 70 6c 6f 64 65 64 |ows an 'exploded| 000003a0 27 20 76 69 65 77 20 6f 66 20 74 68 65 20 63 75 |' view of the cu| 000003b0 62 65 20 73 6f 20 74 68 61 74 20 79 6f 75 20 63 |be so that you c| 000003c0 61 6e 20 73 65 65 20 61 6c 6c 20 73 69 64 65 73 |an see all sides| 000003d0 20 6f 66 20 69 74 2e 0d 54 68 69 73 20 61 6c 73 | of it..This als| 000003e0 6f 20 73 68 6f 77 73 20 74 68 65 20 6b 65 79 73 |o shows the keys| 000003f0 20 74 6f 20 75 73 65 20 66 6f 72 20 74 68 65 20 | to use for the | 00000400 74 77 6f 20 72 6f 74 61 74 69 6e 67 20 63 75 72 |two rotating cur| 00000410 73 6f 72 73 2e 0d 0d 4a 6f 68 6e 20 68 61 73 20 |sors...John has | 00000420 75 73 65 64 20 61 20 44 41 54 41 20 66 69 6c 65 |used a DATA file| 00000430 20 72 61 74 68 65 72 20 74 68 61 6e 20 61 72 72 | rather than arr| 00000440 61 79 73 20 66 6f 72 20 74 68 65 20 64 61 74 61 |ays for the data| 00000450 20 6f 6e 20 63 6f 6c 6f 75 72 73 0d 61 6e 64 20 | on colours.and | 00000460 74 68 65 20 78 2c 79 20 63 6f 6f 72 64 69 61 74 |the x,y coordiat| 00000470 65 73 20 61 6e 64 20 56 44 55 32 33 20 6e 75 6d |es and VDU23 num| 00000480 62 65 72 73 20 66 6f 72 20 74 68 65 20 74 77 6f |bers for the two| 00000490 20 63 75 72 73 6f 72 73 20 73 6f 20 61 73 20 74 | cursors so as t| 000004a0 6f 0d 73 61 76 65 20 6d 65 6d 6f 72 79 2e 20 20 |o.save memory. | 000004b0 49 20 67 69 76 65 20 74 68 65 20 64 65 74 61 69 |I give the detai| 000004c0 6c 73 20 6f 66 20 74 68 65 20 64 61 74 61 20 61 |ls of the data a| 000004d0 73 20 68 65 20 68 61 73 20 6c 69 73 74 65 64 20 |s he has listed | 000004e0 69 74 20 2d 0d 0d 20 44 41 54 41 20 46 49 4c 45 |it -.. DATA FILE| 000004f0 20 26 39 30 30 20 2d 26 39 36 42 0d 20 7e 7e 7e | &900 -&96B. ~~~| 00000500 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e 7e |~~~~~~~~~~~~~~~~| 00000510 7e 0d 20 56 41 52 49 41 42 4c 45 2e 20 20 41 44 |~. VARIABLE. AD| 00000520 44 52 45 53 53 2e 20 20 43 4f 4c 4f 55 52 53 2e |DRESS. COLOURS.| 00000530 20 28 50 4f 49 4e 54 45 52 53 20 2d 20 41 42 43 | (POINTERS - ABC| 00000540 44 45 46 47 48 49 4a 4b 4c 29 0d 0d 20 56 20 20 |DEFGHIJKL).. V | 00000550 20 20 20 20 20 20 20 20 20 20 30 39 30 30 20 20 | 0900 | 00000560 20 20 30 35 20 30 35 20 30 35 20 30 35 20 30 35 | 05 05 05 05 05| 00000570 20 30 35 20 30 35 20 30 35 20 30 35 20 20 20 20 | 05 05 05 05 | 00000580 20 20 20 20 20 20 20 20 20 20 20 20 20 54 4f 50 | TOP| 00000590 0d 20 2e 20 20 20 20 20 20 20 20 20 20 20 20 30 |. . 0| 000005a0 39 30 39 20 20 20 20 30 36 20 30 36 20 30 36 20 |909 06 06 06 | 000005b0 30 36 20 30 36 20 30 36 20 30 36 20 30 36 20 30 |06 06 06 06 06 0| 000005c0 36 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |6 | 000005d0 20 20 52 45 41 52 0d 20 2e 20 20 20 20 20 20 20 | REAR. . | 000005e0 20 20 20 20 20 30 39 31 32 20 20 20 20 30 32 20 | 0912 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 30 32 20 30 32 20 20 20 20 20 20 20 20 20 |2 02 02 | 00000610 20 20 20 20 20 20 20 20 4c 45 46 54 0d 20 2e 20 | LEFT. . | 00000620 20 20 20 20 20 20 20 20 20 20 20 30 39 31 42 20 | 091B | 00000630 20 20 20 30 33 20 30 33 20 30 33 20 30 33 20 30 | 03 03 03 03 0| 00000640 33 20 30 33 20 30 33 20 30 33 20 30 33 20 20 20 |3 03 03 03 03 | 00000650 20 20 20 20 20 20 20 20 20 20 20 20 20 20 52 49 | RI| 00000660 47 48 54 0d 20 2e 20 20 20 20 20 20 20 20 20 20 |GHT. . | 00000670 20 20 30 39 32 34 20 20 20 20 30 37 20 30 37 20 | 0924 07 07 | 00000680 30 37 20 30 37 20 30 37 20 30 37 20 30 37 20 30 |07 07 07 07 07 0| 00000690 37 20 30 37 20 20 20 20 20 20 20 20 20 20 20 20 |7 07 | 000006a0 20 20 20 20 20 46 52 4f 4e 54 0d 20 2e 20 20 20 | FRONT. . | 000006b0 20 20 20 20 20 20 20 20 20 30 39 32 44 20 20 20 | 092D | 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 30 31 20 30 31 20 20 20 20 20 |01 01 01 01 | 000006e0 20 20 20 20 20 20 20 20 20 20 20 20 42 4f 54 54 | BOTT| 000006f0 4f 4d 0d 0d 20 2e 20 20 20 20 20 20 20 20 20 20 |OM.. . | 00000700 20 20 20 20 20 20 20 20 20 20 43 59 41 4e 20 43 | CYAN C| 00000710 55 52 53 4f 52 2e 20 28 50 4f 49 4e 54 45 52 20 |URSOR. (POINTER | 00000720 57 25 29 0d 0d 20 4a 25 20 20 20 20 20 20 20 20 |W%).. J% | 00000730 20 20 20 30 39 33 36 20 20 20 20 30 34 20 30 35 | 0936 04 05| 00000740 20 30 36 20 30 37 20 30 37 20 30 37 20 30 36 20 | 06 07 07 07 06 | 00000750 30 35 20 30 34 20 30 33 20 30 33 20 30 33 20 20 |05 04 03 03 03 | 00000760 20 20 20 20 20 20 58 25 20 54 41 42 0d 20 4b 25 | X% TAB. K%| 00000770 20 20 20 20 20 20 20 20 20 20 20 30 39 34 32 20 | 0942 | 00000780 20 20 20 30 45 20 30 45 20 30 45 20 30 46 20 31 | 0E 0E 0E 0F 1| 00000790 30 20 31 31 20 31 32 20 31 32 20 31 32 20 31 31 |0 11 12 12 12 11| 000007a0 20 31 30 20 30 46 20 20 20 20 20 20 20 20 59 25 | 10 0F Y%| 000007b0 20 54 41 42 0d 20 4c 25 20 20 20 20 20 20 20 20 | TAB. L% | 000007c0 20 20 20 30 39 34 45 20 20 20 20 45 36 20 45 36 | 094E E6 E6| 000007d0 20 45 36 20 45 38 20 45 38 20 45 38 20 45 37 20 | E6 E8 E8 E8 E7 | 000007e0 45 37 20 45 37 20 45 39 20 45 39 20 45 39 20 20 |E7 E7 E9 E9 E9 | 000007f0 20 20 20 20 20 20 43 48 41 52 0d 0d 20 2e 20 20 | CHAR.. . | 00000800 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000810 20 20 47 52 45 45 4e 20 43 55 52 53 4f 52 2e 20 | GREEN CURSOR. | 00000820 20 28 50 4f 49 4e 54 45 52 20 45 25 29 0d 0d 20 | (POINTER E%).. | 00000830 4d 25 28 2b 31 29 20 20 20 20 20 20 20 30 39 35 |M%(+1) 095| 00000840 41 20 20 20 20 30 44 20 30 45 20 30 46 20 30 46 |A 0D 0E 0F 0F| 00000850 20 30 45 20 30 44 20 20 20 20 20 20 20 20 20 20 | 0E 0D | 00000860 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000870 4f 25 20 54 41 42 0d 20 4e 25 28 2b 31 29 20 20 |O% TAB. N%(+1) | 00000880 20 20 20 20 20 30 39 36 30 20 20 20 20 30 42 20 | 0960 0B | 00000890 30 41 20 30 39 20 30 44 20 30 45 20 30 46 20 20 |0A 09 0D 0E 0F | 000008a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000008b0 20 20 20 20 20 20 20 20 50 25 20 54 41 42 0d 20 | P% TAB. | 000008c0 51 25 28 2b 31 29 20 20 20 20 20 20 20 30 39 36 |Q%(+1) 096| 000008d0 36 20 20 20 20 45 36 20 45 36 20 45 36 20 45 37 |6 E6 E6 E6 E7| 000008e0 20 45 37 20 45 37 20 20 20 20 20 20 20 20 20 20 | E7 E7 | 000008f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000900 43 48 41 52 0d 0d 54 68 65 20 6d 61 69 6e 20 70 |CHAR..The main p| 00000910 72 6f 67 72 61 6d 20 75 73 65 73 20 6d 75 6c 74 |rogram uses mult| 00000920 69 2d 73 74 61 74 65 6d 65 6e 74 20 6c 69 6e 65 |i-statement line| 00000930 73 1a 20 74 6f 1a 20 73 61 76 65 1a 20 6d 65 6d |s. to. save. mem| 00000940 6f 72 79 1a 20 61 6e 64 20 74 6f 20 6d 61 6b 65 |ory. and to make| 00000950 0d 74 68 65 20 70 72 6f 67 72 61 6d 20 72 75 6e |.the program run| 00000960 20 71 75 69 63 6b 65 72 2e 0d 0d 54 68 65 20 6c | quicker...The l| 00000970 69 6e 65 73 20 34 30 20 26 20 35 30 1a 20 61 6c |ines 40 & 50. al| 00000980 74 65 72 20 74 68 65 20 61 75 74 6f 20 72 65 70 |ter the auto rep| 00000990 65 61 74 20 76 61 6c 75 65 73 20 61 6e 64 20 49 |eat values and I| 000009a0 20 66 6f 75 6e 64 20 77 69 74 68 20 6d 79 20 66 | found with my f| 000009b0 75 6d 62 6c 65 0d 66 69 6e 67 65 72 73 20 74 68 |umble.fingers th| 000009c0 61 74 20 74 68 69 73 20 6d 61 64 65 20 74 68 65 |at this made the| 000009d0 20 63 75 72 73 6f 72 73 1a 20 74 6f 6f 20 66 61 | cursors. too fa| 000009e0 73 74 21 21 20 20 54 68 65 73 65 20 6c 69 6e 65 |st!! These line| 000009f0 73 20 63 61 6e 20 62 65 20 64 65 6c 65 74 65 64 |s can be deleted| 00000a00 0d 69 66 20 61 6e 79 6f 6e 65 20 66 69 6e 64 73 |.if anyone finds| 00000a10 20 74 68 65 6d 20 64 69 66 66 69 63 75 6c 74 20 | them difficult | 00000a20 74 6f 20 63 6f 6e 74 72 6f 6c 2e 0d 0d 0d |to control....| 00000a2e