Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Brick Pattern Fill Question
#1
I came upon this in Help. I like what it does, but don't get how it works. How do the CHR$(&H0)s and CHR$(&HEF)s create the string pattern to be filled? I understand the &H definition in Help is hex base 16 format, but that's as far as I go... Thanks!

DIM Row$(1 TO 8)
SCREEN 12

'make red-brick wall
Row$(1) = CHR$(&H0) + CHR$(&H0) + CHR$(&HFE) + CHR$(&HFE)
Row$(2) = Row$(1)
Row$(3) = Row$(1)
Row$(4) = CHR$(&H0) + CHR$(&H0) + CHR$(&H0) + CHR$(&H0)
Row$(5) = CHR$(&H0) + CHR$(&H0) + CHR$(&HEF) + CHR$(&HEF)
Row$(6) = Row$(5)
Row$(7) = Row$(5)
Row$(8) = Row$(4)
Tile$ = Row$(1) + Row$(2) + Row$(3) + Row$(4) + Row$(5) + Row$(6) + Row$(7) + Row$(8)

LINE (59, 124)-(581, 336), 14, B 'yellow box border to paint inside
PAINT (320, 240), Tile$, 14 'paints brick tiles within yellow border
Reply
#2
Screen 12 is a 256 color screen, so each of those CHR$ characters are a color.

CHR$(0) = Black.
CHR$(?? -- translate that hex) = Brick Orange-Red

BBOO
BBOO
BBOO
BBBB
BBOO
BBOO
BBOO
BBBB

And repeat that for the fill pattern.
Reply
#3
(May need to rotate it 90 degrees as screens are read down then right instead of right then down.)
Reply
#4
(12-01-2023, 07:37 PM)SMcNeill Wrote: (May need to rotate it 90 degrees as screens are read down then right instead of right then down.)
OK, gotcha. Thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  _Putimage Question. Pete 11 672 01-04-2026, 09:33 PM
Last Post: Pete
  Nice simple, I hope, question Mad Axeman 4 335 12-20-2025, 09:28 PM
Last Post: SMcNeill
  NewBie Question niteflyer 2 329 11-06-2025, 07:11 PM
Last Post: Petr
  A Question About _MAPTRIANGLE Magdha 2 373 11-02-2025, 11:37 AM
Last Post: Magdha
  '$include: 'file.tmr' Timing Question pmackay 2 428 10-16-2025, 12:20 PM
Last Post: a740g

Forum Jump:


Users browsing this thread: 1 Guest(s)