java.lang.ObjectTurtle
MyTurtle
public class MyTurtle
An extended Turtle that can draw squares, polygons and spirals.
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 |
---|
public MyTurtle()
Method Detail |
---|
public void drawPolygon(int numberOfSides, int sideLength)
public void drawSpiral(int length)
public void drawSquare(int sideLength)