your_initials_in_beepers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
your_initials_in_beepers [2019/08/17 12:29] – frchris | your_initials_in_beepers [2019/08/18 12:40] (current) – frchris | ||
---|---|---|---|
Line 4: | Line 4: | ||
{{http:// | {{http:// | ||
- | Here is some starter code for a new class. | + | Here is some starter code for a new class. |
+ | |||
+ | |||
+ | [[http:// | ||
+ | |||
+ | <code java> | ||
import kareltherobot.*; | import kareltherobot.*; | ||
/** | /** | ||
Line 38: | Line 43: | ||
lisa.turnLeft(); | lisa.turnLeft(); | ||
lisa.putBeeper(); | lisa.putBeeper(); | ||
+ | lisa.move(); | ||
+ | lisa.putBeeper(); | ||
+ | lisa.move(); | ||
+ | lisa.putBeeper(); | ||
lisa.move(); | lisa.move(); | ||
lisa.turnOff(); | lisa.turnOff(); | ||
Line 45: | Line 54: | ||
====== Making a method ====== | ====== Making a method ====== | ||
- | With all those '' | + | With all those '' |
* Places n beepers from Robot r ina striaght line | * Places n beepers from Robot r ina striaght line | ||
* @param r the Robot placing the beepers | * @param r the Robot placing the beepers | ||
Line 60: | Line 69: | ||
}</ | }</ | ||
+ | Now all your '' | ||
+ | { | ||
+ | Robot lisa = new Robot(5, 1, South, infinity); | ||
+ | |||
+ | placeSomeBeepers(lisa, | ||
+ | lisa.turnLeft(); | ||
+ | placeSomeBeepers(lisa, | ||
+ | lisa.move(); | ||
+ | lisa.turnOff(); | ||
+ | }</ |
your_initials_in_beepers.1566059397.txt.gz · Last modified: 2019/08/17 12:29 by frchris