1.4.4: Slide Karel, 1.4.5: Fireman Karel

Code for these lessons:

1.4.4: Slide Karel

  1. public void run(){
  2. putBall();
  3. move();
  4. turnRight();
  5. move();
  6. putBall();
  7. move();
  8. turnLeft();
  9. move();
  10. putBall();
  11. }
  12. private void turnRight(){
  13.      turnLeft();
  14.      turnLeft();
  15.      turnLeft();
  16. }

1.4.5: Fireman Karel

  1. public void run(){
  2.      turnRight();
  3.      move();
  4.      move();
  5.      move();
  6.      turnLeft();
  7. }
  8. private void turnRight(){
  9.      turnLeft();
  10.      turnLeft();
  11.      turnLeft();
  12. }

Comments

Post a Comment

Popular posts from this blog

1.9.5: Marathon Karel, 1.9.6: Take 'em All, 1.9.7: Dizzy Karel, 1.9.8: For Loop Square, 1.9.9: Lots of Hurdles

1.5.4: Pancakes, 1.5.5: Mario Karel