Inspiration

I wanted to recreate one of my favorite minigames while also improving my coding skills and problem-solving.

What it does

This is a sliding tile puzzle, in which the player starts off with a 4x4 grid of tiles numbered 1-15 (and one empty space). Player uses WASD to reorder the shuffled tiles by sliding them into the empty space. Additionally, a counter below the game board keeps tally of the number of moves in the current game.

How I built it

It is based on a 2D array of numbers, with functions for moving in each direction as well as determining validity of user inputted moves.

Challenges I ran into

I ran into a few technical issues while writing this, such as hidden out-of-bounds errors, as well as logic errors such as extra blank tiles appearing out of nowhere.

Accomplishments that I'm proud of

I am proud of having written an entire game (although small) in just over a day, as well as having been able to resolve issues that arose myself. I also like the clear and visually appealing design for the grid, despite it being text-based in the console.

What I learned

I learned about various shuffling algorithms, including Fisher-Yates, as well as various smaller details about Java.

What's next for 15 Puzzle

The next thing I plan to do with this program is create a GUI for the puzzle, or somehow otherwise make it more user-friendly than the current text-based console version.

Built With

Share this project:

Updates