Facebook
From Thrix, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 62
  1. package L2A3;
  2.  
  3. import kareltherobot.Directions;
  4. import kareltherobot.UrRobot;
  5. import kareltherobot.World;
  6.  
  7. public class L2A3_Main implements Directions {
  8.     public static void main(String[] args) {
  9.  
  10.         World.readWorld("Lesson2World1.kwld");
  11.         World.setVisible();
  12.  
  13.         UrRobot thrix = new UrRobot(5, 3, North, 20);
  14.         for (int turn = 0; turn < 3; turn++){
  15.             thrix.turnLeft();}
  16.         for (int a = 0; a < 10 ; a++){
  17.             for (int move = 0; move < 4; move++){
  18.                 thrix.move();}
  19.             thrix.putBeeper();
  20.             thrix.turnLeft();
  21.             thrix.move();
  22.             thrix.move();
  23.             thrix.putBeeper();
  24.             thrix.turnLeft();
  25.  
  26.         }
  27.         thrix.move();
  28.         thrix.turnLeft();
  29.  
  30.     }
  31. }
  32.