BAM: Very Simple Tile-Sliding Puzzle
|
07-14-2023, 08:53 PM
Tiles are switched via scrolling. Nothing fancy, but I added a little bit of animation to the scrolling.
Next, make the code generic enough to handle various grid sizes.
07-15-2023, 01:50 AM
Nice one. The animation added a lot. Game is harder than I first thought it would be at first.
- Dav (07-15-2023, 01:50 AM)Dav Wrote: Nice one. The animation added a lot. Game is harder than I first thought it would be at first. Yes I found it completely disorienting since all puzzles I have seen put the empty hole at the bottom right corner of board. Thats how I trained myself with my versions. I could not solve a simple 3x3 and I swear the code screwed up the order of blocks to make it impossible to solve. But it does look like the puzzle was scrambling correctly by making random legal moves the standard way to safely scramble the puzzle. Update: Oh Dah!! I got row and cols mixed up ie 2, 1 is column 2 row 1, no wonder I thought it was wrong. LOL
b = b + ...
(07-14-2023, 04:53 AM)CharlieJV Wrote: The program is a little bit more "polished" (as in behaviour, still simplistic otherwise) , and allows setting the puzzle to various sizes: 3 means 3X3, 4 means 4X4 ... you can choose any size between (inclusively) 2 and 8, although 2 is really just for quickly testing the behaviour of the program.
Oh - NOW I get it! The screen at the beginning made me understand. Still a challenge though. Nice work - I'll test it out more later today.
Edit: At least I could solve a 2x2 grid, lol. - Dav
07-15-2023, 06:29 PM
(07-15-2023, 06:10 PM)Dav Wrote: Oh - NOW I get it! The screen at the beginning made me understand. Still a challenge though. Nice work - I'll test it out more later today. The beauty of this simple program: it helped me catch a strange little bug with my implementation of SLEEP (and SLEEP 0) to pause the program until user interaction (keyboard press or mouse-click/screen-touch.) |
« Next Oldest | Next Newest »
|
Users browsing this thread: 4 Guest(s)