Colour pinstripe/Display: Difference between revisions

Rename Perl 6 -> Raku, alphabetize, minor clean-up
m (cf. not c.f. and add one more link)
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 431:
(make-position xpos top)
(make-position xpos bottom)))))))</lang>
 
=={{header|FreeBASIC}}==
<lang freebasic>' version 14-03-2017
Line 458 ⟶ 459:
Sleep
End</lang>
 
=={{header|Gambas}}==
<lang gambas>'WARNING this takes a time to display
Line 577 ⟶ 579:
size=. getscreenwh_jgtk_ '' NB. J7
'rgb'viewmat (4<.@%~{:size)# ({.size) $&> 1 2 3 4#&.> <256#.255*#:i.8</lang>
 
 
=={{header|Java}}==
Line 708 ⟶ 709:
}
}</lang>
 
=={{header|M2000 Interpreter}}==
Module names and variables with same name may exist
Line 854 ⟶ 856:
print DISPLAY $image->png ;
close DISPLAY ;</lang>
=={{header|Perl 6}}==
{{works with|Rakudo|2018-10}}
<lang perl6>my ($x,$y) = 1280, 720;
 
my @colors = map -> $r, $g, $b { [$r, $g, $b] },
0, 0, 0,
255, 0, 0,
0, 255, 0,
0, 0, 255,
255, 0, 255,
0, 255, 255,
255, 255, 0,
255, 255, 255;
 
my $img = open "pinstripes.ppm", :w orelse die "Can't create pinstripes.ppm: $_";
 
$img.print: qq:to/EOH/;
P3
# pinstripes.ppm
$x $y
255
EOH
 
my $vzones = $y div 4;
for 1..4 -> $width {
my $stripes = ceiling $x / $width / +@colors;
my $row = [((@colors Xxx $width) xx $stripes).flatmap: *.values].splice(0,$x);
$img.put: $row for ^$vzones;
 
$img.close;</lang>
 
=={{header|Phix}}==
Line 1,126 ⟶ 1,097:
(void (new full-frame%))
</lang>
 
=={{header|Perl 6Raku}}==
(formerly Perl 6)
{{works with|Rakudo|2018-10}}
<lang perl6>my ($x,$y) = 1280, 720;
 
my @colors = map -> $r, $g, $b { [$r, $g, $b] },
0, 0, 0,
255, 0, 0,
0, 255, 0,
0, 0, 255,
255, 0, 255,
0, 255, 255,
255, 255, 0,
255, 255, 255;
 
my $img = open "pinstripes.ppm", :w orelse die "Can't create pinstripes.ppm: $_";
 
$img.print: qq:to/EOH/;
P3
# pinstripes.ppm
$x $y
255
EOH
 
my $vzones = $y div 4;
for 1..4 -> $width {
my $stripes = ceiling $x / $width / +@colors;
my $row = [((@colors Xxx $width) xx $stripes).flatmap: *.values].splice(0,$x);
$img.put: $row for ^$vzones;
 
$img.close;</lang>
 
=={{header|Ring}}==
Line 1,239 ⟶ 1,243:
 
}</lang>
 
=={{header|Sidef}}==
{{trans|Perl}}
10,327

edits