Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import kareltherobot.*;
- import java.awt.Color;
- /**
- * Write a concise summary of class FourOne here.
- *
- * @author Jason Yang
- * @version 1/28/2017
- */
- public class FourOne extends Utility
- {
- /**
- * Creates a FourOne object.
- *
- * @param street specifies the vertical position on the grid
- * of this robot.
- * @param avenue specifies the horizontal position on the grid
- * of this robot.
- * @param direction specifies the direction of this robot.
- * @param beepers specifies this robot's number of beepers.
- */
- public FourOne (int street, int avenue,
- Direction direction, int beepers)
- {
- super(street, avenue, direction, beepers);
- }
- /* FourOne methods: */
- public void vertical()
- {
- putAndMove();
- putAndMove();
- putAndMove();
- putAndMove();
- putBeeper();
- }
- public void horizontal()
- {
- moveAndPut();
- moveAndPut();
- }
- public void transitionHOne()
- {
- turnAround();
- move();
- move();
- turnRight();
- }
- public void transitionHTwo()
- {
- move();
- turnLeft();
- move();
- move();
- turnAround();
- }
- public void h()
- {
- vertical();
- transitionHOne();
- horizontal();
- transitionHTwo();
- vertical();
- }
- public void horizontalBack()
- {
- turnAround();
- move();
- move();
- }
- public void transitionE()
- {
- turnRight();
- move();
- move();
- turnRight();
- }
- public void e()
- {
- vertical();
- turnLeft();
- horizontal();
- horizontalBack();
- transitionE();
- horizontal();
- horizontalBack();
- transitionE();
- horizontal();
- }
- public void l()
- {
- vertical();
- turnLeft();
- horizontal();
- }
- public void o()
- {
- vertical();
- turnLeft();
- horizontal();
- move();
- turnLeft();
- vertical();
- turnLeft();
- horizontal();
- move();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement