Mandelbrot set: Difference between revisions
→{{header|Raku}}: cache palette, use hyper statement prefix and use higher size and iterations defaults
(→{{header|Raku}}: redo first version) |
(→{{header|Raku}}: cache palette, use hyper statement prefix and use higher size and iterations defaults) |
||
Line 11,410:
Converted to a .png file for display here.
[[File:mandelbrot-raku-1.2.png|300px|thumb|right]]
<syntaxhighlight lang="raku" line>use Color;
constant MAX_ITERATIONS =
my $width = my $height = +(@*ARGS[0] //
sub cut(Range $r, UInt $n where $n > 1 --> Seq) {
Line 11,435:
say "255";
}
▲ { start { mandelbrot(0i, $_) } }
;▼
for @half-screen.rotor(@im.elems)
put .map(
.map(-> $i {
(state %){$i} //= Color.new(hsv => ($i, $i, $i)).rgb
▲ });
}</syntaxhighlight>
|