Munching squares: Difference between revisions
→{{header|Commodore BASIC}}: Add implementation.
m (→{{header|Phix}}: added syntax colouring, made p2js compatible) |
(→{{header|Commodore BASIC}}: Add implementation.) |
||
Line 360:
//--------------------------------------------------------------------------------------------------
</lang>
=={{header|Commodore BASIC}}==
{{works with|Commodore BASIC|4.0}}
The TED machines (C-16, Plus/4) are the only Commodore 8-bits with a large- or structured- enough color palette to make this interesting. Here's an extremely low-res version (40x25 character-sized "pixels"):
<lang basic>100 FOR I=0 TO 24
110 : Y=INT(I*127/24)
120 : FOR J=0 TO 39
130 : X=INT(J*127/39)
140 : HL = (X OR Y) AND NOT (X AND Y)
150 : H = INT(HL / 8)
160 : L = HL - 8 * H
170 : POKE 2048+I*40+J,L*16+H
180 : POKE 3072+I*40+J,160
190 : NEXT J
210 NEXT I
220 GETKEY K$</lang>
{{Out}}
[https://imgur.com/a/pjl2Pd4 Screenshot.]
=={{header|D}}==
|