Greyscale bars/Display: Difference between revisions

Content added Content deleted
m (ANSI Standard BASIC, BASIC256, and BBC BASIC moved to the BASIC section.)
Line 165: Line 165:
RET
RET
</syntaxhighlight>
</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}}==
=={{header|AutoHotkey}}==
Line 274: Line 254:
</syntaxhighlight>
</syntaxhighlight>


=={{header|BASIC256}}==
=={{header|BASIC}}==
==={{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|BASIC256}}===
<syntaxhighlight lang="text">
<syntaxhighlight lang="text">
h=ceil(graphheight/4)
h=ceil(graphheight/4)
Line 288: Line 287:
</syntaxhighlight>
</syntaxhighlight>


=={{header|BBC BASIC}}==
==={{header|BBC BASIC}}===
<syntaxhighlight lang="bbcbasic">MODE 8:REM 640 x 512 pixel display mode: BBC BASIC gives 2 graphics points per pixel
<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
REM (0,0) is the bottom left of the display