!demonstrates box keep, clear, and box show commands

LET ratio=1.4

SET WINDOW -(50*ratio),(50*ratio),-50,50 !center coordinates

PLOT 0,0 !locate center for drawing

DRAW circle(10,0,0) !refers to picture subroutine

SET COLOR "green"

PRINT "Hold down the mouse button and draw."

DO

GET MOUSE X,Y,S

LOOP UNTIL S = 1 ! mouse button is now clicked, s=1

DO WHILE S = 1

SET COLOR "red"

GET MOUSE X,Y,S ! a sequence of x,y points

PLOT X,Y; ! are generated

LOOP

!draw in a different color

DO

GET MOUSE X,Y,S

LOOP UNTIL S = 1 ! mouse button is now clicked

DO WHILE S = 1

SET COLOR "green"

GET MOUSE X,Y,S ! a sequence of x,y points

PLOT X,Y; ! are generated

LOOP

BOX KEEP -10,10,-10,10 in pik$ !store central figure drawn in pik$

CLEAR !erase original picture

BOX SHOW pik$ at -50,-25 !show pik$ at specified location

BOX SHOW pik$ at 50,25 !show pik$ at specified location

END

PICTURE circle(r,x,y) !picture subroutine

BOX CIRCLE x-r,x+r,y-r,y+r

END PICTURE