For better understanding I'm just going to tell you simple
Our teacher gave us this script and we should figure out the answer -> what to type so the loop would end-> in the command prompt, without changing the script. (We had programming just twice, so i am a total noob). I am German therefor the script is in German (what is actually stupid if you teach an English programming language...), so i decided to transcribe it into English to simplify and to not confuse any of you, but it seems i wasn't clear enough, plus i made some mistakes while changing.
And so i hope you can help me out:)
#!/usr/bin/perl -w # # Krümelmonster $ZAHL = 1; $kekse = ""; while ( $kekse ne "KEKSE"x$ZAHL."E " x $ZAHL, ) { $ZAHL =++$ZAHL; print "Kruemelmonster: Ich will"." KEKSE"x$ZAHL."E" x $ZAHL, "!\n"; chomp($kekse = <STDIN>); } print "Mmmm. $ZAHL KEKSE. :-)\n"; exit;
In reply to Re^2: Loop and Add more cookies
by Accelerator
in thread Loop and Add more cookies
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |