Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Lesson3Activity4;
- //Creates the RoofBuilder Robot
- public class RoofBuilder extends Constructicons {
- /**
- * Constructor for RoofBuilder class
- * @param a
- * @param s
- * @param d
- * @param b
- * @ return - none
- */
- public RoofBuilder(int a, int s, Direction d, int b) {
- super(a, s, d, b);
- }
- /**
- * Overrides build method of Constructicons and instills the set of instructions for the RoofBuilder
- * @ param - none
- * @ return - void
- */
- public void build(){
- //Going up the roof
- putBeeper();
- for(int i = 0;i<5;i++){
- turnRight();
- move();
- turnLeft();
- move();
- putBeeper();
- }
- //Going down the roof
- turnLeft();
- turnLeft();
- for(int i = 0; i<5;i++){
- move();
- turnLeft();
- move();
- putBeeper();
- turnRight();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement