pojset $max_tries to 3. ask user for $range of guess generate $answer as a random number from 1..$range FOR $loop from 1 to $max_tries $guess_count = $loop get $user_guess if $user_guess is the $answer then exit loop ENDFOR IF $user_guess equals the $answer message : Well done, you got it in $guess_count ELSE message : Sorry, you've had $max_tries guesses ENDIF
In reply to Re: Looped around my neck (help with my poor little loops!)
by poj
in thread Looped around my neck (help with my poor little loops!)
by sulfericacid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |