Andreas Koller
/
Bertl_WhileAufgabe
While Aufgabe mit Beeper
Revision 0:f4fa6a572eca, committed 2015-04-24
- Comitter:
- asdfmaker333
- Date:
- Fri Apr 24 08:42:57 2015 +0000
- Commit message:
- While_Task3 Funktioniert
Changed in this revision
diff -r 000000000000 -r f4fa6a572eca main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Apr 24 08:42:57 2015 +0000 @@ -0,0 +1,55 @@ +#include "ur_Bertl.h" +#include "mbed.h" +#include "const.h" + +class WhileAufgabe : public ur_Bertl +{ + public: + + void MoveOnBeeper(); + + +}; + +void WhileAufgabe :: MoveOnBeeper() +{ + + int x = 0; + TurnLeft(); + while(NextToABeeper()) + { + Move(); + x++; + } + + TurnLeft(); + TurnLeft(); + while(x > 0) + { + Move(); + x--; + } + TurnLeft(); + Move(); +} + + +int main() +{ + WhileAufgabe karel; + + while(karel.FrontIsClear()) + { + if(karel.NextToABeeper()) + { + karel.MoveOnBeeper(); + } + else + { + karel.Move(); + + } + } + karel.ShutOff(); + +} \ No newline at end of file
diff -r 000000000000 -r f4fa6a572eca mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Apr 24 08:42:57 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889 \ No newline at end of file
diff -r 000000000000 -r f4fa6a572eca ur_Bertl.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ur_Bertl.lib Fri Apr 24 08:42:57 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/BERTL_CHEL_18/code/ur_Bertl/#07e55b300ff1