Melly has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
The following script works on Win32 (produces a crude mandelbrot), but fails on Linux (produces zeroes only).
I've put the output under the readmore, but here's the code... (oh, and I should add that this is the end result of some golf, hence no strict, etc.)
map{ $a=1-$_/10; map{ $d=$a; $e=$b=$_/20-2; map{ ($d,$e)=(2*$d*$e+$a,$e**2-$d**2+$b); $c=$d**2+$e**2>4?_:0 }1..99; print$c }0..59; print$/ }0..20;
Win32 Output:
________________________________________0___________________ ____________________________________________________________ ____________________________________0000____________________ ____________________________________0000____________________ ______________________________0__0000000000_________________ ______________________________00000000000000000_____________ ____________________________0000000000000000000_____________ ___________________________000000000000000000000____________ _________________0000000__0000000000000000000000____________ ________________000000000_0000000000000000000000____________ 0000000000000000000000000000000000000000000000______________ ________________000000000_0000000000000000000000____________ _________________0000000__0000000000000000000000____________ ___________________________000000000000000000000____________ ____________________________0000000000000000000_____________ ______________________________00000000000000000_____________ ______________________________0__0000000000_________________ ____________________________________0000____________________ ____________________________________0000____________________ ____________________________________________________________ ________________________________________0___________________
Linux:
000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000
Tom Melly, pm@tomandlu.co.ukmap{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e** 2-$d**2+$b);$c=$d**2+$e**2>4?_:0}1..99;print$c}0..59;print$/}0..20;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Wrong output on linux, ok on Win32
by shmem (Chancellor) on Nov 30, 2006 at 16:29 UTC | |
by liverpole (Monsignor) on Nov 30, 2006 at 19:07 UTC | |
by Melly (Chaplain) on Nov 30, 2006 at 16:49 UTC | |
by Melly (Chaplain) on Dec 01, 2006 at 10:56 UTC | |
Re: Wrong output on linux, ok on Win32
by almut (Canon) on Nov 30, 2006 at 15:00 UTC | |
Re: Wrong output on linux, ok on Win32
by gellyfish (Monsignor) on Nov 30, 2006 at 15:01 UTC | |
Re: Wrong output on linux, ok on Win32
by rinceWind (Monsignor) on Nov 30, 2006 at 14:24 UTC | |
by Melly (Chaplain) on Nov 30, 2006 at 14:29 UTC | |
by rinceWind (Monsignor) on Dec 01, 2006 at 10:19 UTC |
Back to
Seekers of Perl Wisdom