in reply to Frequency analysis of the digits of the result of a multiplication
And to remove that uninitialized value, you can do something like:foreach my $x ( 10..99 ) { foreach my $y ( 10..999 ) { @result = reverse split //, $x*$y; $fr[ $_ ][ $result[$_] ]++ foreach (0..$#result); } }
where $maxdigits is the largest number of digits you expect in your results.my @fr; $fr[$_] = [ (0)x10 ] foreach (0..$maxdigits);
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Frequency analysis of the digits of the result of a multiplication
by perlmoth (Hermit) on Nov 18, 2001 at 22:46 UTC |