in reply to A little math
sub random_number { return (1..5)[rand 5]; }
Or just:
sub random_number { return 1 + int rand 5; }
answer($user_answer);
There is no answer sub in your code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A little math
by Lady_Aleena (Priest) on Feb 21, 2011 at 16:49 UTC |