!demonstrate use of library files and
some graphics programs
!graphlib.tru and arclib.tru are TB bronze libraries...look see
!use draw-picture versus do-loop structure
!use rnd and randomize to make random sounds and picture locations
!use box keep to save your graphics and box show to place them
LIBRARY "graphlib.tru"
LIBRARY "arclib.tru"
SET MODE "graphics"
LET ratio=1.4
SET WINDOW -(50*ratio),(50*ratio),-50,50 !center coordinates
DRAW circle(10,0,0) !radius 10 circle in middle of screen
PAUSE 1
RANDOMIZE
SET COLOR "yellow"
FLOOD 0,0
PAUSE 1
SET COLOR "blue"
DRAW circle (2,-4,4) !left eye
PAUSE 1
DRAW circle (2,4,4) !right eye
PAUSE 1
DRAW circle (3,0,-2) !nose
PAUSE 1
DRAW boxarc(-8,8,-8,8,220,320) !smile
... angles are degrees
SET COLOR "red"
FLOOD -1,-1
SET COLOR "blue"
FLOOD -3,3
FLOOD 3,3
SET COLOR "magenta"
LET greeting$="Hi!"
PLOT TEXT, AT -2,-15:greeting$
PAUSE 3
BOX KEEP -12,12,-12,12 in clown$ !store face
DO while i < 5
BOX SHOW clown$ at rnd*50*log(2*rnd),rnd*50*log(2*rnd)
SOUND rnd*2000,1
LET i=i+1
PAUSE .5
LOOP
END
PICTURE circle(r,x,y)
BOX CIRCLE x-r,x+r,y-r,y+r
END PICTURE