Mandelbrot set: Difference between revisions
→{{header|Raku}}: keeping things simple : producing a bitmap
(→{{header|Raku}}: fuse last two lines) |
(→{{header|Raku}}: keeping things simple : producing a bitmap) |
||
Line 11,464:
=={{header|Raku}}==
(formerly Perl 6)
{{Works with|rakudo|
Using the [https://docs.raku.
Produces a bitmap in [[Write ppm file|Portable Pixel Map]] format to standard output.▼
▲Produces a [[Write ppm file|Portable Pixel Map]] to standard output
Converted to a JPEG file for display here.
<!--[[File:mandelbrot-raku.jpg|300px|thumb|right]]-->
<syntaxhighlight lang="raku">constant MAX-ITERATIONS = 1000;
my $width = +(@*ARGS[0] // 800);
my $height = $width + $width %% 2;
say "
say "$width $height";
sub cut(Range $r, UInt $n where $n > 1 --> Seq) {
Line 11,490 ⟶ 11,487:
for 1 .. MAX-ITERATIONS {
$z = $z*$z + $c;
return
}
return
}
my @lines = hyper for @im X+ @re {
mandelbrot(0i, $_);
}.rotor($width);
|