turtle_graphics
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
turtle_graphics [2024/09/10 09:13] – frchris | turtle_graphics [2024/09/12 14:27] (current) – [Make Your own Picture] frchris | ||
---|---|---|---|
Line 43: | Line 43: | ||
===== Java " | ===== Java " | ||
- | An animated version from Berne, Switzerland has so many classes, they put them all in a Library. | + | An animated version from Berne, Switzerland has so many classes, they put them all in a Library. |
The [[http:// | The [[http:// | ||
Line 71: | Line 71: | ||
| | ||
Turtle hexter = new Turtle(Color.GREEN); | Turtle hexter = new Turtle(Color.GREEN); | ||
+ | | ||
hexter.setPos(100, | hexter.setPos(100, | ||
- | | ||
for (int i=0; i< 6; i++) { | for (int i=0; i< 6; i++) { | ||
hexter.forward(100); | hexter.forward(100); | ||
hexter.right(-60); | hexter.right(-60); | ||
} | } | ||
+ | | ||
hexter.setPos(0, | hexter.setPos(0, | ||
hexter.setFillColor(Color.BLUE); | hexter.setFillColor(Color.BLUE); | ||
- | | + | hexter.fill(); |
| | ||
Turtle t = new Turtle(hexter); | Turtle t = new Turtle(hexter); | ||
- | t.setColor(Color.RED); | + | t.setPenColor(Color.RED); |
- | t.setPos(-200, | + | t.setPos(-200, |
- | | + | t.hideTurtle(); |
+ | t.label( "by My name" | ||
| | ||
} | } |
turtle_graphics.1725973998.txt.gz · Last modified: 2024/09/10 09:13 by frchris