in reply to 2 bit Math puzzle
Remove the $i++ line. With it in there, you can end up attempt to fetch $primes[@primes], which returns undef.sub Get_Target{ ###Gets two random primes a creates the goal. my $i = @primes; $i++; my $value1 = int(rand($i)); my $value2 = int(rand($i)); $goal = $primes[$value1] * $primes[$value2]; }
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: 2 bit Math puzzle
by sparkyichi (Deacon) on Dec 13, 2001 at 23:54 UTC | |
by japhy (Canon) on Dec 13, 2001 at 23:59 UTC | |
by sparkyichi (Deacon) on Dec 14, 2001 at 00:15 UTC |