Welcome to the 15 Puzzle โ a timeless logic game where you slide numbered tiles into the correct order!
This project is built entirely in C++, focusing on clean design, object-oriented programming, and operator overloading practice.
Arrange the tiles in order from 1 to 15, leaving the last space empty.
Sounds simple? Try it โ and see how fast your brain can shuffle and solve!
- ๐งฎ Randomized starting layout each time you play
- ๐ฎ Move tiles interactively using keyboard input
- ๐ซ Move validation (no illegal moves!)
- ๐ Operator overloading practice for modern C++ learning
- ๐ Move counter to track how efficient you are
- ๐พ Clean, modular code written with reusability in mind
- Language: C++17
- Paradigm: Object-Oriented Programming (OOP)
- Key Concepts: Operator Overloading, Encapsulation, Randomization
- Compiler: Any modern C++ compiler (e.g.,
g++
,clang++
, MSVC)
- Clone the repository
git clone git@github.com:dansyw91/15puzzle.git
cd 15puzzle
- Compile the program
g++ -std=c++17 -I include -o 15puzzle src/*.cpp
or use CMake:
mkdir build
cd build
cmake ..
cmake --build . --config Release
- Run the game
./15puzzle
Have fun and good luck!๐คช
This project was created as part of my C++ practice journey, especially focusing on:
Operator overloading
Dynamic memory and resource management
Logical thinking through algorithm design
Writing maintainable, expressive code
๐ฅ๏ธ Add a simple graphical interface (SDL / SFML)
๐งฎ Implement an AI auto-solver
โฑ๏ธ Add a timer and best score tracker
๐ฌ Add a leaderboard for local high scores
Dan S. W.
๐ผ Aspiring Robotics & C++ Developer
๐ Passionate about learning, building, and solving real-world problems with automation
I love feedback and collaboration, get in touch with me! ๐จ dansyw91@gmail.com