Greyscale bars/Display: Difference between revisions
m
→{{header|Wren}}: Changed to Wren S/H
m (→{{header|Wren}}: Changed to Wren S/H) |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 165:
RET
</syntaxhighlight>
=={{header|ANSI Standard BASIC}}==▼
{{trans|BBC BASIC}}▼
<syntaxhighlight lang="ansi standard basic">100 SET WINDOW 0,1279,0,1023▼
110 REM (0,0) is the bottom left of the display▼
120 SET AREA COLOR 1 ! Select color one for drawing▼
130 FOR row=1 TO 4▼
140 LET n=IP(2^(row+2))▼
150 LET w=IP(1280/n)▼
160 LET py=IP(256*(4-row))▼
170 FOR b=0 TO n-1▼
180 LET g=b/(n-1)▼
190 IF n=16 OR n=64 THEN LET g=1-g▼
200 SET COLOR MIX(1) g,g,g ! Reprogram color 1 to the gray we want▼
210 PLOT AREA: w*b,py; w*b+w,py; w*b+w,py+256; w*b,py+256▼
220 NEXT b▼
230 NEXT row▼
240 END</syntaxhighlight>▼
=={{header|AutoHotkey}}==
Line 274 ⟶ 254:
</syntaxhighlight>
=={{header|
▲{{trans|BBC BASIC}}
{{works with|Decimal BASIC}}
▲110 REM (0,0) is the bottom left of the display
▲120 SET AREA COLOR 1 ! Select color one for drawing
▲130 FOR row=1 TO 4
▲140 LET n=IP(2^(row+2))
▲150 LET w=IP(1280/n)
▲160 LET py=IP(256*(4-row))
▲170 FOR b=0 TO n-1
▲180 LET g=b/(n-1)
▲190 IF n=16 OR n=64 THEN LET g=1-g
▲200 SET COLOR MIX(1) g,g,g ! Reprogram color 1 to the gray we want
▲210 PLOT AREA: w*b,py; w*b+w,py; w*b+w,py+256; w*b,py+256
▲220 NEXT b
▲230 NEXT row
▲240 END</syntaxhighlight>
==={{header|BASIC256}}===
<syntaxhighlight lang="text">
h=ceil(graphheight/4)
Line 288:
</syntaxhighlight>
==={{header|BBC BASIC}}===
<syntaxhighlight lang="bbcbasic">MODE 8:REM 640 x 512 pixel display mode: BBC BASIC gives 2 graphics points per pixel
REM (0,0) is the bottom left of the display
Line 592:
=={{header|EasyLang}}==
[https://easylang.dev/show/#cod=PY5BDoMgEEX3nOIvK00RMKbdeBqKCYkyDZqa9PSdMSAr5v3PGzImvNRMBYUOvlvshEEB2H48OmvRI8ssndQaGQ84oXwCw8St2wm7StN8Gld6w4uo4tp3XA0VmeahhcrAcbiilb5RPqJ5wXPkN6LU8GPNSwy75HcWXnBbYvzAGutVs2foCV4Z9Qc= Run it]
<syntaxhighlight lang="text">
Line 606:
move sz * i 75 - row * 25
rect sz + 1 25
sleep 0.
.
n *= 2
Line 2,144:
=={{header|Wren}}==
{{libheader|DOME}}
<syntaxhighlight lang="
import "dome" for Window
import "math" for Math
|