Colour pinstripe/Display: Difference between revisions

Content deleted Content added
→‎{{header|Lua}}: added Lua solution
Thundergnat (talk | contribs)
m syntax highlighting fixup automation
Line 18: Line 18:
{{works with|https://skilldrick.github.io/easy6502/ Easy6502}}
{{works with|https://skilldrick.github.io/easy6502/ Easy6502}}
Output can be seen by copying and pasting this code into the code editor, then clicking "Assemble," then "Run."
Output can be seen by copying and pasting this code into the code editor, then clicking "Assemble," then "Run."
<lang 6502asm>define color $00
<syntaxhighlight lang="6502asm">define color $00
define looptemp $01
define looptemp $01


Line 113: Line 113:
bcc loop_4wide
bcc loop_4wide


brk ;program end</lang>
brk ;program end</syntaxhighlight>


=={{header|Action!}}==
=={{header|Action!}}==
<lang Action!>PROC Main()
<syntaxhighlight lang="action!">PROC Main()
BYTE
BYTE
i,
i,
Line 164: Line 164:
DO UNTIL CH#$FF OD
DO UNTIL CH#$FF OD
CH=$FF
CH=$FF
RETURN</lang>
RETURN</syntaxhighlight>
{{out}}
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Colour_pinstripe_display.png Screenshot from Atari 8-bit computer]
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Colour_pinstripe_display.png Screenshot from Atari 8-bit computer]


=={{header|ActionScript}}==
=={{header|ActionScript}}==
<syntaxhighlight lang="actionscript3">
<lang ActionScript3>
package {
package {
Line 225: Line 225:


}
}
</syntaxhighlight>
</lang>


=={{header|Ada}}==
=={{header|Ada}}==
{{libheader|SDLAda}}
{{libheader|SDLAda}}
<lang Ada>with SDL.Video.Windows.Makers;
<syntaxhighlight lang="ada">with SDL.Video.Windows.Makers;
with SDL.Video.Renderers.Makers;
with SDL.Video.Renderers.Makers;
with SDL.Video.Palettes;
with SDL.Video.Palettes;
Line 302: Line 302:
Window.Finalize;
Window.Finalize;
SDL.Finalise;
SDL.Finalise;
end Colour_Pinstripe_Display;</lang>
end Colour_Pinstripe_Display;</syntaxhighlight>


=={{header|ARM Assembly}}==
=={{header|ARM Assembly}}==
Line 310: Line 310:
This uses the Game Boy Advance's bitmap screen modes; no pre-defined tilemaps are needed.
This uses the Game Boy Advance's bitmap screen modes; no pre-defined tilemaps are needed.


<lang ARM Assembly> .org 0x08000000 ;cartridge ROM begins here
<syntaxhighlight lang="arm assembly"> .org 0x08000000 ;cartridge ROM begins here


b ProgramStart ;branch around the cartridge header
b ProgramStart ;branch around the cartridge header
Line 399: Line 399:
.word 0b0111111111100000 ;cyan
.word 0b0111111111100000 ;cyan
.word 0b0000001111111111 ;yellow
.word 0b0000001111111111 ;yellow
.word 0x7FFF ;white</lang>
.word 0x7FFF ;white</syntaxhighlight>


{{out}}
{{out}}
Line 410: Line 410:
Requires the GDI+ standard library: http://www.autohotkey.com/forum/viewtopic.php?t=32238<br/>
Requires the GDI+ standard library: http://www.autohotkey.com/forum/viewtopic.php?t=32238<br/>
It is worth noting that this fills the whole screen; press Esc to exit.
It is worth noting that this fills the whole screen; press Esc to exit.
<lang AHK>h := A_ScreenHeight
<syntaxhighlight lang="ahk">h := A_ScreenHeight
w := A_ScreenWidth
w := A_ScreenWidth
pToken := gdip_Startup()
pToken := gdip_Startup()
Line 452: Line 452:
Exit:
Exit:
Gdip_Shutdown(pToken)
Gdip_Shutdown(pToken)
ExitApp</lang>
ExitApp</syntaxhighlight>


=={{header|BASIC256}}==
=={{header|BASIC256}}==
{{trans|Yabasic}}
{{trans|Yabasic}}
<lang BASIC256>w = 640 : h = 480
<syntaxhighlight lang="basic256">w = 640 : h = 480
graphsize w, h
graphsize w, h


Line 471: Line 471:
col += 1
col += 1
next x
next x
next i</lang>
next i</syntaxhighlight>


=={{header|BBC BASIC}}==
=={{header|BBC BASIC}}==
{{works with|BBC BASIC for Windows}}
{{works with|BBC BASIC for Windows}}
<lang bbcbasic> SW_MAXIMIZE = 3
<syntaxhighlight lang="bbcbasic"> SW_MAXIMIZE = 3
SYS "ShowWindow", @hwnd%, SW_MAXIMIZE
SYS "ShowWindow", @hwnd%, SW_MAXIMIZE
VDU 26
VDU 26
Line 499: Line 499:
NEXT
NEXT
NEXT P%
NEXT P%
</syntaxhighlight>
</lang>


=={{header|Befunge}}==
=={{header|Befunge}}==
Line 507: Line 507:
The dimensions of the image are specified by the first two values on the stack: 1366 (<tt>"%":*3-</tt>) by 768 (<tt>"`"8*</tt>).
The dimensions of the image are specified by the first two values on the stack: 1366 (<tt>"%":*3-</tt>) by 768 (<tt>"`"8*</tt>).


<lang befunge>"%":*3-"`"8*>4/::8%00p8/10p4*\55+"3P",,,:.\.5v
<syntaxhighlight lang="befunge">"%":*3-"`"8*>4/::8%00p8/10p4*\55+"3P",,,:.\.5v
5+:,1vv\%2:%8/-g025:\-1_$$55+,\:v1+*8g01g00_@>
5+:,1vv\%2:%8/-g025:\-1_$$55+,\:v1+*8g01g00_@>
024,.<>2/:2%\2/...1+\:>^<:\0:\-1_$20g1-:20p^1p</lang>
024,.<>2/:2%\2/...1+\:>^<:\0:\-1_$20g1-:20p^1p</syntaxhighlight>


=={{header|C}}==
=={{header|C}}==
Line 515: Line 515:
The following code uses the BGI graphics library of Borland's Turbo C.
The following code uses the BGI graphics library of Borland's Turbo C.


<syntaxhighlight lang="c">
<lang C>
#include<graphics.h>
#include<graphics.h>
#include<conio.h>
#include<conio.h>
Line 544: Line 544:
return 0;
return 0;
}
}
</syntaxhighlight>
</lang>


=={{header|C++}}==
=={{header|C++}}==
[[File:clr_pinstripe_cpp.png|300px]]
[[File:clr_pinstripe_cpp.png|300px]]
<lang cpp>
<syntaxhighlight lang="cpp">
#include <windows.h>
#include <windows.h>


Line 669: Line 669:
}
}
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
</syntaxhighlight>
</lang>


=={{header|Common Lisp}}==
=={{header|Common Lisp}}==
Line 675: Line 675:
which causes the line caps to make the edges between regions to be a bit ragged. I mention
which causes the line caps to make the edges between regions to be a bit ragged. I mention
a couple of alternatives there which I'm too lazy to implement right now.
a couple of alternatives there which I'm too lazy to implement right now.
<lang lisp>(in-package :cg-user)
<syntaxhighlight lang="lisp">(in-package :cg-user)


;;; We only need a bitmap pane - nothing fancy
;;; We only need a bitmap pane - nothing fancy
Line 709: Line 709:
(draw-line win
(draw-line win
(make-position xpos top)
(make-position xpos top)
(make-position xpos bottom)))))))</lang>
(make-position xpos bottom)))))))</syntaxhighlight>


=={{header|Factor}}==
=={{header|Factor}}==
<lang factor>USING: accessors arrays colors.constants kernel locals math
<syntaxhighlight lang="factor">USING: accessors arrays colors.constants kernel locals math
math.ranges opengl sequences ui ui.gadgets ui.render ;
math.ranges opengl sequences ui ui.gadgets ui.render ;


Line 749: Line 749:
bands [1,b] [ draw-pinstripe ] with each ;
bands [1,b] [ draw-pinstripe ] with each ;


<pinstripe> "Color pinstripe" open-window</lang>
<pinstripe> "Color pinstripe" open-window</syntaxhighlight>


=={{header|FreeBASIC}}==
=={{header|FreeBASIC}}==
<lang freebasic>' version 14-03-2017
<syntaxhighlight lang="freebasic">' version 14-03-2017
' compile with: fbc -s console
' compile with: fbc -s console
' or compile with: fbc -s gui
' or compile with: fbc -s gui
Line 777: Line 777:
'Print : Print "hit any key to end program"
'Print : Print "hit any key to end program"
Sleep
Sleep
End</lang>
End</syntaxhighlight>


=={{header|Gambas}}==
=={{header|Gambas}}==
<lang gambas>'WARNING this takes a time to display
<syntaxhighlight lang="gambas">'WARNING this takes a time to display


Public Sub Form_Open()
Public Sub Form_Open()
Line 807: Line 807:


End
End
</syntaxhighlight>
</lang>
'''[http://www.cogier.com/gambas/colour_pinstripe.png Click to see output image]'''
'''[http://www.cogier.com/gambas/colour_pinstripe.png Click to see output image]'''


Line 813: Line 813:
{{libheader|Go Graphics}}
{{libheader|Go Graphics}}
{{trans|Java}}
{{trans|Java}}
<lang go>package main
<syntaxhighlight lang="go">package main


import "github.com/fogleman/gg"
import "github.com/fogleman/gg"
Line 845: Line 845:
pinstripe(dc)
pinstripe(dc)
dc.SavePNG("color_pinstripe.png")
dc.SavePNG("color_pinstripe.png")
}</lang>
}</syntaxhighlight>


{{out}}
{{out}}
Line 855: Line 855:
This is a modified version of the [[Pinstripe/Display]] solution. A shrunken screenshot is included.
This is a modified version of the [[Pinstripe/Display]] solution. A shrunken screenshot is included.


<lang Icon>link graphics,numbers,printf
<syntaxhighlight lang="icon">link graphics,numbers,printf
procedure main() # pinstripe
procedure main() # pinstripe
Line 884: Line 884:
}
}
WDone()
WDone()
end</lang>
end</syntaxhighlight>


[[File:Pinstripe_Colour_unicon.jpeg]]
[[File:Pinstripe_Colour_unicon.jpeg]]
Line 894: Line 894:


=={{header|J}}==
=={{header|J}}==
<lang j> load 'viewmat'
<syntaxhighlight lang="j"> load 'viewmat'
size=. 2{.".wd'qm' NB. J6
size=. 2{.".wd'qm' NB. J6
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</syntaxhighlight>


=={{header|Java}}==
=={{header|Java}}==
{{works with|Java|8}}
{{works with|Java|8}}
<lang java>import java.awt.*;
<syntaxhighlight lang="java">import java.awt.*;
import static java.awt.Color.*;
import static java.awt.Color.*;
import javax.swing.*;
import javax.swing.*;
Line 938: Line 938:
});
});
}
}
}</lang>
}</syntaxhighlight>


=={{header|Julia}}==
=={{header|Julia}}==
<lang julia>using Gtk, Graphics, Colors
<syntaxhighlight lang="julia">using Gtk, Graphics, Colors


function drawline(ctx, p1, p2, color, width)
function drawline(ctx, p1, p2, color, width)
Line 982: Line 982:
signal_connect(endit, win, :destroy)
signal_connect(endit, win, :destroy)
wait(cond)
wait(cond)
</syntaxhighlight>
</lang>


=={{header|Kotlin}}==
=={{header|Kotlin}}==
{{trans|Java}}
{{trans|Java}}
<lang scala>// version 1.1.0
<syntaxhighlight lang="scala">// version 1.1.0


import java.awt.*
import java.awt.*
Line 1,027: Line 1,027:
f.isVisible = true
f.isVisible = true
}
}
}</lang>
}</syntaxhighlight>


=={{header|Lua}}==
=={{header|Lua}}==
{{libheader|nw}}
{{libheader|nw}}
{{libheader|cairo}}
{{libheader|cairo}}
<lang lua>local nw = require("nw")
<syntaxhighlight lang="lua">local nw = require("nw")
local app = nw:app()
local app = nw:app()
local cw, ch = 320, 240
local cw, ch = 320, 240
Line 1,052: Line 1,052:
end
end
win:show()
win:show()
app:run()</lang>
app:run()</syntaxhighlight>


=={{header|M2000 Interpreter}}==
=={{header|M2000 Interpreter}}==
Line 1,064: Line 1,064:
We use a thread to move the layer above console (and inside console form), when we push any mouse button (only in console window). Program ends when we close the modal opened window.
We use a thread to move the layer above console (and inside console form), when we push any mouse button (only in console window). Program ends when we close the modal opened window.


<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
Module Checkit {
Module Checkit {
Window 16, 14000,12000;
Window 16, 14000,12000;
Line 1,114: Line 1,114:
Checkit
Checkit


</syntaxhighlight>
</lang>


=={{header|Maple}}==
=={{header|Maple}}==
<syntaxhighlight lang="maple">
<lang Maple>
colors := [yellow, black, red, green, magenta, cyan, white]:
colors := [yellow, black, red, green, magenta, cyan, white]:
plots:-display( [
plots:-display( [
Line 1,123: Line 1,123:
seq( plot([1+i/10,y,y=4..5], color=colors[i mod 7 + 1],thickness=2), i = 1..500),seq( plot([1+i/10,y,y=3..4], color=colors[i mod 7 + 1],thickness=3), i = 1..500),seq( plot([1+i/10,y,y=2..3], color=colors[i mod 7 + 1],thickness=4,size=[interface(screenwidth)*20,interface(screenheight)*32]), i = 1..500)],
seq( plot([1+i/10,y,y=4..5], color=colors[i mod 7 + 1],thickness=2), i = 1..500),seq( plot([1+i/10,y,y=3..4], color=colors[i mod 7 + 1],thickness=3), i = 1..500),seq( plot([1+i/10,y,y=2..3], color=colors[i mod 7 + 1],thickness=4,size=[interface(screenwidth)*20,interface(screenheight)*32]), i = 1..500)],
axes=none);
axes=none);
</syntaxhighlight>
</lang>


=={{header|Mathematica}} / {{header|Wolfram Language}}==
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<lang Mathematica>color[y_] := {Black, Red, Green, Blue, Magenta, Cyan, Yellow,
<syntaxhighlight lang="mathematica">color[y_] := {Black, Red, Green, Blue, Magenta, Cyan, Yellow,
White}[[Mod[y, 8] + 1]];
White}[[Mod[y, 8] + 1]];
Graphics[Join[{Thickness[1/408]},
Graphics[Join[{Thickness[1/408]},
Line 1,136: Line 1,136:
Range[136]], {Thickness[1/102]},
Range[136]], {Thickness[1/102]},
Flatten[{color[#], Line[{{4 # - 2, 102}, {4 # - 2, 1}}]} & /@
Flatten[{color[#], Line[{{4 # - 2, 102}, {4 # - 2, 1}}]} & /@
Range[102]]], ImageSize -> {408, 408}]</lang>
Range[102]]], ImageSize -> {408, 408}]</syntaxhighlight>
{{out}}
{{out}}
See [https://www.dropbox.com/s/tg4zk4jkddkok8w/Mathematica_Pinstripes_Colored.png?dl=0 here].
See [https://www.dropbox.com/s/tg4zk4jkddkok8w/Mathematica_Pinstripes_Colored.png?dl=0 here].
Line 1,142: Line 1,142:
=={{header|MIPS Assembly}}==
=={{header|MIPS Assembly}}==
This isn't perfect, as the edges are cut off due to overscan. But this is as close as I could get:
This isn't perfect, as the edges are cut off due to overscan. But this is as close as I could get:
<lang mips>.include "\SrcAll\Header.asm"
<syntaxhighlight lang="mips">.include "\SrcAll\Header.asm"
.include "\SrcAll\BasicMacros.asm"
.include "\SrcAll\BasicMacros.asm"
.include "\SrcALL\AdvancedMacros.asm"
.include "\SrcALL\AdvancedMacros.asm"
Line 1,351: Line 1,351:
;colors are approximate because I'm not sure how the bit patterns work.
;colors are approximate because I'm not sure how the bit patterns work.
.halfword 0x0000,0xf000,0x0f00,0x00f0,0xf0f0,0x7fff,0xff00,0xffff
.halfword 0x0000,0xf000,0x0f00,0x00f0,0xf0f0,0x7fff,0xff00,0xffff
.include "\SrcN64\Footer.asm"</lang>
.include "\SrcN64\Footer.asm"</syntaxhighlight>


{{out}}
{{out}}
Line 1,358: Line 1,358:
=={{header|Nim}}==
=={{header|Nim}}==
{{libheader|gintro}}
{{libheader|gintro}}
<lang Nim>import gintro/[glib, gobject, gtk, gio, cairo]
<syntaxhighlight lang="nim">import gintro/[glib, gobject, gtk, gio, cairo]


const
const
Line 1,420: Line 1,420:
let app = newApplication(Application, "Rosetta.ColorPinstripe")
let app = newApplication(Application, "Rosetta.ColorPinstripe")
discard app.connect("activate", activate)
discard app.connect("activate", activate)
discard app.run()</lang>
discard app.run()</syntaxhighlight>


=={{header|OCaml}}==
=={{header|OCaml}}==


<lang ocaml>open Graphics
<syntaxhighlight lang="ocaml">open Graphics


let () =
let () =
Line 1,440: Line 1,440:
done
done
done;
done;
ignore(read_key())</lang>
ignore(read_key())</syntaxhighlight>


run with:
run with:
Line 1,446: Line 1,446:


=={{header|Perl}}==
=={{header|Perl}}==
<lang Perl>#!/usr/bin/perl -w
<syntaxhighlight lang="perl">#!/usr/bin/perl -w
use strict ;
use strict ;
use GD ;
use GD ;
Line 1,481: Line 1,481:
binmode DISPLAY ;
binmode DISPLAY ;
print DISPLAY $image->png ;
print DISPLAY $image->png ;
close DISPLAY ;</lang>
close DISPLAY ;</syntaxhighlight>


=={{header|Phix}}==
=={{header|Phix}}==
{{libheader|Phix/pGUI}}
{{libheader|Phix/pGUI}}
<!--<lang Phix>(phixonline)-->
<!--<syntaxhighlight lang="phix">(phixonline)-->
<span style="color: #000080;font-style:italic;">--
<span style="color: #000080;font-style:italic;">--
-- demo\rosetta\Colour_pinstripe.exw
-- demo\rosetta\Colour_pinstripe.exw
Line 1,574: Line 1,574:
<span style="color: #000000;">main</span><span style="color: #0000FF;">()</span>
<span style="color: #000000;">main</span><span style="color: #0000FF;">()</span>
<!--</lang>-->
<!--</syntaxhighlight>-->
Simply change constant colours to {CD_BLACK, CD_WHITE} for the monochrome tasks (as redirected here).
Simply change constant colours to {CD_BLACK, CD_WHITE} for the monochrome tasks (as redirected here).


Line 1,584: Line 1,584:


=={{header|PicoLisp}}==
=={{header|PicoLisp}}==
<lang PicoLisp>(de *Colors # Black Red Green Blue Magenta Cyan Yellow White
<syntaxhighlight lang="picolisp">(de *Colors # Black Red Green Blue Magenta Cyan Yellow White
((0 0 0) (255 0 0) (0 255 0) (0 0 255)
((0 0 0) (255 0 0) (0 255 0) (0 0 255)
(255 0 255) (0 255 255) (255 255 0) (255 255 255) .) )
(255 0 255) (0 255 255) (255 255 0) (255 255 255) .) )
Line 1,601: Line 1,601:
(prinl (length (car Ppm)) " " (length Ppm))
(prinl (length (car Ppm)) " " (length Ppm))
(prinl 255)
(prinl 255)
(for Y Ppm (for X Y (apply wr X))) ) )</lang>
(for Y Ppm (for X Y (apply wr X))) ) )</syntaxhighlight>


=={{header|Plain English}}==
=={{header|Plain English}}==
<lang plainenglish>To run:
<syntaxhighlight lang="plainenglish">To run:
Start up.
Start up.
Clear the screen.
Clear the screen.
Line 1,643: Line 1,643:
Add 1 pixel to the color pinstripe's width.
Add 1 pixel to the color pinstripe's width.
Move the color pinstripe's box down the color pinstripe's box's height.
Move the color pinstripe's box down the color pinstripe's box's height.
Draw the color pinstripe.</lang>
Draw the color pinstripe.</syntaxhighlight>


=={{header|PureBasic}}==
=={{header|PureBasic}}==
<lang PureBasic>;Create a Pinstripe image with a pattern of vertical stripe colors
<syntaxhighlight lang="purebasic">;Create a Pinstripe image with a pattern of vertical stripe colors
Procedure PinstripeDisplay(width, height, Array psColors(1), numColors = 0)
Procedure PinstripeDisplay(width, height, Array psColors(1), numColors = 0)
Protected x, imgID, psHeight = height / 4, psWidth = 1, psTop, horzBand, curColor
Protected x, imgID, psHeight = height / 4, psWidth = 1, psTop, horzBand, curColor
Line 1,688: Line 1,688:
While WaitWindowEvent() <> #PB_Event_CloseWindow
While WaitWindowEvent() <> #PB_Event_CloseWindow
Wend
Wend
EndIf</lang>
EndIf</syntaxhighlight>


=={{header|Python}}==
=={{header|Python}}==
<syntaxhighlight lang="python">
<lang Python>
from turtle import *
from turtle import *


Line 1,726: Line 1,726:
notused = input("Hit enter to continue: ")
notused = input("Hit enter to continue: ")
</syntaxhighlight>
</lang>


=={{header|QBasic}}==
=={{header|QBasic}}==
{{works with|QBasic|1.1}}
{{works with|QBasic|1.1}}
{{trans|BASIC256}}
{{trans|BASIC256}}
<lang qbasic>SCREEN 12
<syntaxhighlight lang="qbasic">SCREEN 12
w = 640: h = 480
w = 640: h = 480


Line 1,745: Line 1,745:
col = col + 1
col = col + 1
NEXT x
NEXT x
NEXT i</lang>
NEXT i</syntaxhighlight>


=={{header|Racket}}==
=={{header|Racket}}==
<syntaxhighlight lang="racket">
<lang Racket>
#lang racket/gui
#lang racket/gui


Line 1,779: Line 1,779:


(void (new full-frame%))
(void (new full-frame%))
</syntaxhighlight>
</lang>


=={{header|Raku}}==
=={{header|Raku}}==
(formerly Perl 6)
(formerly Perl 6)
<lang perl6>my ($x,$y) = 1280, 720;
<syntaxhighlight lang="raku" line>my ($x,$y) = 1280, 720;


my @colors = map -> $r, $g, $b { [$r, $g, $b] },
my @colors = map -> $r, $g, $b { [$r, $g, $b] },
Line 1,811: Line 1,811:
}
}


$img.close;</lang>
$img.close;</syntaxhighlight>


=={{header|Ring}}==
=={{header|Ring}}==
<lang ring>
<syntaxhighlight lang="ring">
# Project : Colour pinstripe/Display
# Project : Colour pinstripe/Display


Line 1,878: Line 1,878:
}
}
label1 { setpicture(p1) show() }
label1 { setpicture(p1) show() }
</syntaxhighlight>
</lang>


See image:
See image:
Line 1,886: Line 1,886:
=={{header|Scala}}==
=={{header|Scala}}==
===Java Swing Interoperability===
===Java Swing Interoperability===
<lang Scala>import java.awt.Color._
<syntaxhighlight lang="scala">import java.awt.Color._
import java.awt._
import java.awt._


Line 1,924: Line 1,924:
)
)


}</lang>
}</syntaxhighlight>


=={{header|Sidef}}==
=={{header|Sidef}}==
{{trans|Perl}}
{{trans|Perl}}
<lang ruby>require('GD')
<syntaxhighlight lang="ruby">require('GD')


func pinstripes(width = 1280, height = 720) {
func pinstripes(width = 1280, height = 720) {
Line 1,957: Line 1,957:
}
}


File('pinstripes.png').write(pinstripes().png, :raw)</lang>
File('pinstripes.png').write(pinstripes().png, :raw)</syntaxhighlight>


=={{header|SmileBASIC}}==
=={{header|SmileBASIC}}==
<lang smilebasic>FOR I=1 TO 4
<syntaxhighlight lang="smilebasic">FOR I=1 TO 4
COLIDX=0
COLIDX=0
YTOP=(I-1)*60
YTOP=(I-1)*60
Line 1,981: Line 1,981:
DATA 0,255,255
DATA 0,255,255
DATA 255,255,0
DATA 255,255,0
DATA 255,255,255</lang>
DATA 255,255,255</syntaxhighlight>


=={{header|Tcl}}==
=={{header|Tcl}}==
{{libheader|Tk}}
{{libheader|Tk}}
<lang tcl>package require Tcl 8.5
<syntaxhighlight lang="tcl">package require Tcl 8.5
package require Tk 8.5
package require Tk 8.5
Line 2,001: Line 2,001:
}
}
incr y $dy
incr y $dy
}</lang>
}</syntaxhighlight>


=={{header|True BASIC}}==
=={{header|True BASIC}}==
<lang qbasic>LET w = 640
<syntaxhighlight lang="qbasic">LET w = 640
LET h = 480
LET h = 480
SET WINDOW 0, w, 0, h
SET WINDOW 0, w, 0, h
Line 2,021: Line 2,021:
NEXT x
NEXT x
NEXT i
NEXT i
END</lang>
END</syntaxhighlight>


=={{header|Visual Basic .NET}}==
=={{header|Visual Basic .NET}}==
<lang vbnet>Public Class Main
<syntaxhighlight lang="vbnet">Public Class Main
Inherits System.Windows.Forms.Form
Inherits System.Windows.Forms.Form
Public Sub New()
Public Sub New()
Line 2,042: Line 2,042:
Next
Next
End Sub
End Sub
End Class</lang>
End Class</syntaxhighlight>


=={{header|Wren}}==
=={{header|Wren}}==
{{trans|Go}}
{{trans|Go}}
{{libheader|DOME}}
{{libheader|DOME}}
<lang ecmascript>import "graphics" for Canvas, Color
<syntaxhighlight lang="ecmascript">import "graphics" for Canvas, Color
import "dome" for Window
import "dome" for Window


Line 2,088: Line 2,088:


static draw(dt) {}
static draw(dt) {}
}</lang>
}</syntaxhighlight>


=={{header|XPL0}}==
=={{header|XPL0}}==
[[File:PinsXPL0.gif|right]]
[[File:PinsXPL0.gif|right]]
<lang XPL0>code ChIn=7, Point=41, SetVid=45;
<syntaxhighlight lang="xpl0">code ChIn=7, Point=41, SetVid=45;
int X, Y, W, C;
int X, Y, W, C;
[SetVid($13); \set 320x200 graphics mode in 256 colors
[SetVid($13); \set 320x200 graphics mode in 256 colors
Line 2,105: Line 2,105:
X:= ChIn(1); \wait for keystroke
X:= ChIn(1); \wait for keystroke
SetVid(3); \restore normal text mode display
SetVid(3); \restore normal text mode display
]</lang>
]</syntaxhighlight>


=={{header|Yabasic}}==
=={{header|Yabasic}}==
{{trans|SmileBASIC}}
{{trans|SmileBASIC}}
<lang Yabasic>w = 640 : h = 480
<syntaxhighlight lang="yabasic">w = 640 : h = 480
open window w, h
open window w, h
h4 = h/4
h4 = h/4
Line 2,134: Line 2,134:
DATA 255,255,0
DATA 255,255,0
DATA 255,255,255
DATA 255,255,255
</syntaxhighlight>
</lang>


{{omit from|AWK}}
{{omit from|AWK}}