Draw a pixel: Difference between revisions

Added solution for Action!
m (→‎{{header|QBASIC}}: changed header QBASIC -> QBasic)
(Added solution for Action!)
Line 7:
::#  the color of the pixel must be red (255,0,0)
::#  the position of the pixel is x = 100, y = 100
 
=={{header|Action!}}==
The solution of this task is tricky because of technical limitation of Atari 8-bit computer. The computer supports high resolution graphics mode of 320 pixels width, 192 pixels height and 1 bit per pixel color. The color of the pixel cannot be set independently from the background color and only different luminance can be specified. To draw a red pixel the background must be set to light-red color.
<lang Action!>PROC Main()
BYTE
CH=$02FC, ;Internal hardware value for last key pressed
PALNTSC=$D014 ;To check if PAL or NTSC system is used
 
Graphics(8+16) ;Graphics 320x192 with 2 luminances
IF PALNTSC=15 THEN
SetColor(1,4,6) ;Red color for NTSC
SetColor(2,4,15)
ELSE
SetColor(1,2,6) ;Red color for PAL
SetColor(2,2,15)
FI
Color=1
Plot(100,100)
DO UNTIL CH#$FF OD
CH=$FF
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Draw_a_pixel.png Screenshot from Atari 8-bit computer]
 
=={{header|Ada}}==
Anonymous user