Colour pinstripe/Display: Difference between revisions

Content deleted Content added
m cf. not c.f. and add one more link
Thundergnat (talk | contribs)
Rename Perl 6 -> Raku, alphabetize, minor clean-up
Line 431: Line 431:
(make-position xpos top)
(make-position xpos top)
(make-position xpos bottom)))))))</lang>
(make-position xpos bottom)))))))</lang>

=={{header|FreeBASIC}}==
=={{header|FreeBASIC}}==
<lang freebasic>' version 14-03-2017
<lang freebasic>' version 14-03-2017
Line 458: Line 459:
Sleep
Sleep
End</lang>
End</lang>

=={{header|Gambas}}==
=={{header|Gambas}}==
<lang gambas>'WARNING this takes a time to display
<lang gambas>'WARNING this takes a time to display
Line 577: Line 579:
size=. getscreenwh_jgtk_ '' NB. J7
size=. getscreenwh_jgtk_ '' NB. J7
'rgb'viewmat (4<.@%~{:size)# ({.size) $&> 1 2 3 4#&.> <256#.255*#:i.8</lang>
'rgb'viewmat (4<.@%~{:size)# ({.size) $&> 1 2 3 4#&.> <256#.255*#:i.8</lang>



=={{header|Java}}==
=={{header|Java}}==
Line 708: Line 709:
}
}
}</lang>
}</lang>

=={{header|M2000 Interpreter}}==
=={{header|M2000 Interpreter}}==
Module names and variables with same name may exist
Module names and variables with same name may exist
Line 854: Line 856:
print DISPLAY $image->png ;
print DISPLAY $image->png ;
close DISPLAY ;</lang>
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}}==
=={{header|Phix}}==
Line 1,126: Line 1,097:
(void (new full-frame%))
(void (new full-frame%))
</lang>
</lang>

=={{header|Raku}}==
(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}}==
=={{header|Ring}}==
Line 1,239: Line 1,243:


}</lang>
}</lang>

=={{header|Sidef}}==
=={{header|Sidef}}==
{{trans|Perl}}
{{trans|Perl}}