|
java flower
public class FlowerMaker extends Turtle
{
// Draw two flowers each 60 pixels tall.
// Start and end facing east at the base of the left flower.
public void drawTwoFlowers()
{ drawFlower();
move (90, 61);
drawFlower();
move (90, -59);
} //======================
// Start facing east at the base of the flower, right side.
// End facing south at the base of the flower, center.
public void drawFlower()
{ paint (90, 50); // right side of stem
paint (90, 2);
paint (90, 50); // left side of stem
paint (90, 1);
paint (90, 5); // one-fourth of the way up the stem
paint (-45, 8); // draw the twig for the right leaf
drawLeaf();
paint (45, 5); // one-half of the way up the stem
paint (45, 8); // draw the twig for the left leaf
drawLeaf();
paint (-45, 5); // one-fourth of the way up the stem
paint (-45, 8); // draw the twig for the right leaf
drawLeaf();
paint (45, 5); // one-half of the way up the stem
paint (45, 8); // draw the twig for the left leaf
drawLeaf();
paint (-45, 30); // to top of stem, in the center
switchTo (RED);
fillCircle (5); // draw the flower petals
switchTo (BLUE);
move(0,10);
fillCircle (5); // draw the flower petals
move(-120,10);
fillCircle (5); // draw the flower petals
move(-60,10);
fillCircle (5); // draw the flower petals
move(-60,10);
fillCircle (5); // draw the flower petals
move(-60,10);
fillCircle (5); // draw the flower petals
move(-60,10);
fillCircle (5);// draw the flower petals
move(-60,10);
switchTo (BLACK);
move (-120 , 60); // return to the base of the flower
} //======================
// Draw one leaf on one flower.
public void drawLeaf()
{ switchTo (GREEN);
fillCircle (3);
move (0, 3);
fillCircle (2);
move (0, 2);
fillCircle (1);
move (0, -13);
switchTo (BLACK);
} //======================
}
__________________
what if the hokey pokey really is what its all about?
|