Facebook
From Thrix, 3 Years ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 57
  1. package Lesson2Activity1;
  2.  
  3. import kareltherobot.Directions;
  4. import kareltherobot.UrRobot;
  5. import kareltherobot.World;
  6.  
  7. public class L2A1_Main implements Directions {
  8.  
  9.         public static void main(String[] args) {
  10.  
  11.             World.setDelay(5);
  12.             World.setVisible();
  13.  
  14.             UrRobot thrix = new UrRobot(1, 1, Directions.North, -1);
  15.  
  16.             for (int i = 0; i < 1000; i++){ // Loop 1000 times
  17.                 thrix.putBeeper(); //Place beeper
  18.             }
  19.             thrix.move(); //Move out of the way
  20.             thrix.move();
  21.             thrix.move();
  22.             }
  23.         }
  24.