NaaLaa
A Christmas puzzle - Printable Version

+- NaaLaa (https://www.naalaa.com/forum)
+-- Forum: NaaLaa (https://www.naalaa.com/forum/forum-1.html)
+--- Forum: NaaLaa 7 Code (https://www.naalaa.com/forum/forum-4.html)
+--- Thread: A Christmas puzzle (/thread-338.html)



A Christmas puzzle - kevin - 12-16-2025

Hi,

Merry Christmas all, and best wishes for a fun, healthy, 2026.

Here's a little seasonal puzzle. Move the pieces in the lower part of the screen by holding the left mouse button down, and dragging them into the grid (above left). Release the button to release the puzzle piece in the correct place in the grid.

All the best - Kevin.


.zip   Xmas puzzle.zip (Size: 3.67 MB / Downloads: 11)


RE: A Christmas puzzle - johnno56 - 12-16-2025

Very cool! I even liked the fireworks!


RE: A Christmas puzzle - 1micha.elok - 12-17-2025

(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)



RE: A Christmas puzzle - Marcus - 12-17-2025

I solved it! Well put together! Thank you for the game!


RE: A Christmas puzzle - kevin - 12-17-2025

"But just to confirm, the image itself hasn't actually been divided yet, has it?"

That's right. You could use any complete image, and NaaLaa can split it into small tiles - the tilemap editor does this, as well as any sprite sheet routine.