8Puzzle Code