![](/media/cache/profiles/38fcf18b093fdaa9016a4b84255dfcaf.jpg.50x50_q85.jpg)
Bertl sammelt Beeper und fährt die anzahl der Beeper nach oben und fährt zum Ausgangspunkt.
Fork of While_Task3 by
main.cpp
- Committer:
- martinale
- Date:
- 2015-04-24
- Revision:
- 0:27a5933a5e04
- Child:
- 1:d8c1ed589950
File content as of revision 0:27a5933a5e04:
#include "mbed.h" #include "Robot.h" #include "const.h" class Bertl_Beeper : public Robot { public: void ClearAllBeeperToTheWall(); void TurnAround(); }; void Bertl_Beeper :: TurnAround() { TurnLeft(); TurnLeft(); } void Bertl_Beeper :: ClearAllBeeperToTheWall() { while(FrontIsClear()) { if(NextToABeeper()) { PickBeeper(); NibbleLeds(AnyBeeperInBag()); wait(1); Move(); } else Move(); } } int main() { Bertl_Beeper karel; while(1) { karel.ClearAllBeeperToTheWall(); while(!karel.FrontIsClear()) { karel.TurnAround(); break; } } }