draw-lib.ss

The library draw-lib.ss provides a miniscule collection of graphics functions:
  • start : number number -> void;
    opens a canvas
  • stop : -> void (no arguments);
    closes the canvas
  • draw-solid-disk : posn number color -> #t;
    draws a disk at posn with given radius and color
  • draw-solid-rect : posn number number color -> #t;
    draws a rectangle at posn with given width, height, and color
  • draw-solid-line : posn posn color -> #t;
    draws a line from one posn to other
  • predefined colors: WHITE YELLOW RED BLUE GREEN BLACK
  • Larger interfaces are defined by the sixlib collection, by the turtles commands, and by the toolbox.



    Sample session: Set library to draw-lib.ss and execute:
    > (start 500 500)
    > (draw-solid-disk (make-posn 100 100) 3 RED)
    #t
    > (stop)
    >


    The library also provides clear- operations for each draw- operation. The arguments are the same.


    <-- sleep-for-a-while : number[time] == #t -->