Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Christmas puzzle
#3
(12-16-2025, 04:28 PM)kevin Wrote: ...
Here's a little seasonal puzzle. ...

What a wonderful puzzle !  I only just realized - thanks to your code - how the image slicing is done. I hadn't quite grasped the approach until I saw your implementation. I truly appreciate you sharing it !  But just to confirm, the image itself hasn't actually been divided yet, has it ?

Code:
set window "Tiles", 800,600
set redraw off

' Load and slice image into 8×6 tiles
img = loadimage("art/xmas.png", 8, 6)

' Draw all 48 tiles in order (0 to 47) in a grid
do
    cls
    i = 0
    for y = 0 to 5      ' 6 rows
        for x = 0 to 7  ' 8 columns
            draw image img, x*80, y*80, i
            i = i + 1
        next
    next
    redraw
    fwait 60
until keydown(KEY_ESCAPE)
Reply


Messages In This Thread
A Christmas puzzle - by kevin - 12-16-2025, 04:28 PM
RE: A Christmas puzzle - by johnno56 - 12-16-2025, 06:27 PM
RE: A Christmas puzzle - by 1micha.elok - 12-17-2025, 01:47 AM
RE: A Christmas puzzle - by kevin - 12-17-2025, 08:29 AM
RE: A Christmas puzzle - by Marcus - 12-17-2025, 07:55 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)