Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import kareltherobot.Directions;
- import kareltherobot.Robot;
- import kareltherobot.World;
- public class ETDiamond implements Directions
- {
- static Robot bobbie = new Robot (2,6, North, infinity);
- private static void turnRight()
- {
- bobbie.turnLeft();
- bobbie.turnLeft();
- bobbie.turnLeft();
- }
- private static void diagonal()
- {
- for (int b=0; b<4; b++)
- {
- bobbie.turnLeft()
- ; bobbie.move();
- turnRight();
- bobbie.move();
- bobbie.putBeeper();
- }
- }
- public static void main(String[] args)
- {
- World.setVisible(true);
- World.setDelay(0);
- for(int i=0; i< 5; i++)
- {
- diagonal();
- turnRight();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement