dorbird

Hamster 2 Aufgabe 2

Oct 31st, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. boolean gerade=true;
  2.  
  3. void main() {
  4.     sammleAllesBiszurWand();
  5.    
  6. }
  7. void sammle(){
  8.     while (kornDa()){
  9.          nimm();
  10.          if(gerade){
  11.             gerade=false;
  12.          }else{
  13.             gerade=true;                    
  14.          }        
  15.     }
  16. }
  17. void sammleAllesBiszurWand(){
  18.     while(vornFrei()){
  19.          sammle();
  20.          if(vornFrei())
  21.             vor();
  22.          }
  23.     }
  24.     while(gerade && !maulLeer()){
  25.          gib();
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment