Home » Archimedes archive » Acorn User » AU 1997-03 B.adf » Regulars » StarInfo/Writhe/Writhe2
StarInfo/Writhe/Writhe2
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 » Acorn User » AU 1997-03 B.adf » Regulars |
Filename: | StarInfo/Writhe/Writhe2 |
Read OK: | ✔ |
File size: | 03C8 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM >Writhe2 by dL 11ON ERROR PRINT REPORT$;" at line ";ERL:END 20MODE 31:OFF:ORIGIN 800,600 30m=2 31times=8 32step = 360/times 40DIM x(m),y(m),a(m),d(m),l(m),e(m) 50FOR w=0 TO m-1 60 x(w)=0 70 y(w)=0 80 a(w)=RND(1)*360 90NEXT 100DIM g(14) 110FOR i=0 TO 5 120g(i)=(i*3)*17 130g(10-i)=(i*3)*17 140NEXT 150c=0 160t=0 170PROCcycle 180REPEAT 190 GCOL (t MOD 15)+1 200 t+=1 210 FOR w=0 TO m-1 220 IF l(w)=0 THEN 230 l(w)=RND(15)+12 240 d(w)=(RND(1)*180-90) 250 e(w)=l(w) 260 ENDIF 270 x(w)+=SINRAD(a(w))*2 280 y(w)+=COSRAD(a(w))*2 330 r=16*SINRAD(t) 340 d=SQR(x(w)^2+y(w)^2) 341 a=DEGFNatan2(x(w),y(w)) 342 FOR i=0 TO 360-1 STEP step 343 x=d*SINRAD(a+i) 344 y=d*COSRAD(a+i) 360 CIRCLE FILLx, y,r 361 NEXT 440 a(w)+=d(w)/e(w) 450 l(w)-=1 460 NEXT 470 PROCcycle 480UNTIL 0 490 500DEF PROCcycle 510WAIT 520FOR j=0 TO 14 530COLOUR (c+j)MOD15+1,g(j),g(j),g(j) 540NEXT 550c=(c+1)MOD15 560ENDPROC 561 570DEF FNatan2(x,y) 580IF x=0 THEN =SGN(y)*PI/2 590IF y>=0 THEN 600 IF x>=0 THEN 610 =ATN(ABS(y)/ABS(x)) 620 ELSE 630 =PI - ATN(ABS(y)/ABS(x)) 640 ENDIF 650ELSE 660 IF x>=0 THEN 670 =-ATN(ABS(y)/ABS(x)) 680 ELSE 690 =PI+ATN(ABS(y)/ABS(x)) 700 ENDIF 710ENDIF
� >Writhe2 by dL � � � �$;" at line ";�:� � 31:�:ȑ 800,600 m=2 times=8 step = 360/times (#� x(m),y(m),a(m),d(m),l(m),e(m) 2� w=0 � m-1 < x(w)=0 F y(w)=0 P a(w)=�(1)*360 Z� d� g(14) n � i=0 � 5 xg(i)=(i*3)*17 �g(10-i)=(i*3)*17 �� �c=0 �t=0 � �cycle �� � � (t � 15)+1 � t+=1 � � w=0 � m-1 � � l(w)=0 � � l(w)=�(15)+12 � d(w)=(�(1)*180-90) � e(w)=l(w) � x(w)+=��(a(w))*2 y(w)+=��(a(w))*2 J r=16*��(t) T d=�(x(w)^2+y(w)^2) U a=��atan2(x(w),y(w)) V � i=0 � 360-1 � step W x=d*��(a+i) X y=d*��(a+i) h ȏ Ȑx, y,r i � � a(w)+=d(w)/e(w) � l(w)-=1 � � � �cycle �� 0 � �� �cycle �Ȗ � j=0 � 14 � (c+j)�15+1,g(j),g(j),g(j) � &c=(c+1)�15 0� 1 :� �atan2(x,y) D� x=0 � =�(y)*�/2 N� y>=0 � X � x>=0 � b =�(�(y)/�(x)) l � v =� - �(�(y)/�(x)) � � �� � � x>=0 � � =-�(�(y)/�(x)) � � � =�+�(�(y)/�(x)) � � �� �
00000000 0d 00 0a 14 f4 20 3e 57 72 69 74 68 65 32 20 62 |..... >Writhe2 b| 00000010 79 20 64 4c 0d 00 0b 1c ee 20 85 20 f1 20 f6 24 |y dL..... . . .$| 00000020 3b 22 20 61 74 20 6c 69 6e 65 20 22 3b 9e 3a e0 |;" at line ";.:.| 00000030 0d 00 14 15 eb 20 33 31 3a 87 3a c8 91 20 38 30 |..... 31:.:.. 80| 00000040 30 2c 36 30 30 0d 00 1e 07 6d 3d 32 0d 00 1f 0b |0,600....m=2....| 00000050 74 69 6d 65 73 3d 38 0d 00 20 14 73 74 65 70 20 |times=8.. .step | 00000060 3d 20 33 36 30 2f 74 69 6d 65 73 0d 00 28 23 de |= 360/times..(#.| 00000070 20 78 28 6d 29 2c 79 28 6d 29 2c 61 28 6d 29 2c | x(m),y(m),a(m),| 00000080 64 28 6d 29 2c 6c 28 6d 29 2c 65 28 6d 29 0d 00 |d(m),l(m),e(m)..| 00000090 32 0f e3 20 77 3d 30 20 b8 20 6d 2d 31 0d 00 3c |2.. w=0 . m-1..<| 000000a0 0b 20 78 28 77 29 3d 30 0d 00 46 0b 20 79 28 77 |. x(w)=0..F. y(w| 000000b0 29 3d 30 0d 00 50 12 20 61 28 77 29 3d b3 28 31 |)=0..P. a(w)=.(1| 000000c0 29 2a 33 36 30 0d 00 5a 05 ed 0d 00 64 0b de 20 |)*360..Z....d.. | 000000d0 67 28 31 34 29 0d 00 6e 0d e3 20 69 3d 30 20 b8 |g(14)..n.. i=0 .| 000000e0 20 35 0d 00 78 11 67 28 69 29 3d 28 69 2a 33 29 | 5..x.g(i)=(i*3)| 000000f0 2a 31 37 0d 00 82 14 67 28 31 30 2d 69 29 3d 28 |*17....g(10-i)=(| 00000100 69 2a 33 29 2a 31 37 0d 00 8c 05 ed 0d 00 96 07 |i*3)*17.........| 00000110 63 3d 30 0d 00 a0 07 74 3d 30 0d 00 aa 0a f2 63 |c=0....t=0.....c| 00000120 79 63 6c 65 0d 00 b4 05 f5 0d 00 be 11 20 e6 20 |ycle......... . | 00000130 28 74 20 83 20 31 35 29 2b 31 0d 00 c8 09 20 74 |(t . 15)+1.... t| 00000140 2b 3d 31 0d 00 d2 10 20 e3 20 77 3d 30 20 b8 20 |+=1.... . w=0 . | 00000150 6d 2d 31 0d 00 dc 10 20 20 e7 20 6c 28 77 29 3d |m-1.... . l(w)=| 00000160 30 20 8c 0d 00 e6 14 20 20 20 6c 28 77 29 3d b3 |0 ..... l(w)=.| 00000170 28 31 35 29 2b 31 32 0d 00 f0 19 20 20 20 64 28 |(15)+12.... d(| 00000180 77 29 3d 28 b3 28 31 29 2a 31 38 30 2d 39 30 29 |w)=(.(1)*180-90)| 00000190 0d 00 fa 10 20 20 20 65 28 77 29 3d 6c 28 77 29 |.... e(w)=l(w)| 000001a0 0d 01 04 07 20 20 cd 0d 01 0e 16 20 20 78 28 77 |.... ..... x(w| 000001b0 29 2b 3d b5 b2 28 61 28 77 29 29 2a 32 0d 01 18 |)+=..(a(w))*2...| 000001c0 16 20 20 79 28 77 29 2b 3d 9b b2 28 61 28 77 29 |. y(w)+=..(a(w)| 000001d0 29 2a 32 0d 01 4a 10 20 20 72 3d 31 36 2a b5 b2 |)*2..J. r=16*..| 000001e0 28 74 29 0d 01 54 18 20 20 64 3d b6 28 78 28 77 |(t)..T. d=.(x(w| 000001f0 29 5e 32 2b 79 28 77 29 5e 32 29 0d 01 55 1a 20 |)^2+y(w)^2)..U. | 00000200 20 61 3d 9d a4 61 74 61 6e 32 28 78 28 77 29 2c | a=..atan2(x(w),| 00000210 79 28 77 29 29 0d 01 56 1a 20 20 e3 20 69 3d 30 |y(w))..V. . i=0| 00000220 20 b8 20 33 36 30 2d 31 20 88 20 73 74 65 70 0d | . 360-1 . step.| 00000230 01 57 12 20 20 20 78 3d 64 2a b5 b2 28 61 2b 69 |.W. x=d*..(a+i| 00000240 29 0d 01 58 12 20 20 20 79 3d 64 2a 9b b2 28 61 |)..X. y=d*..(a| 00000250 2b 69 29 0d 01 68 12 20 20 20 c8 8f 20 c8 90 78 |+i)..h. .. ..x| 00000260 2c 20 79 2c 72 0d 01 69 07 20 20 ed 0d 01 b8 15 |, y,r..i. .....| 00000270 20 20 61 28 77 29 2b 3d 64 28 77 29 2f 65 28 77 | a(w)+=d(w)/e(w| 00000280 29 0d 01 c2 0d 20 20 6c 28 77 29 2d 3d 31 0d 01 |).... l(w)-=1..| 00000290 cc 06 20 ed 0d 01 d6 0b 20 f2 63 79 63 6c 65 0d |.. ..... .cycle.| 000002a0 01 e0 07 fd 20 30 0d 01 ea 04 0d 01 f4 0c dd 20 |.... 0......... | 000002b0 f2 63 79 63 6c 65 0d 01 fe 06 c8 96 0d 02 08 0e |.cycle..........| 000002c0 e3 20 6a 3d 30 20 b8 20 31 34 0d 02 12 1f fb 20 |. j=0 . 14..... | 000002d0 28 63 2b 6a 29 83 31 35 2b 31 2c 67 28 6a 29 2c |(c+j).15+1,g(j),| 000002e0 67 28 6a 29 2c 67 28 6a 29 0d 02 1c 05 ed 0d 02 |g(j),g(j).......| 000002f0 26 0e 63 3d 28 63 2b 31 29 83 31 35 0d 02 30 05 |&.c=(c+1).15..0.| 00000300 e1 0d 02 31 04 0d 02 3a 11 dd 20 a4 61 74 61 6e |...1...:.. .atan| 00000310 32 28 78 2c 79 29 0d 02 44 15 e7 20 78 3d 30 20 |2(x,y)..D.. x=0 | 00000320 8c 20 3d b4 28 79 29 2a af 2f 32 0d 02 4e 0c e7 |. =.(y)*./2..N..| 00000330 20 79 3e 3d 30 20 8c 0d 02 58 0d 20 e7 20 78 3e | y>=0 ...X. . x>| 00000340 3d 30 20 8c 0d 02 62 13 20 20 3d 99 28 94 28 79 |=0 ...b. =.(.(y| 00000350 29 2f 94 28 78 29 29 0d 02 6c 06 20 cc 0d 02 76 |)/.(x))..l. ...v| 00000360 17 20 20 3d af 20 2d 20 99 28 94 28 79 29 2f 94 |. =. - .(.(y)/.| 00000370 28 78 29 29 0d 02 80 06 20 cd 0d 02 8a 05 cc 0d |(x)).... .......| 00000380 02 94 0d 20 e7 20 78 3e 3d 30 20 8c 0d 02 9e 14 |... . x>=0 .....| 00000390 20 20 3d 2d 99 28 94 28 79 29 2f 94 28 78 29 29 | =-.(.(y)/.(x))| 000003a0 0d 02 a8 06 20 cc 0d 02 b2 15 20 20 3d af 2b 99 |.... ..... =.+.| 000003b0 28 94 28 79 29 2f 94 28 78 29 29 0d 02 bc 06 20 |(.(y)/.(x)).... | 000003c0 cd 0d 02 c6 05 cd 0d ff |........| 000003c8