[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Something fun...



>The thing I'm looking for is a way to generate a random number, but also to
>limit the range of numbers. Something like 1-52 for a card game or 1-6 for
>craps.

$limit = 52;  # the upper limit

srand;
$random_number = rand $limit;


Pete

_______________________________________________.__._.._ . _ .. .   .
                                    |     ___/
     Peter Folk, Ideas Unlimited    |  __/
         pfolk@uni.uiuc.edu         |_/