Puzzle o’ Tiles
Tuesday, July 19th, 2005The previous post has got me thinking about images built out of tiles, and I need some cheering up, so I made this little block sliding puzzle. Enjoy!
Feel free to copy the source to make your own version. All you need to do is replace rocket.jpg with your own 300 x 300 image.
__________
UPDATE: Note that I had originally overlooked the issue of parity when randomizing the puzzle squares— This meant a 50% chance of getting an impossible puzzle! Apologies to anyone who might have been a victim of this temporary oversight ;)
__________
UPDATE2: how to solve ( one animated solution)
July 19th, 2005 at 11:51 am
I’ve always had trouble solving these, but I think I’ve finally found an algorithm I can use. Finally.
Thanks!
July 19th, 2005 at 12:49 pm
I was wondering how you managed to slice up a single image with javascript, but I see you were much more cunning ;)
July 19th, 2005 at 3:33 pm
God, I’m so crap at solving these. My tiny monkey brain can’t think ahead more than one step at a time.
July 19th, 2005 at 4:31 pm
Uh oh, I just realized what a complete bastard I am, allowing the randomizing function to sometimes generate impossible puzzles! I will change the algorithm shortly…
BTW for more info about how this is possible, see: http://www.jimloy.com/puzz/15.htm
July 19th, 2005 at 5:07 pm
Fixed now [I added a bubble sort to determine puzzle parity, and swapped 2 pieces to correct where required]
July 19th, 2005 at 11:59 pm
Yay! Now my monkey brain can solve the puzzle!…
…in 73 moves :(
July 20th, 2005 at 9:26 am
Since it is random the hardness can vary a lot, but on average I expect to take around 40-50 moves.
Will be posted a 4×4 sometime I think :)
July 20th, 2005 at 9:30 am
Tim– Glad you appreciate the method I used… I was pretty chuffed that it worked :) Now if only I knew why it doesn’t work in Safari…
July 20th, 2005 at 11:15 am
Hmmm… next to “it does not work in Safari” you can add “doesn’t work in Opera, either”… [:-(] The puzzle displays 8 copies of the same top-left photo slice in my browser.
July 20th, 2005 at 1:48 pm
fixed in Opera, now there’s just the Safari problem [which looks like a scripting issue]