138 (Melly: 165, liverpole: 156)
map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;$c=X;map{($d,$e)=(2*$d*$e+$a,$
e**2-$d**2+$b);$c=$"if$d**2+$e**2>4}1..50;print$c}0..59;print$/}0..20
- 'X' → X
- ' ' → $"
- "\n" → $/
- {...;} → {...}
-
$a=1;while($a>=-1){...;$a-=0.1} →
for(0..20){$a=1-$_/10;...} →
map{$a=1-$_/10;...}0..20
-
$b=-2;while($b<1){...;$b+=0.05} →
for(1..50){$b=$_/20-2;...} →
map{$b=$_/20-2;...}1..50
-
$g=$d;$d=$d**2-$e**2+$b;$e=2*$g*$e+$a; →
$d=($g=$d)**2-$e**2+$b;$e=2*$g*$e+$a; →
($d,$e)=($d**2-$e**2+$b,2*$d*$e+$a);
Notes:
- My loops counters are even more accurate than yours, since they don't accumulate floating point errors. This causes a slight visual difference which can be eliminated by removing the top and bottom rows (map{$a=.9-$_/10;...}0..18).
- I renamed $e and $d to $d and $e to create a parallel with $a and $b.
Spaced out:
map {
$a = 1-$_/10;
map{
$d = $a;
$e = $b = $_/20-2;
$c = X;
map {
($d, $e) = (2*$d*$e+$a, $e**2-$d**2+$b);
$c = $" if $d**2+$e**2 > 4
} 1..50;
print $c
} 0..59;
print $/
} 0..20
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.