Advertisement
VivianHe

1.10.6

Sep 28th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. /* Write a program to lay a row of tennis balls
  2.  * across first street. Make sure to test your
  3.  * program on multiple worlds. */
  4. public class TennisBallRowKarel extends SuperKarel
  5. {
  6.     public void run()
  7.     {
  8.         while (noBallsPresent())
  9.         {
  10.             if (frontIsClear())
  11.             {putBall();
  12.             move();}
  13.             else
  14.             {putBall();}
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement