Primer for the “Fifteenth Puzzle” Series

  • Part 1 – core with F#

  • Part 2 – is it solvable?

  • Part 3 – wraping it up – the silverlight application

Do you know the “Fifteenth Puzzle”?

Well I do. Indeed there was a time in my early youth when this was so popular that you got cheap plastic ones for advertisement from time to time.
It was not really difficult and I soon could solve the classic one in no time.
But those cheap toys sometimes broke so the tiles dropped from the frame and you hat to reset them. And sometimes you made a mistake and you just could not solve the damn think.
Here is a sample you can try to solve (hint: it’s one of those devils you will not solve no matter what):

Try it!

To have some success try the following random version that is generated in a way so that you can always solve it:

In this series of post I’m going to build up the little Silverlight-plugin you are seeing here (and I hope your are playing with). There is a easy way to see almost at one glace when you can solve a given configuration and I will try to explain the interesting math behind this. Indeed the Silverlight-application is using this simple algorithm to generate solvable configs in the second example above.

The core of the game will be build using F# for Silverlight and the Silverlight-application itself will be written in C# so I can talk a bit about this constellation too – cool isn’t it?

So prepare for some fun-facts and useless knowledge to come 🙂