Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Turtle example 1
- ----------------
- import unit4.turtleLib.Turtle;
- public class Hw1 {
- static Turtle t = new Turtle();
- public static void main(String[] args) {
- t.tailDown();
- t.setDelay(100);
- mostatil(150, 65);
- t.moveForward(65);
- t.turnLeft(90);
- t.moveForward(50);
- t.turnRight(90);
- mostatil(50, 100);
- t.tailUp();
- t.moveBackward(150);
- t.tailDown();
- moraba3(60);
- }
- public static void mostatil(double width, double height) {
- for (int i = 0; i < 2; i += 1) {
- t.moveForward(height);
- t.turnLeft(90);
- t.moveForward(width);
- t.turnLeft(90);
- }
- }
- public static void moraba3(double x) {
- mostatil(x, x);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement