Colour pinstripe/Display: Difference between revisions

Improve Uxntal version with suggestions from #uxn IRC channel
No edit summary
(Improve Uxntal version with suggestions from #uxn IRC channel)
 
(6 intermediate revisions by 5 users not shown)
Line 715:
{{works with|Delphi|6.0}}
{{libheader|SysUtils,StdCtrls}}
[[File:DelphiColorStripes.png|frame|none]]
 
 
<syntaxhighlight lang="Delphi">
Line 757:
</pre>
 
=={{header|EasyLang}}==
[https://easylang.dev/show/#cod=PU3LCoMwELznK+bYB5VNsdA99EtCThpBtKTYIPr3ncXQwzKPndmdQsQLASIC5YhyRMmVnEitxOiGvGBk1qNktA5Al2fTRncjrN8YueD+MM8KG33Bt6QPF+zVjK2PA8xMgRir9c5rYmuvckldYfM4+H95MrjCnxnvPZ62bFzjfg== Run it]
<syntaxhighlight>
k[] = [ 000 900 090 009 909 099 990 999 ]
for i = 1 to 4
col = 1
y = 100 - i * 25
for x = 0 step i to 100 - i
color k[col]
move x y
rect i 25
col = (col + 1) mod1 8
.
.
</syntaxhighlight>
 
=={{header|Factor}}==
Line 2,164 ⟶ 2,179:
NEXT i
END</syntaxhighlight>
 
=={{header|Uxntal}}==
<syntaxhighlight lang="uxntal">( uxnasm color-pinstripe.tal color-pinstripe.rom && uxnemu color-pinstripe.rom )
 
|00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
 
|0100
( set theme )
#0f00 .System/r DEO2
#00f0 .System/g DEO2
#000f .System/b DEO2
 
( store screen width )
.Screen/width DEI2 ,draw-layer/width STR2
( store a quarter of the screen height )
.Screen/height DEI2 #02 SFT2 ,&quarter-height STR2
 
( draw the four stripe layers )
#00
&loop ( -- )
( update y coordinate )
#00 OVR [ LIT2 &quarter-height $2 ] MUL2 .Screen/y DEO2
( draw a layer )
INCk draw-layer
( do it four times )
INC DUP #04 LTH ?&loop
POP BRK
 
@draw-layer ( step -: )
( extend step to short, create counter )
#00 SWP #0000
&loop ( -- )
( update x coordinate )
MUL2k .Screen/x DEO2
( fill a region )
DUP #03 AND #80 ORA .Screen/pixel DEO
( loop until the end of the screen )
INC2 MUL2k [ LIT2 &width $2 ] LTH2 ?&loop
POP2 POP2 JMP2r</syntaxhighlight>
[[File:Colour pinstripe-Display in Uxntal.png|thumb|none|alt=Uxntal implementation of Colour pinstripe/display in an emulator.|Running in an emulator.]]
 
=={{header|Visual Basic .NET}}==
Line 2,189 ⟶ 2,245:
{{trans|Go}}
{{libheader|DOME}}
<syntaxhighlight lang="ecmascriptwren">import "graphics" for Canvas, Color
import "dome" for Window
 
57

edits