REM Changed by P.A.Riley 9/10/1990, revised 26/12/2002 REM PHASES OF THE MOON after "Simon" MODE4:OFF VDU23;8202;0;0;0;:REM Cursor off xcentre=640:ycentre=512:radius=432:steps=-8 PRINT TAB(11,14);"PHASES OF THE MOON" PROCwait(3) REM A new character VDU 23,240,24,24,24,24,24,24,24,24 VDU5 :MOVE 1140,900:PRINT"^" MOVE1140,892:PRINT CHR$(240);"N":VDU4 REM Plot some stars FOR I=1 TO 150+RND(150) PLOT69,RND(1280),RND(1024) PLOT1,0,RND(4):PLOT1,RND(4),0:PLOT1,0,-RND(4):PROCwait(.01) NEXT PROCwait(5) PRINT TAB(0,3);"NIGHT 0" MOVE xcentre,ycentre+radius:PLOT0, 0,-4 FOR Y=radius TO -radius STEP steps REM The x coordinate of a circle. X=SQR(radius*radius-Y*Y) PLOT 85,xcentre-X,ycentre+Y PLOT 85,xcentre+X,ycentre+Y NEXT PROCwait(1) REM The moon wanes for 14 nights FOR N=1 TO 14 PRINT TAB(6,3);N MOVE xcentre,ycentre+radius:PLOT0,0,-4 FOR Y=radius TO -radius STEP steps REM The coordinates of last night's and tonight's ellipses. X1=SQR(radius*radius-Y*Y)*COS(N*PI/14) X2=SQR(radius*radius-Y*Y)*COS((N-1)*PI/14) REM Take away the difference. PLOT87,xcentre+X1,ycentre+Y PLOT87,xcentre+X2,ycentre+Y NEXT PROCwait(2) NEXT REM The moon waxes for 14 nights FOR N=15 TO 28 PRINT TAB(6,3);N MOVE xcentre,ycentre+radius:PLOT0,0,-4 FOR Y=radius TO -radius STEP steps REM The coordinates of last night's and tonight's ellipses. X1=SQR(radius*radius-Y*Y)*COS(N*PI/14) X2=SQR(radius*radius-Y*Y)*COS((N-1)*PI/14) REM Plot in the difference. PLOT85,xcentre-X2,ycentre+Y PLOT85,xcentre-X1,ycentre+Y NEXT PROCwait(1) NEXT END DEF PROCwait(n) TIME=0:REPEAT UNTIL TIME>100*n ENDPROC