Code Sketch


Drawing using Multiple TURTLES
By: Aditya Hasteer Sharma
cleari()

def shape(t: Turtle, n: Int, delay: Int) = runInBackground {
    t.setAnimationDelay(delay)
        t.forward(100)
        t.right()
        t.forward(50)
        t.right()
        t.forward(100)
        t.right()
        t.forward(50)
        t.right()
        t.right()
        t.forward(25)
        t.left()
        t.forward(100)
        t.forward(-50)
        t.left()
        t.forward(25)
        t.forward(-50)
        t.right()
        t.forward(50)
        t.left()
        t.forward(500)
        t.left()
        t.forward(50)
        t.left()
        t.forward(1000)
        t.left()
        t.forward(50)
        t.left()
        t.forward(500)
        t.right()
        t.left()
        t.forward(25)
        t.right()
        t.forward(-50)
}
val t1 = newTurtle(0, 0)
val t2 = newTurtle(-200, 100)
val t3 = newTurtle(250, 100)
val t4 = newTurtle(250, -50)
val t5 = newTurtle(-200, -50)

shape(t1, 100, 100)
shape(t2, 50, 200)
shape(t3, 50, 200)
shape(t4, 50, 200)
shape(t5, 50, 200)