Home » CEEFAX disks » telesoftware16.adl » 08-07-89/Mandel2
08-07-89/Mandel2
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 » CEEFAX disks » telesoftware16.adl |
Filename: | 08-07-89/Mandel2 |
Read OK: | ✔ |
File size: | 042E bytes |
Load address: | FFFF0E00 |
Exec address: | FFFF8023 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- AEW website » au » au_5_25_discs_Acorn_User_93_10_tau93-10.ssd » MANDEL
- CEEFAX disks » telesoftware16.adl » 08-07-89/Mandel2
File contents
10REM Fifth Roots 20REM by David Johnson-Davies 30REM for BBC B/B+/M/C/E 40REM (c) Acorn User May 1987 50: 60TIME=0 70MODE 2:e=.001 80VDU 28,16,31,19,0 90INPUT"x,y:"j,k 100INPUT" s:"q 110VDU 19,1,6;0;19,4,1;0;19,6,4;0; 120Q%=1024:M%=1 130REPEAT 140i=q/M%:I%=Q%/M% 150FOR J%=0 TO M%-1 160FOR K%=0 TO M%-1 170IF K% MOD 2 OR J% MOD 2 PROCpt 180NEXT:NEXT 190M%=M%*2:PRINT M% 200UNTIL M%=256 210T%=TIME:PRINT T%/100 " SECS." 220END 230: 240DEF PROCplus(u,v) 250x=x+u:y=y+v:ENDPROC 260: 270DEF PROCtimes(u,v):LOCAL t 280t=x*u-y*v:y=x*v+y*u:x=t:ENDPROC 290: 300DEF PROCdivide(u,v):LOCAL t,d 310d=u*u+v*v:t=x*u+y*v 320y=(y*u-x*v)/d:x=t/d:ENDPROC 330: 340DEF FNn(x,y) 350N%=-1:IF x=0 AND y=0 =0 360REPEAT u=x:v=y 370PROCtimes(u,v):PROCtimes(u,v):PROCtimes(u,v):x4=x:y4=y 380PROCtimes(u,v):x5=x-1:y5=y 390x=4*x+1:y=4*y 400PROCdivide(5*x4,5*y4) 410N%=N%+1 420UNTIL x*x+y*y>1E7 OR x5*x5+y5*y5<e 430IF x*x+y*y>1E7 =0 ELSE =N% 440: 450DEF PROCpt 460x=j+i*J%:y=k+i*K% 470PROCgcol(FNn(x,y) MOD 16) 480X%=J%*I%:Y%=K%*I% 490MOVE X%,Y%:MOVE X%+I%-1,Y% 500PLOT 85,X%,Y%+I%-1 510PLOT 85,X%+I%-1,Y%+I%-1 520ENDPROC 530: 540DEF PROCgcol(B%) 550GCOL 0,B%/2:ENDPROC 560: 570DEF PROCgcol(B%) 580D%=B% DIV 2 590E%=(D%+B% MOD 2) MOD 8 600VDU 23,12,D%,E%,E%,D%,D%,E%,E%,D% 610GCOL 16,0 620ENDPROC
� Fifth Roots � by David Johnson-Davies � for BBC B/B+/M/C/E (� (c) Acorn User May 1987 2: <�=0 F� 2:e=.001 P� 28,16,31,19,0 Z�"x,y:"j,k d�" s:"q n!� 19,1,6;0;19,4,1;0;19,6,4;0; xQ%=1024:M%=1 �� �i=q/M%:I%=Q%/M% �� J%=0 � M%-1 �� K%=0 � M%-1 �� K% � 2 � J% � 2 �pt ��:� �M%=M%*2:� M% �� M%=256 �T%=�:� T%/100 " SECS." �� �: �� �plus(u,v) �x=x+u:y=y+v:� : � �times(u,v):� t t=x*u-y*v:y=x*v+y*u:x=t:� ": ,� �divide(u,v):� t,d 6d=u*u+v*v:t=x*u+y*v @y=(y*u-x*v)/d:x=t/d:� J: T � �n(x,y) ^N%=-1:� x=0 � y=0 =0 h � u=x:v=y r1�times(u,v):�times(u,v):�times(u,v):x4=x:y4=y |�times(u,v):x5=x-1:y5=y �x=4*x+1:y=4*y ��divide(5*x4,5*y4) �N%=N%+1 �!� x*x+y*y>1E7 � x5*x5+y5*y5<e �� x*x+y*y>1E7 =0 � =N% �: � � �pt �x=j+i*J%:y=k+i*K% ��gcol(�n(x,y) � 16) �X%=J%*I%:Y%=K%*I% �� X%,Y%:� X%+I%-1,Y% �� 85,X%,Y%+I%-1 �� 85,X%+I%-1,Y%+I%-1 � : � �gcol(B%) &� 0,B%/2:� 0: :� �gcol(B%) D D%=B% � 2 NE%=(D%+B% � 2) � 8 X#� 23,12,D%,E%,E%,D%,D%,E%,E%,D% b � 16,0 l� �
00000000 0d 00 0a 11 f4 20 46 69 66 74 68 20 52 6f 6f 74 |..... Fifth Root| 00000010 73 0d 00 14 1d f4 20 62 79 20 44 61 76 69 64 20 |s..... by David | 00000020 4a 6f 68 6e 73 6f 6e 2d 44 61 76 69 65 73 0d 00 |Johnson-Davies..| 00000030 1e 18 f4 20 66 6f 72 20 42 42 43 20 42 2f 42 2b |... for BBC B/B+| 00000040 2f 4d 2f 43 2f 45 0d 00 28 1d f4 20 28 63 29 20 |/M/C/E..(.. (c) | 00000050 41 63 6f 72 6e 20 55 73 65 72 20 4d 61 79 20 31 |Acorn User May 1| 00000060 39 38 37 0d 00 32 05 3a 0d 00 3c 07 d1 3d 30 0d |987..2.:..<..=0.| 00000070 00 46 0e eb 20 32 3a 65 3d 2e 30 30 31 0d 00 50 |.F.. 2:e=.001..P| 00000080 13 ef 20 32 38 2c 31 36 2c 33 31 2c 31 39 2c 30 |.. 28,16,31,19,0| 00000090 0d 00 5a 0e e8 22 78 2c 79 3a 22 6a 2c 6b 0d 00 |..Z.."x,y:"j,k..| 000000a0 64 0c e8 22 20 20 73 3a 22 71 0d 00 6e 21 ef 20 |d.." s:"q..n!. | 000000b0 31 39 2c 31 2c 36 3b 30 3b 31 39 2c 34 2c 31 3b |19,1,6;0;19,4,1;| 000000c0 30 3b 31 39 2c 36 2c 34 3b 30 3b 0d 00 78 10 51 |0;19,6,4;0;..x.Q| 000000d0 25 3d 31 30 32 34 3a 4d 25 3d 31 0d 00 82 05 f5 |%=1024:M%=1.....| 000000e0 0d 00 8c 13 69 3d 71 2f 4d 25 3a 49 25 3d 51 25 |....i=q/M%:I%=Q%| 000000f0 2f 4d 25 0d 00 96 11 e3 20 4a 25 3d 30 20 b8 20 |/M%..... J%=0 . | 00000100 4d 25 2d 31 0d 00 a0 11 e3 20 4b 25 3d 30 20 b8 |M%-1..... K%=0 .| 00000110 20 4d 25 2d 31 0d 00 aa 19 e7 20 4b 25 20 83 20 | M%-1..... K% . | 00000120 32 20 84 20 4a 25 20 83 20 32 20 f2 70 74 0d 00 |2 . J% . 2 .pt..| 00000130 b4 07 ed 3a ed 0d 00 be 10 4d 25 3d 4d 25 2a 32 |...:.....M%=M%*2| 00000140 3a f1 20 4d 25 0d 00 c8 0c fd 20 4d 25 3d 32 35 |:. M%..... M%=25| 00000150 36 0d 00 d2 1a 54 25 3d 91 3a f1 20 54 25 2f 31 |6....T%=.:. T%/1| 00000160 30 30 20 22 20 53 45 43 53 2e 22 0d 00 dc 05 e0 |00 " SECS.".....| 00000170 0d 00 e6 05 3a 0d 00 f0 10 dd 20 f2 70 6c 75 73 |....:..... .plus| 00000180 28 75 2c 76 29 0d 00 fa 11 78 3d 78 2b 75 3a 79 |(u,v)....x=x+u:y| 00000190 3d 79 2b 76 3a e1 0d 01 04 05 3a 0d 01 0e 15 dd |=y+v:.....:.....| 000001a0 20 f2 74 69 6d 65 73 28 75 2c 76 29 3a ea 20 74 | .times(u,v):. t| 000001b0 0d 01 18 1d 74 3d 78 2a 75 2d 79 2a 76 3a 79 3d |....t=x*u-y*v:y=| 000001c0 78 2a 76 2b 79 2a 75 3a 78 3d 74 3a e1 0d 01 22 |x*v+y*u:x=t:..."| 000001d0 05 3a 0d 01 2c 18 dd 20 f2 64 69 76 69 64 65 28 |.:..,.. .divide(| 000001e0 75 2c 76 29 3a ea 20 74 2c 64 0d 01 36 17 64 3d |u,v):. t,d..6.d=| 000001f0 75 2a 75 2b 76 2a 76 3a 74 3d 78 2a 75 2b 79 2a |u*u+v*v:t=x*u+y*| 00000200 76 0d 01 40 19 79 3d 28 79 2a 75 2d 78 2a 76 29 |v..@.y=(y*u-x*v)| 00000210 2f 64 3a 78 3d 74 2f 64 3a e1 0d 01 4a 05 3a 0d |/d:x=t/d:...J.:.| 00000220 01 54 0d dd 20 a4 6e 28 78 2c 79 29 0d 01 5e 18 |.T.. .n(x,y)..^.| 00000230 4e 25 3d 2d 31 3a e7 20 78 3d 30 20 80 20 79 3d |N%=-1:. x=0 . y=| 00000240 30 20 3d 30 0d 01 68 0d f5 20 75 3d 78 3a 76 3d |0 =0..h.. u=x:v=| 00000250 79 0d 01 72 31 f2 74 69 6d 65 73 28 75 2c 76 29 |y..r1.times(u,v)| 00000260 3a f2 74 69 6d 65 73 28 75 2c 76 29 3a f2 74 69 |:.times(u,v):.ti| 00000270 6d 65 73 28 75 2c 76 29 3a 78 34 3d 78 3a 79 34 |mes(u,v):x4=x:y4| 00000280 3d 79 0d 01 7c 1b f2 74 69 6d 65 73 28 75 2c 76 |=y..|..times(u,v| 00000290 29 3a 78 35 3d 78 2d 31 3a 79 35 3d 79 0d 01 86 |):x5=x-1:y5=y...| 000002a0 11 78 3d 34 2a 78 2b 31 3a 79 3d 34 2a 79 0d 01 |.x=4*x+1:y=4*y..| 000002b0 90 16 f2 64 69 76 69 64 65 28 35 2a 78 34 2c 35 |...divide(5*x4,5| 000002c0 2a 79 34 29 0d 01 9a 0b 4e 25 3d 4e 25 2b 31 0d |*y4)....N%=N%+1.| 000002d0 01 a4 21 fd 20 78 2a 78 2b 79 2a 79 3e 31 45 37 |..!. x*x+y*y>1E7| 000002e0 20 84 20 78 35 2a 78 35 2b 79 35 2a 79 35 3c 65 | . x5*x5+y5*y5<e| 000002f0 0d 01 ae 1a e7 20 78 2a 78 2b 79 2a 79 3e 31 45 |..... x*x+y*y>1E| 00000300 37 20 3d 30 20 8b 20 3d 4e 25 0d 01 b8 05 3a 0d |7 =0 . =N%....:.| 00000310 01 c2 09 dd 20 f2 70 74 0d 01 cc 15 78 3d 6a 2b |.... .pt....x=j+| 00000320 69 2a 4a 25 3a 79 3d 6b 2b 69 2a 4b 25 0d 01 d6 |i*J%:y=k+i*K%...| 00000330 17 f2 67 63 6f 6c 28 a4 6e 28 78 2c 79 29 20 83 |..gcol(.n(x,y) .| 00000340 20 31 36 29 0d 01 e0 15 58 25 3d 4a 25 2a 49 25 | 16)....X%=J%*I%| 00000350 3a 59 25 3d 4b 25 2a 49 25 0d 01 ea 18 ec 20 58 |:Y%=K%*I%..... X| 00000360 25 2c 59 25 3a ec 20 58 25 2b 49 25 2d 31 2c 59 |%,Y%:. X%+I%-1,Y| 00000370 25 0d 01 f4 13 f0 20 38 35 2c 58 25 2c 59 25 2b |%..... 85,X%,Y%+| 00000380 49 25 2d 31 0d 01 fe 18 f0 20 38 35 2c 58 25 2b |I%-1..... 85,X%+| 00000390 49 25 2d 31 2c 59 25 2b 49 25 2d 31 0d 02 08 05 |I%-1,Y%+I%-1....| 000003a0 e1 0d 02 12 05 3a 0d 02 1c 0f dd 20 f2 67 63 6f |.....:..... .gco| 000003b0 6c 28 42 25 29 0d 02 26 0e e6 20 30 2c 42 25 2f |l(B%)..&.. 0,B%/| 000003c0 32 3a e1 0d 02 30 05 3a 0d 02 3a 0f dd 20 f2 67 |2:...0.:..:.. .g| 000003d0 63 6f 6c 28 42 25 29 0d 02 44 0d 44 25 3d 42 25 |col(B%)..D.D%=B%| 000003e0 20 81 20 32 0d 02 4e 16 45 25 3d 28 44 25 2b 42 | . 2..N.E%=(D%+B| 000003f0 25 20 83 20 32 29 20 83 20 38 0d 02 58 23 ef 20 |% . 2) . 8..X#. | 00000400 32 33 2c 31 32 2c 44 25 2c 45 25 2c 45 25 2c 44 |23,12,D%,E%,E%,D| 00000410 25 2c 44 25 2c 45 25 2c 45 25 2c 44 25 0d 02 62 |%,D%,E%,E%,D%..b| 00000420 0a e6 20 31 36 2c 30 0d 02 6c 05 e1 0d ff |.. 16,0..l....| 0000042e