QB64 Phoenix Edition
BAM: Very Simple Tile-Sliding Puzzle - Printable Version

+- QB64 Phoenix Edition (https://staging.qb64phoenix.com)
+-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1)
+--- Forum: QBJS, BAM, and Other BASICs (https://staging.qb64phoenix.com/forumdisplay.php?fid=50)
+--- Thread: BAM: Very Simple Tile-Sliding Puzzle (/showthread.php?tid=1845)



BAM: Very Simple Tile-Sliding Puzzle - CharlieJV - 07-14-2023




RE: BAM: Very Simple Tile-Sliding Puzzle - CharlieJV - 07-14-2023

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.


RE: BAM: Very Simple Tile-Sliding Puzzle - Dav - 07-15-2023

Nice one.  The animation added a lot.  Game is harder than I first thought it would be at first.

- Dav


RE: BAM: Very Simple Tile-Sliding Puzzle - bplus - 07-15-2023

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

- Dav

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


RE: BAM: Very Simple Tile-Sliding Puzzle - CharlieJV - 07-15-2023

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

   


RE: BAM: Very Simple Tile-Sliding Puzzle - Dav - 07-15-2023

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


RE: BAM: Very Simple Tile-Sliding Puzzle - CharlieJV - 07-15-2023

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

Edit: At least I could solve a 2x2 grid, lol.

- Dav

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