draw.ss
The teachpack draw.ss
provides a miniscule collection of
graphics functions:
The teachpack also provides clear-
operations for each
draw-
operation. The arguments are the same.
The color argument for all functions are optional.
Sample session: Set teachpack to draw.ss
and execute:
> (start 500 500)
> (draw-solid-disk (make-posn 100 100) 3 'red)
true
> (clear-solid-disk (make-posn 100 100) 3 'red)
true
> (sleep-for-a-while 1)
> (draw-solid-disk (make-posn 100 100) 3 'red)
true
> (clear-solid-disk (make-posn 100 100) 3)
true
> (stop)
>
This session opens a window, draws a red disk, clears it, sleeps for a second,
and then repeats. The last expression closes the canvas.
See http://www.ccs.neu.edu/home/matthias/HtDP/Extended/
for an example on how to use get-key-event
. The program is
the basis for an extended exercise under development.