Greyscale bars/Display: Difference between revisions

Content added Content deleted
Line 591: Line 591:
<pre>$ ocaml graphics.cma greyscale_bars.ml</pre>
<pre>$ ocaml graphics.cma greyscale_bars.ml</pre>
=={{header|Perl 6}}==
=={{header|Perl 6}}==
<lang perl6>my $wininfo = qx/xwininfo -root/;
<lang perl6>my $wininfo = qx[xwininfo -root];
my ($width,$height) = ($wininfo ~~ /'Width: ' (\d+) .*? 'Height: ' (\d+)/)[];
my ($width,$height) = ($wininfo ~~ /'Width: ' (\d+) .*? 'Height: ' (\d+)/)[];
($width,$height) = 1280,768 unless $width;
($width,$height) = 1280,768 unless $width;
Line 599: Line 599:
$PGM.print: qq:to/EOH/;
$PGM.print: qq:to/EOH/;
P2
P2
# feep.pgm
# greybars.pgm
$width $height
$width $height
65535
65535