scarab

All Top-level Files
Login

Files in the top-level directory in any check-in


#
# Scarab
# A little turtle graphics language for Cairo
#
# Christian Koch <cfkoch@sdf.lonestar.org>
#

Scarab implements a tiny and relatively featureless scripting language as a
front-end to the Cairo vector graphics library. Expect more features to come in
the near future.

The Scarab language has a simple, intuitive, and inflexible syntax. It is
imperative in nature; every instruction consists of a command name followed by
zero or more arguments. Commands are separated by newlines. The entire language
reference is listed here.

  line x y
    Draw a line from the current location to (x, y).

  move x y
    Move the pen to the location (x, y). 

  paint
    Paint the entire canvas the current color. For example, to make the canvas
    solid black:
      source 0.0 0.0 0.0
      paint

  source r g b
    Set the color of the pen. Red, green, and blue components are floating-point
    numbers with a range of [0.0, 1.0]. For example, to set the color of the pen
    to blue:
      source 0.0 0.0 1.0

  stroke
    The `line' command draws a line, but it is not visible until we call this
    command. It is not necessary to call `stroke' after every call to `line'.