bryan (01/17/83)
This sketch program uses paddles to sketch on the screen. The buttons on the paddles control erasing, filling, and the lifting of the "pen"; when the pen is up (off the screen), the other button controls the fill. when the "pen" is down (on the screen), the other button will erase the screen. To change the color, retype line 50, substituting any number between 0 and 15 for 1. ihlpb!bryan 1 REM PLUG PADDLES INTO PORT 2 5 DIM A(2000),B(2000) 10 GRAPHICS 7+16 20 SETCOLOR 4,0,11:COLOR 0 30 X=INT((PADDLE(2)/228)*159) 40 Y=INT((PADDLE(3)/228)*95) 50 INK=1 60 SETCOLOR 0,INK,4:COLOR 1:PLOTX,Y 70 DRAWTO X,Y 80 X=INT((PADDLE(2)/228)*159) 90 Y=INT((PADDLE(3)/228)*95) 100 IF PTRIG(2)=0 THEN 10 110 IF PTRIG(3)=0 THEN FOR I=0 TO 150:NEXT I:COLOR 1:GOTO 200 120 GOTO 70 200 LOCATE X,Y,K 210 X1=INT((PADDLE(2)/228)*159) 220 Y1=INT((PADDLE(3)/228)*95) 225 IF X1=X and Y1=Y THEN BK=1-BK:COLOR BK:PLOT X1,Y1:GOTO 250 230 COLOR K:PLOT X,Y 250 IF PTRIG(3)=0 THEN FOR I=0 TO 150:NEXT I:COLOR 1:GOTO 120 240 X=X1:Y=Y1:GOTO 200 260 IF PTRIG(2)=0 THEN COLOR K:PLOT X,Y:GOSUB 300:GOTO 200 270 GOTO 210 300 P=1:A(P)=X:B(P)=Y:COLOR 1 310 GOSUB 350:IF P THEN 310 320 RETURN 350 A=A(P):B=B(P):IF A<0 OR A>159 OR B<0 OR B>95 THEN P=P-A:RETURN 355 LOCATE A,B,KK:IF KK=1 THEN P=P-1:RETURN 360 PLOT A,B:A(P)=A:B(P)=B+1:A(P+1)=A-1:B(P+1)=B:A(P+2)=A+1:B(P+2)=B 361 A(P+3)=A:B(P+3)=A:B(P+3)=B-1:P=P+3:RETURN