Toby Smith's Portfolio

8 Puzzle

This is one of the simple 8 puzzle games most people have come across where the objective of the game is to move the 8 puzzle pieces around in a 3 by 3 grid in order to make a specific picture or pattern.

Game features:

  • Use either your arrow keys or type in the number you wish to move
  • A new puzzle can be generated at any time
  • The game can also auto-solve itself if you give up

Development skills:

In this project, being able to make the game playable was easy, it was the auto-solving algorithm which was more difficult. While I could have researched online and discovered how to move the first tile to its correct position from anywhere and then the second etc. I chose to make an algorithm which looks at the previously made moves and works out the shortest route back through them. Overall, this makes a significantly more efficient program.

This slideshow requires JavaScript.

© 2018 Toby Smith

Contact Me