Skip to content

dansyw91/15puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฉ 15 Puzzle โ€” Classic Sliding Puzzle Game (C++)

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.


๐ŸŽฏ Objective

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!


๐Ÿง  Features

  • ๐Ÿงฎ 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

๐Ÿงฐ Tech Stack

  • Language: C++17
  • Paradigm: Object-Oriented Programming (OOP)
  • Key Concepts: Operator Overloading, Encapsulation, Randomization
  • Compiler: Any modern C++ compiler (e.g., g++, clang++, MSVC)

๐Ÿš€ How to Run

  1. Clone the repository
git clone git@github.com:dansyw91/15puzzle.git  
cd 15puzzle
  1. 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
  1. Run the game
./15puzzle

Have fun and good luck!๐Ÿคช


๐Ÿ“š Learning Focus

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

๐ŸŒŸ Future Improvements

๐Ÿ–ฅ๏ธ 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


๐Ÿ‘จโ€๐Ÿ’ป Author

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

About

My C++ learning project. A 15 puzzle board game with pure C++ code. Playable in terminal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published