Anonymous user
Munching squares: Difference between revisions
Added solution for Action!
(→{{header|Commodore BASIC}}: Add implementation.) |
(Added solution for Action!) |
||
Line 4:
{{omit from|Lilypond}}
Render a graphical pattern where each pixel is colored by the value of 'x xor y' from an arbitrary [[wp:color table|color table]].
=={{header|Action!}}==
<lang Action!>PROC PutBigPixel(BYTE x,y,c)
BYTE i
Color=c
x=x*3+16
y=y*12
FOR i=0 TO 11
DO
Plot(x,y+i)
DrawTo(x+2,y+i)
OD
RETURN
PROC Main()
BYTE
CH=$02FC, ;Internal hardware value for last key pressed
x,y
Graphics(9)
FOR y=0 TO 15
DO
FOR x=0 TO 15
DO
PutBigPixel(x,y,x!y)
OD
OD
DO UNTIL CH#$FF OD
CH=$FF
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Munching_squares.png Screenshot from Atari 8-bit computer]
=={{header|Ada}}==
|