Advertisement
GARC923

Untitled

Sep 13th, 2022
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. /*
  2. Carlos Garcia
  3. Lesson2 Activity1
  4. Placing stacks of 100 beepers
  5. */
  6. package Lesson2;
  7.  
  8. import kareltherobot.Directions;
  9. import kareltherobot.UrRobot;
  10. import kareltherobot.World;
  11.  
  12. import java.awt.*;
  13.  
  14. public class Activity1 implements Directions {
  15.  
  16.     public static void main(String[] args) {
  17.         World.setDelay(1);
  18.         World.setVisible();
  19.         World.setBeeperColor(Color.blue);
  20.  
  21.         UrRobot zgod = new UrRobot(1, 1, North, -1);
  22.  
  23.         // loop that runs 10 times for 10 stacks
  24.         for (int i=0; i<10; i++){
  25.  
  26.             // loop that runs 100 times for 100 beepers in each stack
  27.             for (int j=0; j<100;j++){
  28.                 zgod.putBeeper();
  29.             }
  30.             zgod.move();
  31.         }
  32.         zgod.move();
  33.  
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement