java.lang.ObjectTurtle
Geometer
The Geometer class is a turtle that is able to perform many tasks that involve looping behavior. You can choose which methods to implement. In all methods, unless otherwise noted, turns should be right turns, and you should move before you turn. Each method should also put the pen down at the start and pick it up when finished.
| Constructor Summary | |
Geometer()
|
|
| Method Summary | |
void |
asterisk(int points,
double length)
Draw a set of lines all radiating out from one point, each of the length given. |
void |
asterisks(int points,
double length)
Draw a sequence of asterisks, starting with the given number of points and length. |
void |
doubleStacks(int boxes)
Draw a stack with the given number of boxes, then smaller stacks trailing off to both sides. |
void |
polygon(int sides)
Draw a polygon with the specified number of sides, each side one long. |
void |
polygons(int sides)
Draw a series of polygons, from a triangle up to the number of sides given. |
void |
stack(int boxes)
Draw a stack of squares, starting where the Geometer is now and returning to that spot. |
void |
stacks(int boxes)
Draw a sequaence of stacks, starting with the given size and trailing off to the right, making stacks each one smaller than the last until you get to an empty stack. |
void |
star(int points,
double angle)
Draw a star with the given number of points, where the interior angle of each point is the angle given. |
void |
stars(int points,
double angle)
Draw a sequence of stars, all with the same angle, but varying in their number of points, from two points up to the number given. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Geometer()
| Method Detail |
public void asterisk(int points,
double length)
points - Number of lines to drawlength - Length of each line
public void asterisks(int points,
double length)
points - Number of points of largest asterisklength - Length of largest asteriskpublic void doubleStacks(int boxes)
boxes - Number of boxes in largest stack.public void polygon(int sides)
sides - Number of sides.public void polygons(int sides)
sides - Number of sides of largest polygon.public void stack(int boxes)
boxes - Number of boxes in the stack.public void stacks(int boxes)
boxes - Number of boxes in the largest stack.
public void star(int points,
double angle)
points - Number of pointsangle - Interior angle of each point.
public void stars(int points,
double angle)
points - Number of points of largest starangle - Interior angle of all points