This clever animation displays a carbon atom with its 12 electrons moving around it in elliptical orbits. The electrons are displayed using Exclusive OR sprite plotting, with the effect that they take on an aetherial mantle which highly befits their quantum state.
In addition to the central animation, the authors have used a clever routine (PROC text) to display the word "ATOM" in large text and in a colour which varies with position.
To run the program you will need a screen size of 160K and 8K of sprite space.
10 REM >Carbon
20 REM Program Carbon Atom
30 REM Version A 0.3
40 REM Authors C & N Westley
50 REM RISC User June 1989
60 REM Program Subject to Copyright
70 :
80 MODE 15
90 PROCinit
100 PROCtext
110 PROCcalc_electrons
120 PROCnucleus
130 PROCanimate
140 END
150 :
160 DEFPROCinit
170 DIM X1(61),Y1(61),X2(61),Y2(61)
180 DIM X3(61),Y3(61),X4(61),Y4(61)
190 DIM X5(61),Y5(61),X6(61),Y6(61)
200 DIM X7(61),Y7(61),X8(61),Y8(61)
210 DIM X9(61),Y9(61),X10(61),Y10(61)
220 DIM X11(61),Y11(61),X12(61),Y12(61)
230 OX1=-100:OY1=0:OX2=-100:OY2=0
240 OX3=-100:OY3=0:OX4=-100:OY4=0
250 OX5=-100:OY5=0:OX6=-100:OY6=0
260 OX7=-100:OY7=0:OX8=-100:OY8=0
270 OX9=-100:OY9=0:OX10=-100:OY10=0
280 OX11=-100:OY11=0:OX12=-100:OY12=0
290 ENDPROC
300 :
310 DEFPROCanimate
320 GCOL 3,3
330 REPEAT
340 FOR D=0 TO 59
350 PLOT &ED,OX1,OY1:PLOT &ED,X1(D),Y1(D):OX1=X1(D):OY1=Y1(D)
360 PLOT &ED,OX2,OY2:PLOT &ED,X2(D),Y2(D):OX2=X2(D):OY2=Y2(D)
370 PLOT &ED,OX3,OY3:PLOT &ED,X3(D),Y3(D):OX3=X3(D):OY3=Y3(D)
380 PLOT &ED,OX4,OY4:PLOT &ED,X4(D),Y4(D):OX4=X4(D):OY4=Y4(D)
390 PLOT &ED,OX5,OY5:PLOT &ED,X5(D),Y5(D):OX5=X5(D):OY5=Y5(D)
400 PLOT &ED,OX6,OY6:PLOT &ED,X6(D),Y6(D):OX6=X6(D):OY6=Y6(D)
410 PLOT &ED,OX7,OY7:PLOT &ED,X7(D),Y7(D):OX7=X7(D):OY7=Y7(D)
420 PLOT &ED,OX8,OY8:PLOT &ED,X8(D),Y8(D):OX8=X8(D):OY8=Y8(D)
430 PLOT &ED,OX9,OY9:PLOT &ED,X9(D),Y9(D):OX9=X9(D):OY9=Y9(D)
440 PLOT &ED,OX10,OY10:PLOT &ED,X10(D),Y10(D):OX10=X10(D):OY10=Y10(D)
450 PLOT &ED,OX11,OY11:PLOT &ED,X11(D),Y11(D):OX11=X11(D):OY11=Y11(D)
460 PLOT &ED,OX12,OY12:PLOT &ED,X12(D),Y12(D):OX12=X12(D):OY12=Y12(D)
470 NEXT
480 UNTIL FALSE
490 :
500 DEF PROCcalc_electrons
510 xcentre=620:ycentre=510:A=0:E=44
520 FOR D=0 TO 59
530 A+=PI/30
540 xradius=450:yradius=200
550 an=RAD(270):X1(D)=FNX:Y1(D)=FNY
560 xradius=550:yradius=180
570 an=RAD(35) :X2(D)=FNX:Y2(D)=FNY
580 xradius=420:yradius=280
590 an=RAD(170):X3(D)=FNX:Y3(D)=FNY
600 xradius=450:yradius=300
610 an=RAD(120):X4(D)=FNX:Y4(D)=FNY
620 xradius=480:yradius=250
630 an=RAD(100):X5(D)=FNX:Y5(D)=FNY
640 xradius=400:yradius=250
650 an=RAD(230):X6(D)=FNX:Y6(D)=FNY
660 GCOL 78:PLOT 69,X1(D),Y1(D)
670 GCOL 79:PLOT 69,X2(D),Y2(D)
680 GCOL 63:PLOT 69,X3(D),Y3(D)
690 GCOL 3 :PLOT 69,X4(D),Y4(D)
700 GCOL 78:PLOT 69,X5(D),Y5(D)
710 GCOL 79:PLOT 69,X6(D),Y6(D)
720 E+=1:IF E=60 E=0
730 xradius=450:yradius=200
740 an=RAD(30):X7(E)=FNX:Y7(E)=FNY
750 xradius=480:yradius=250
760 an=RAD(75):X8(E)=FNX:Y8(E)=FNY
770 xradius=400:yradius=190
780 an=RAD(320):X9(E)=FNX:Y9(E)=FNY
790 xradius=600:yradius=300
800 an=RAD(200):X10(E)=FNX:Y10(E)=FNY
810 xradius=420:yradius=250
820 an=RAD(130):X11(E)=FNX:Y11(E)=FNY
830 xradius=450:yradius=270
840 an=RAD(280):X12(E)=FNX:Y12(E)=FNY
850 GCOL 63:PLOT 69,X7(E),Y7(E)
860 GCOL 3:PLOT 69,X8(E),Y8(E)
870 GCOL 3:PLOT 69,X9(E),Y9(E)
880 GCOL 79:PLOT 69,X10(E),Y10(E)
890 GCOL 63:PLOT 69,X11(E),Y11(E)
900 GCOL 32:PLOT 69,X12(E),Y12(E)
910 NEXT
920 ENDPROC
930 :
940 DEFFNX=INT((xradius*COS(A))*COS(an)-(yradius*SIN(A))*SIN(an)+xcentre)
950 DEFFNY=INT((xradius*COS(A))*SIN(an)+(yradius*SIN(A))*COS(an)+ycentre)
960 :
970 DEF PROCnucleus
980 FOR LOOP=0 TO 11
990 READ x,y,C
1000 X=48:T=-64
1010 FOR L=0 TO 7
1020 X-=6:T+=64
1030 IF T=256 THEN C+=&15
1040 GCOL C TINT T
1050 CIRCLE FILL x,y,X
1060 NEXT:NEXT
1070 MOVE 0,0:MOVE 84,84
1080 *SGET RED
1090 *SCHOOSE RED
1100 PLOT &EF,0,0
1110 ENDPROC
1120 :
1130 DATA 625,615,4, 584,570,5
1140 DATA 561,512,9, 609,460,10
1150 DATA 682,470,4, 707,534,9
1160 DATA 690,585,5, 635,597,10
1170 DATA 605,587,4, 613,522,10
1180 DATA 663,543,9, 42,42,1
1190 :
1200 DEF PROCtext
1210 VDU 5:GCOL 0 TINT 64:MOVE 0,32
1220 PRINT"ATOM":VDU4:OFF
1230 FOR X=0 TO 63 STEP 2
1240 c%=6: t%=-64
1250 FOR Y=0 TO 32 STEP 4
1260 IF t%=256 c%+=&15
1270 GCOL c% TINT t%
1280 t%+=64
1290 A=X*3:B=Y*3
1300 IF TINT(X,Y)>0 THEN RECTANGLE FILL
A,900+B,6,9
1310 NEXT,
1320 RECTANGLE 0,900,240,104 TO 1040,0
1330 ENDPROC