Peripheral drift illusion: Difference between revisions

m
syntax highlighting fixup automation
m (Ada: Comment)
m (syntax highlighting fixup automation)
Line 12:
 
=={{header|Action!}}==
<langsyntaxhighlight Actionlang="action!">PROC DrawTile(INT x BYTE y,flip,c1,c2)
BYTE i
 
Line 78:
DO UNTIL CH#$FF OD
CH=$FF
RETURN</langsyntaxhighlight>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Peripheral_drift_illusion.png Screenshot from Atari 8-bit computer]
Line 85:
{{trans|Wren}}
{{libheader|APDF}}
<langsyntaxhighlight Adalang="ada">with PDF_Out; use PDF_Out;
 
procedure Drift is
Line 184:
Draw_Squares;
PDF.Close;
end Drift;</langsyntaxhighlight>
 
=={{header|Julia}}==
Line color tables taken from the Wren example. See the output [https://imgur.com/jKqIgbe on imgur].
<langsyntaxhighlight lang="julia">using Gtk, Colors, Cairo
 
function CodepenApp()
Line 250:
 
CodepenApp()
</syntaxhighlight>
</lang>
 
=={{header|Nim}}==
Line 259:
See window screenshot [https://github.com/lscrd/Rosetta/blob/main/Images/Peripheral_drift_illusion-Nim.png here.]
 
<langsyntaxhighlight Nimlang="nim">import gintro/[glib, gobject, gtk, gio, cairo]
 
const
Line 353:
let app = newApplication(Application, "Rosetta.Illusion")
discard app.connect("activate", activate)
discard app.run()</langsyntaxhighlight>
 
=={{header|Perl}}==
<langsyntaxhighlight lang="perl">use strict;
use warnings;
 
Line 386:
open my $fh, '>', 'peripheral-drift.svg';
print $fh $svg;
close $fh;</langsyntaxhighlight>
See [https://github.com/SqrtNegInf/Rosettacode-Perl5-Smoke/blob/master/ref/peripheral-drift.svg offsite SVG image]
 
Line 392:
{{libheader|Phix/online}}
You can run this online [http://phix.x10.mx/p2js/Peripheral_Drift_Illusion.htm here].
<!--<langsyntaxhighlight Phixlang="phix">(phixonline)-->
<span style="color: #000080;font-style:italic;">--
-- demo\rosetta\Peripheral_Drift_Illusion.exw
Line 475:
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
<span style="color: #000000;">main</span><span style="color: #0000FF;">()</span>
<!--</langsyntaxhighlight>-->
 
=={{header|Raku}}==
<syntaxhighlight lang="raku" perl6line>use SVG;
 
my @blocks = (1..15 X 1..10).map: -> ($X, $Y) {
Line 501:
|@blocks,
]
)</langsyntaxhighlight>
See [https://github.com/thundergnat/rc/blob/master/img/peripheral-drift-raku.svg offsite SVG image]
 
Line 508:
This reproduces the codepen image and does indeed appear to move although it's static.
See the output [https://imgur.com/xyVcnif on imgur]
<langsyntaxhighlight lang="ecmascript">import "dome" for Window
import "graphics" for Canvas, Color
 
Line 577:
}
 
var Game = PeripheralDrift.new()</langsyntaxhighlight>
10,333

edits