You play by walking up and punching two pieces next to each other, to swap them. If this matches three or more pieces in a row, they will vanish and new pieces will drop down. If there's no match, the pieces won't swap. Since you have to punch the blocks, it's easier to make puzzles low to the ground, although a determined player could build a scaffold to get higher.
Once the player(s) reach a certain score, the puzzle pieces and scrith will all evaporate, leaving the way clear to the prize. The score required to win increases as you move away from origin (0, 0, 0). Play is complicated by TNT blocks that drop down past a certain point. If they match, they explode, possibly injuring you, and probably destroying things inside.
If you place an empty chest inside, it will automagically be filled with some minor loot, after the game is won. This uses the dungeon_loot mod in the default game.
I've used this mod in my flat_vm mod. It could give you an example of how to generate puzzles automatically.
Screenshot
Spoiler
Code: LGPL2
Mod dependencies: default, dungeon_loot
Download: https://github.com/duane-r/match_three/ ... master.zip