M Seiser
/
ClearALLBeapers
Pick Beepers until Facing South Wall
main.cpp@0:7d9c3a278828, 2015-04-24 (annotated)
- Committer:
- mSeiser
- Date:
- Fri Apr 24 08:07:27 2015 +0000
- Revision:
- 0:7d9c3a278828
Sammelt Beeper auf bis zur Wand
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mSeiser | 0:7d9c3a278828 | 1 | #include "mbed.h" |
mSeiser | 0:7d9c3a278828 | 2 | #include "Robot.h" |
mSeiser | 0:7d9c3a278828 | 3 | #include "ur_Bertl.h" |
mSeiser | 0:7d9c3a278828 | 4 | #include "const.h" |
mSeiser | 0:7d9c3a278828 | 5 | |
mSeiser | 0:7d9c3a278828 | 6 | |
mSeiser | 0:7d9c3a278828 | 7 | class NewClass : public ur_Bertl |
mSeiser | 0:7d9c3a278828 | 8 | { |
mSeiser | 0:7d9c3a278828 | 9 | public: |
mSeiser | 0:7d9c3a278828 | 10 | void ClearAllBeepersToTheWall(); |
mSeiser | 0:7d9c3a278828 | 11 | |
mSeiser | 0:7d9c3a278828 | 12 | |
mSeiser | 0:7d9c3a278828 | 13 | }; |
mSeiser | 0:7d9c3a278828 | 14 | |
mSeiser | 0:7d9c3a278828 | 15 | void NewClass :: ClearAllBeepersToTheWall() |
mSeiser | 0:7d9c3a278828 | 16 | { |
mSeiser | 0:7d9c3a278828 | 17 | while(FrontIsClear()) |
mSeiser | 0:7d9c3a278828 | 18 | { |
mSeiser | 0:7d9c3a278828 | 19 | |
mSeiser | 0:7d9c3a278828 | 20 | if(NextToABeeper()) |
mSeiser | 0:7d9c3a278828 | 21 | { |
mSeiser | 0:7d9c3a278828 | 22 | PickBeeper(); |
mSeiser | 0:7d9c3a278828 | 23 | NibbleLeds(AnyBeeperInBag()); |
mSeiser | 0:7d9c3a278828 | 24 | wait(0.5); |
mSeiser | 0:7d9c3a278828 | 25 | Move(); |
mSeiser | 0:7d9c3a278828 | 26 | } |
mSeiser | 0:7d9c3a278828 | 27 | else |
mSeiser | 0:7d9c3a278828 | 28 | Move(); |
mSeiser | 0:7d9c3a278828 | 29 | |
mSeiser | 0:7d9c3a278828 | 30 | } |
mSeiser | 0:7d9c3a278828 | 31 | |
mSeiser | 0:7d9c3a278828 | 32 | } |
mSeiser | 0:7d9c3a278828 | 33 | |
mSeiser | 0:7d9c3a278828 | 34 | |
mSeiser | 0:7d9c3a278828 | 35 | int main() |
mSeiser | 0:7d9c3a278828 | 36 | { |
mSeiser | 0:7d9c3a278828 | 37 | NewClass karel; |
mSeiser | 0:7d9c3a278828 | 38 | |
mSeiser | 0:7d9c3a278828 | 39 | karel.ClearAllBeepersToTheWall(); |
mSeiser | 0:7d9c3a278828 | 40 | |
mSeiser | 0:7d9c3a278828 | 41 | } |