Raster bars: Difference between revisions

m
syntax highlighting fixup automation
m (→‎{{header|Phix}}: added syntax colouring, made p2js compatible)
m (syntax highlighting fixup automation)
Line 11:
=={{header|Ada}}==
{{libheader|SDLAda}}
<langsyntaxhighlight Adalang="ada">with Ada.Numerics.Elementary_Functions;
 
with SDL.Video.Windows.Makers;
Line 107:
Window.Finalize;
SDL.Finalise;
end Raster_Bars;</langsyntaxhighlight>
 
=={{header|Go}}==
Line 122:
</pre>
 
<langsyntaxhighlight lang="go">package main
 
import (
Line 205:
log.Fatal(err2)
}
}</langsyntaxhighlight>
 
 
=={{header|Julia}}==
<langsyntaxhighlight lang="julia">using Colors, Cairo, Gtk
 
const can = GtkCanvas()
Line 261:
end
end
</syntaxhighlight>
</lang>
 
=={{header|Nim}}==
{{trans|Julia}}
{{libheader|gintro}}
<langsyntaxhighlight Nimlang="nim">import gintro/[gobject, glib, gdk, gtk, gio, cairo]
 
 
Line 353:
let app = newApplication(Application, "Rosetta.rasterbars")
discard app.connect("activate", activate)
discard app.run()</langsyntaxhighlight>
 
=={{header|Phix}}==
Some grey bars that vaguely shimmer as they march up the screen... (did not turn out quite as well as hoped)
<!--<langsyntaxhighlight Phixlang="phix">(phixonline)-->
<span style="color: #000080;font-style:italic;">-- demo\rosetta\Raster_bars.exw</span>
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
Line 435:
<span style="color: #000000;">main</span><span style="color: #0000FF;">()</span>
<!--</langsyntaxhighlight>-->
 
=={{header|Raku}}==
Line 458:
* Press Q to exit.
 
<syntaxhighlight lang="raku" perl6line>unit sub MAIN (
Int :b(:$bar-height) is copy = 60; #= Height of the individual "Raster bars", minimum 32 (pixels)
Int :d(:$dir) is copy = -1; #= Scroll direction: -1 is "up" 1 is "down"
Line 657:
}
$fps
}</langsyntaxhighlight>
 
Screenshot still of typical run: [https://github.com/thundergnat/rc/blob/master/img/Raster-bars-Perl6.png (offsite .png image)]
Line 664:
 
=={{header|Rust}}==
<langsyntaxhighlight lang="rust">
extern crate minifb;
 
Line 763:
}
}
</syntaxhighlight>
</lang>
 
 
Line 772:
 
As DOME has no facility to create an animated .gif file, the moving image is displayed but not saved.
<langsyntaxhighlight lang="ecmascript">import "dome" for Window
import "graphics" for Canvas, Color
 
Line 859:
}
 
var Game = RasterBars.new(500, 500)</langsyntaxhighlight>
10,327

edits