-
-
Save timo/610b39f340db90a4f14eab97c11fa2c3 to your computer and use it in GitHub Desktop.
this crashes in a few different ways on moarvm.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl6 | |
use v6; | |
my int $width = 320; | |
my int $height = 240; | |
my int $hwidth = ($width /2).Int; | |
my int $hheight = ($height/2).Int; | |
my int $wid = 4; | |
my (int $xcenter, int $ycenter) = (-1,0); | |
my $t0 = DateTime.now.Instant; | |
sub mandelbrot() { } | |
my $render; | |
my $c = Channel.new; | |
my $plotting = start { | |
for $c.list -> $item { | |
my ($xcoord, $ycoord, $color) = $item; | |
plot($render, $xcoord, $ycoord, $color); | |
} | |
} | |
await do for ( 0..$width).pick(*) -> int $xcoord { | |
start { | |
for ( 0..$height-1).pick(*) -> int $ycoord { | |
my $color = (0,0,0); | |
my $item = ($xcoord, $ycoord, $color); | |
$c.send($item); | |
} | |
} | |
} | |
$c.close; | |
await $plotting; | |
say DateTime.now.Instant-$t0 ~ " sec(s)"; | |
sub plot($render, $x,$y,$c) { | |
my ($c1, $c2, $c3) = $c; # XXX | |
print "."; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment