Interesting, I'm working on a demake of a DS game and it has a sliding puzzle. I had a theory how to program it but I may as well credit you for successfully working it out and saving me a load of time and stress? This is so neatly done!
How would you like to be credited, if at all?