An assignment from my computer science course. Refer to http://en.wikipedia.org/wiki/Fifteen_puzzle for design goal.