dorbird

Hamster 2 Aufgabe 2b

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