in reply to Re: Loop and Add more cookies
in thread Loop and Add more cookies
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Loop and Add more cookies
by choroba (Cardinal) on Oct 12, 2015 at 20:30 UTC | |
by Accelerator (Initiate) on Oct 12, 2015 at 20:57 UTC |