What is Cheloniidae?

Cheloniidae is an absurdly overengineered turtle graphics library for Java. It supports three-dimensional rendering, turtle replication, and other concepts not traditionally implemented in turtle systems. All of the images on this page were produced with Cheloniidae using the included example programs (or code next to the images).

Examples

Here are some of the examples included with Cheloniidae. Each of these images was produced with under 35 lines of Java.

Inductive Replication Inductive Replication and Recursion Turtle Command Recursion
What's New?

Mouse and Keyboard Controls

Version 3 supports better mouse controls:

Turtle Command API

Recursion

Turtle commands let you do more with less code. By constructing a series of commands to be run, you have the flexibility of transparently driving multiple turtles simultaneously, using the built-in recursion and iteration constructs, and even driving turtles of different types.

In version 2.1, all commands were given directly to the turtle, like this:

for(int i = 0; i < 4; ++i)
  t.move(100).turn(90);
Starting with version 3, however, you can construct the equivalent turtle command instead:
repeat(4, move(100), turn(90));
While there are some cases that still require Java's control flow constructs, many common coding patterns have a pure turtle command representation. (Check out the example files included with Cheloniidae for more details.)

Getting Cheloniidae

Current Release

Cheloniidae is free software and is licensed under the terms of the MIT source code license. The current release (source code, binaries, documentation, and sample files) is version 3.0, available on Github and bundled here: cheloniidae-3.0.zip. Cheloniidae should work with the JRE 1.5 or higher on any platform.

Inductive Replication and Recursion

Previous Releases

The 3.0 prereleases and 2.x series are also available for download:
cheloniidae-3.0-pre2.zip
cheloniidae-3.0-pre1.zip
cheloniidae-2.1.zip
cheloniidae-2.0.zip

Direct Control

Common Problems

If your classpath is not configured correctly (i.e. does not include the current directory), you may need to run Cheloniidae programs this way: java -cp ./ classname

Coding in Cheloniidae 3

Creating a Square

Square in Cheloniidae
import cheloniidae.*;
import cheloniidae.frames.*;
public class Square extends SingleTurtleScene {
  public static void main(String[] args) {new Square();}
  public TurtleCommand commands() {
    return repeat(4, move(100), turn(90));
  }
}

Adding Depth

Turtles support a pitch command that lets them turn up or down. You can use this to create a spiral:

Spiral in Cheloniidae
import cheloniidae.*;
import cheloniidae.frames.*;
public class Spiral extends SingleTurtleScene {
  public static void main(String[] args) {new Spiral();}
  public TurtleCommand commands() {
    return sequence(size(0.25), color(new java.awt.Color(0.2f, 0.5f, 0.4f, 0.5f)),
                    repeat(400, move(5), turn(5), pitch(5)));
  }
}

Further Reading

I haven't finished the documentation yet, but the examples are a great place to start. For the more adventurous, you can always look at the incredibly pretentious literate code, especially in cheloniidae.frames.CoreCommands and cheloniidae.RotationalCartesianTurtle.