Class MyTurtle

java.lang.Object
  extended by Turtle
      extended by MyTurtle

public class MyTurtle
extends Turtle

An extended Turtle that can draw squares, polygons and spirals.

Version:
22 June 2012
Author:
Malcolm Ryan

Constructor Summary
MyTurtle()
           
 
Method Summary
 void drawPolygon(int numberOfSides, int sideLength)
          Draw a polygon with the specified number of sides and given length.
 void drawSpiral(int length)
          Draw a square spiral starting with the specified side length and spiralling inwards.
 void drawSquare(int sideLength)
          Draw a square of the specified side length
 
Methods inherited from class Turtle
isPenDown, move, penColor, penWidth, position, rotate, rotation, setPenColor, setPenDown, setPenWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyTurtle

public MyTurtle()
Method Detail

drawPolygon

public void drawPolygon(int numberOfSides,
                        int sideLength)
Draw a polygon with the specified number of sides and given length. Note: the number of sides must be 3 or greater.


drawSpiral

public void drawSpiral(int length)
Draw a square spiral starting with the specified side length and spiralling inwards.


drawSquare

public void drawSquare(int sideLength)
Draw a square of the specified side length