|more useful options
Re: how to enable, disable strictby marto (Cardinal)
|on Apr 25, 2007 at 09:31 UTC
A couple of things in addition to the advice shmem has already given. Firstly you are not checking if the number the user has guessed is the secret number, just that it is a lower number, and you never tell the user that they have guessed correctly. Try the code below:
In your example if the secret number was 42 and the user enters 43 they are not told that they have failed to guess correctly.
Please read the PerlMonks FAQ and How do I post a question effectively? if you have not alreay done so.
Hope this helps