neolateral

programming, drawing, photograpy etc.

Articles tagged with Java

PicoTurtle Java program to draw a groovy tunnel

I've also added Java support to picoturtle. Here's a program to draw a rather groovy tunnel. Java code follows.

import in.abhishekmishra.picoturtle.Turtle;
import in.abhishekmishra.picoturtle.TurtleState;

public class Tunnel
{
    public static void cuboid(Turtle t, double b, double w, double h) {
        t.forward(b);

        t.right(-45);
        t.forward(h);
        t.back(h);
        t.left(-45);

        t.left(90);
        t.forward(w);

        t.left(-45);
        t.forward(h);
        t.back(h);
        t.right(-45);

        t.left(90);
        t.forward(b);

        t.left(-135);
        t.forward(h);
        t.back(h);
        t.right(-135);

        t.left(90);
        t.forward …