pythagoreantree/src/TurtleTools/DrawingTools.java

27 lines
652 B
Java
Raw Normal View History

2015-02-13 12:28:18 +00:00
package TurtleTools;
import ch.aplu.turtle.Turtle;
/**
* Created by Christian on 10.02.2015.
*/
public class DrawingTools {
public static void drawSquare(Turtle turtle, double size) {
2015-02-11 10:45:39 +00:00
int width = (int) size / 10;
turtle.penWidth(width);
for (int i = 0; i < 4; i++) {
turtle.forward(size).left(90);
}
}
2015-02-13 12:28:18 +00:00
public static void drawFilledSquare(Turtle turtle, double size) {
turtle.startPath();
int width = (int) size / 10;
turtle.penWidth(width);
for (int i = 0; i < 4; i++) {
turtle.forward(size).left(90);
}
turtle.fillPath();
}
}