Jump to content

Colour bars/Display: Difference between revisions

Added solution for Action!
m (→‎{{header|Phix}}: added syntax colouring, made p2js compatible)
(Added solution for Action!)
Line 71:
 
 
 
=={{header|Action!}}==
<lang Action!>PROC Main()
BYTE
i,
CH=$02FC, ;Internal hardware value for last key pressed
PALNTSC=$D014, ;To check if PAL or NTSC system is used
PCOLR0=$02C0,PCOLR1=$02C1,
PCOLR2=$02C2,PCOLR3=$02C3,
COLOR0=$02C4,COLOR1=$02C5,
COLOR2=$02C6,COLOR3=$02C7,
COLOR4=$02C8
Graphics(10)
PCOLR0=$04 ;gray
PCOLR1=$00 ;black
IF PALNTSC=15 THEN
PCOLR2=$42 ;red for NTSC
PCOLR3=$C6 ;green for NTSC
COLOR0=$84 ;blue for NTSC
COLOR1=$66 ;magenta for NTSC
COLOR2=$A6 ;cyan for NTSC
COLOR3=$FC ;yellow for NTSC
ELSE
PCOLR2=$22 ;red for PAL
PCOLR3=$B6 ;green for PAL
COLOR0=$74 ;blue for PAL
COLOR1=$48 ;magenta for PAL
COLOR2=$96 ;cyan for PAL
COLOR3=$EC ;yellow for PAL
FI
COLOR4=$0F ;white
 
FOR i=0 TO 79
DO
Color=i/10+1
Plot(i,0)
DrawTo(i,191)
OD
 
DO UNTIL CH#$FF OD
CH=$FF
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Colour_bars_display.png Screenshot from Atari 8-bit computer]
 
=={{header|ActionScript}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.