LispPad
  • Home
  • Applications
    • 🖥️LispPad
      • Sessions
      • Editor
      • Preferences
    • 📱LispPad Go
    • 📜Language
    • 📖Libraries
  • Libraries
    • ⚙️LispKit
      • (lispkit archive tar)
      • (lispkit archive zip)
      • (lispkit base)
      • (lispkit bitset)
      • (lispkit box)
      • (lispkit bytevector)
      • (lispkit char)
      • (lispkit char-set)
      • (lispkit combinator)
      • (lispkit comparator)
      • (lispkit control)
      • (lispkit core)
      • (lispkit crypto)
      • (lispkit csv)
      • (lispkit datatype)
      • (lispkit date-time)
      • (lispkit debug)
      • (lispkit disjoint-set)
      • (lispkit draw)
      • (lispkit draw turtle)
      • (lispkit draw barcode)
      • (lispkit draw chart bar)
      • (lispkit dynamic)
      • (lispkit enum)
      • (lispkit format)
      • (lispkit graph)
      • (lispkit gvector)
      • (lispkit hashtable)
      • (lispkit heap)
      • (lispkit http)
      • (lispkit http oauth)
      • (lispkit http server)
      • (lispkit iterate)
      • (lispkit json)
      • (lispkit json schema)
      • (lispkit list)
      • (lispkit list set)
      • (lispkit log)
      • (lispkit markdown)
      • (lispkit match)
      • (lispkit math)
      • (lispkit math matrix)
      • (lispkit math stats)
      • (lispkit math util)
      • (lispkit object)
      • (lispkit port)
      • (lispkit prolog)
      • (lispkit queue)
      • (lispkit record)
      • (lispkit regexp)
      • (lispkit serialize)
      • (lispkit set)
      • (lispkit sqlite)
      • (lispkit stack)
      • (lispkit stream)
      • (lispkit string)
      • (lispkit styled-text)
      • (lispkit system)
      • (lispkit system call)
      • (lispkit system keychain)
      • (lispkit system pasteboard)
      • (lispkit test)
      • (lispkit text-table)
      • (lispkit thread)
      • (lispkit thread channel)
      • (lispkit-thread-future)
      • (lispkit thread shared-queue)
      • (lispkit type)
      • (lispkit url)
      • (lispkit vector)
    • ⚙️LispPad
      • (lisppad applescript)
      • (lisppad draw map)
      • (lisppad location)
      • (lisppad speech)
      • (lisppad system)
      • (lisppad turtle)
    • ⚙️SRFI
  • Examples
    • 📝LispKit
    • 📝LispPad
    • 📝LispPad Go
  • Releases
    • 🖥️LispPad
    • 📱LispPad Go
  • Downloads
  • Privacy Policy
  • Contact
Powered by GitBook
On this page
  1. Libraries
  2. LispPad

(lisppad turtle)

Previous(lisppad system)NextSRFI

Last updated 2 years ago

This is a library implementing a simple graphics window for displaying turtle graphics. The library supports one graphics window per LispPad session which gets initialized by invoking init-turtle. init-turtle will create a new turtle and display its drawing on a graphics window. If there is already an existing graphics window with the given title, it will be reused.

Once init-turtle was called, the following functions can be used to move the turtle across the plane:

  • (pen-up): Lifts the turtle

  • (pen-down): Drops the turtle

  • (pen-color color): Sets the current color of the turtle

  • (pen-size size): Sets the size of the turtle pen

  • (home): Moves the turtle back to the origin

  • (move x y): Moves the turtle to position (x, y)

  • (heading angle): Sets the angle of the turtle (in radians)

  • (turn angle): Turns the turtle by the given angle (in radians)

  • (left angle): Turn left by the given angle (in radians)

  • (right angle): Turn right by the given angle (in radians)

  • (forward distance): Moves forward by distance units drawing a line if the pen is down

  • (backward distance): Moves backward by distance units drawing a line if the pen is down

This library provides a simplified, interactive version of the API provided by library (lispkit draw turtle).


(init-turtle) (init-turtle scale) (init-turtle scale title)

Initializes a new turtle and displays its drawing in a graphics window. init-turtle gets two optional arguments: scale and title. scale is a scaling factor which determines the size of the turtle drawing. title is a string that defines the window name of the turtle graphics. It also acts as the identify of the turtle graphics window; i.e. it won't be possible to have two sessions with the same name but a different graphics window.

Closes the turtle window and resets the turtle library.

Returns the drawing associated with the current turtle.

Lifts the turtle from the plane. Subsequent forward and backward operations don't lead to lines being drawn. Only the current coordinates are getting updated.

Drops the turtle onto the plane. Subsequent forward and backward operations will lead to lines being drawn.

Sets the drawing color of the turtle to color. color is a color object as defined by library (lispkit draw).

Sets the pen size of the turtle to size. The pen size corresponds to the width of lines drawn by forward and backward.

Moves the turtle to its home position.

Moves the turtle to the position described by the coordinates x and y.

Sets the heading of the turtle to angle. angle is expressed in terms of degrees.

Adjusts the heading of the turtle by angle degrees.

Adjusts the heading of the turtle by angle degrees.

Adjusts the heading of the turtle by -angle degrees.

Moves the turtle forward by distance units drawing a line if the pen is down.

Moves the turtle backward by distance units drawing a line if the pen is down.

(close-turtle-window)

(turtle-drawing)

(pen-up)

(pen-down)

(pen-color color)

(pen-size size)

(home)

(move x y)

(heading angle)

(turn angle)

(right angle)

(left angle)

(forward distance)

(backward distance)

⚙️