in reply to Re: Loop and Add more cookies
in thread Loop and Add more cookies

thanks mate, i made a mistake there the code is

$number = 1; $cookies = ""; while ( $cookies ne "COOKIES"x$number."S " x $number, ) { $number =++$number; print "Cookie monster: I want"." COOKIES"x$number."S" x $number, "! +\n"; chomp($cookies= <STDIN>); } print "Mmmm. $number COOKIES. :-)\n"; exit;

but the task was to find an answer to end the script in the command prompt not to write a script, but i appreciate your help:)

Replies are listed 'Best First'.
Re^3: Loop and Add more cookies
by choroba (Cardinal) on Oct 12, 2015 at 15:48 UTC
    the task was to find an answer to end the script
    D'oh! In the original script, it was COOKIESCOOKIES, in the new one, it's COOKIESCOOKIESS S (including the trailing space). Your code still has some problems I addressed in my previous reply.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      thank you a lot, i am certain that you are very good at this. I didn't write this script, my teacher gave this script and told me to find the answer (what to type into the command prompt to end this script).