User Tools

Site Tools


milewalker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
milewalker [2019/08/23 09:31]
frchris
milewalker [2019/08/23 09:37]
frchris [MileWalkerRunner]
Line 24: Line 24:
 ====== MileWalkerRunner ====== ====== MileWalkerRunner ======
 <code java> <code java>
-task() +import kareltherobot.*;​ 
-{  + 
-       ​MileWalker lisa = new MileWalker (3, 2, East, 0);       // declare a MileWalker robot +/** 
-       ​lisa.moveMile();​  // call the new method + *  
-       ​lisa.pickBeeper();​          // call an old method + * @author Chris Thiel 
-       ​lisa.turnLeft();​ + * @version Aug 19, 2019 
-        lisa.move();​ + ​* ​ A Class with a main method to run a MileWalkerRobot 
- lisa.pickBeeper();​ + ​* ​ similar to 3.3 page 34  
- lisa.moveMile();​ + ​* ​  
- lisa.turnOff();​+ */ 
 + 
 +public class MileWalkerRunner implements Directions { 
 + 
 + public static void main(String[] args) { 
 + World.setDelay(50);​ 
 + World.setVisible();​ 
 + task(); 
 +
 + public static void task()
 + // Declare a instance of a MileWalker Robot: 
 + MileWalker lisa = new MileWalker (3, 2, East, 0);        
 + 
 + lisa.moveMile(); ​  ​// call the new method 
 + lisa.pickBeeper();​ // call an old (inherited) ​method 
 + lisa.turnLeft();​ 
 + lisa.move();​ 
 + lisa.pickBeeper();​ 
 + lisa.moveMile();​ 
 + lisa.turnOff();​ 
 + }
 } }
 +
 </​code>​ </​code>​
milewalker.txt · Last modified: 2019/08/23 09:37 by frchris