12-17-2025, 01:47 AM
(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)
