Home » Archimedes archive » Archimedes World » AW-1995-04-Disc1.adf » Disk1Apr95 » !AWApr95/Goodies/Draw/!DrawBasic/Library/Logo/Example_4
!AWApr95/Goodies/Draw/!DrawBasic/Library/Logo/Example_4
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 » Archimedes archive » Archimedes World » AW-1995-04-Disc1.adf » Disk1Apr95 |
Filename: | !AWApr95/Goodies/Draw/!DrawBasic/Library/Logo/Example_4 |
Read OK: | ✔ |
File size: | 0249 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
REM Hilbert Space Filling Curve REM REM References: REM REM 1) "Turtle Geometry" : H.Abelson & A. diSessa pub. MIT p.93 REM levels=6 �Inches �PathBegin(path) �Turtle(1,2,0) �Hilbert(.05,levels,1) �PathEnd �Quit END DEF �Hilbert(size,level,parity) IF level<>0 THEN �Left(parity*90) : �Hilbert(size,level-1,-parity) : �Forward(size) �Right(parity*90) : �Hilbert(size,level-1,parity) : �Forward(size) �Hilbert(size,level-1,parity) : �Right(parity*90) : �Forward(size) �Hilbert(size,level-1,-parity) : �Left(parity*90) ENDIF ENDPROC
00000000 52 45 4d 20 48 69 6c 62 65 72 74 20 53 70 61 63 |REM Hilbert Spac| 00000010 65 20 46 69 6c 6c 69 6e 67 20 43 75 72 76 65 0a |e Filling Curve.| 00000020 52 45 4d 0a 52 45 4d 20 52 65 66 65 72 65 6e 63 |REM.REM Referenc| 00000030 65 73 3a 0a 52 45 4d 0a 52 45 4d 20 20 20 20 20 |es:.REM.REM | 00000040 20 31 29 20 22 54 75 72 74 6c 65 20 47 65 6f 6d | 1) "Turtle Geom| 00000050 65 74 72 79 22 20 3a 20 48 2e 41 62 65 6c 73 6f |etry" : H.Abelso| 00000060 6e 20 26 20 41 2e 20 64 69 53 65 73 73 61 20 70 |n & A. diSessa p| 00000070 75 62 2e 20 4d 49 54 20 20 70 2e 39 33 0a 52 45 |ub. MIT p.93.RE| 00000080 4d 0a 0a 20 20 20 20 6c 65 76 65 6c 73 3d 36 0a |M.. levels=6.| 00000090 0a 20 20 20 20 20 20 20 0a 20 20 20 20 a0 49 6e |. . .In| 000000a0 63 68 65 73 0a 20 20 20 20 a0 50 61 74 68 42 65 |ches. .PathBe| 000000b0 67 69 6e 28 70 61 74 68 29 0a 20 20 20 20 a0 54 |gin(path). .T| 000000c0 75 72 74 6c 65 28 31 2c 32 2c 30 29 0a 20 20 20 |urtle(1,2,0). | 000000d0 20 a0 48 69 6c 62 65 72 74 28 2e 30 35 2c 6c 65 | .Hilbert(.05,le| 000000e0 76 65 6c 73 2c 31 29 0a 20 20 20 20 a0 50 61 74 |vels,1). .Pat| 000000f0 68 45 6e 64 0a 20 20 20 20 a0 51 75 69 74 0a 0a |hEnd. .Quit..| 00000100 45 4e 44 0a 0a 44 45 46 20 a0 48 69 6c 62 65 72 |END..DEF .Hilber| 00000110 74 28 73 69 7a 65 2c 6c 65 76 65 6c 2c 70 61 72 |t(size,level,par| 00000120 69 74 79 29 0a 20 49 46 20 6c 65 76 65 6c 3c 3e |ity). IF level<>| 00000130 30 20 54 48 45 4e 0a 20 a0 4c 65 66 74 28 70 61 |0 THEN. .Left(pa| 00000140 72 69 74 79 2a 39 30 29 20 3a 20 a0 48 69 6c 62 |rity*90) : .Hilb| 00000150 65 72 74 28 73 69 7a 65 2c 6c 65 76 65 6c 2d 31 |ert(size,level-1| 00000160 2c 2d 70 61 72 69 74 79 29 20 3a 20 a0 46 6f 72 |,-parity) : .For| 00000170 77 61 72 64 28 73 69 7a 65 29 0a 20 a0 52 69 67 |ward(size). .Rig| 00000180 68 74 28 70 61 72 69 74 79 2a 39 30 29 20 3a 20 |ht(parity*90) : | 00000190 a0 48 69 6c 62 65 72 74 28 73 69 7a 65 2c 6c 65 |.Hilbert(size,le| 000001a0 76 65 6c 2d 31 2c 70 61 72 69 74 79 29 20 3a 20 |vel-1,parity) : | 000001b0 a0 46 6f 72 77 61 72 64 28 73 69 7a 65 29 0a 20 |.Forward(size). | 000001c0 a0 48 69 6c 62 65 72 74 28 73 69 7a 65 2c 6c 65 |.Hilbert(size,le| 000001d0 76 65 6c 2d 31 2c 70 61 72 69 74 79 29 20 20 3a |vel-1,parity) :| 000001e0 20 a0 52 69 67 68 74 28 70 61 72 69 74 79 2a 39 | .Right(parity*9| 000001f0 30 29 20 3a 20 a0 46 6f 72 77 61 72 64 28 73 69 |0) : .Forward(si| 00000200 7a 65 29 0a 20 a0 48 69 6c 62 65 72 74 28 73 69 |ze). .Hilbert(si| 00000210 7a 65 2c 6c 65 76 65 6c 2d 31 2c 2d 70 61 72 69 |ze,level-1,-pari| 00000220 74 79 29 20 3a 20 a0 4c 65 66 74 28 70 61 72 69 |ty) : .Left(pari| 00000230 74 79 2a 39 30 29 20 0a 20 45 4e 44 49 46 0a 45 |ty*90) . ENDIF.E| 00000240 4e 44 50 52 4f 43 0a 0a 0a |NDPROC...| 00000249