Slices a provided image into tiles and then shuffles them. You need to restore initial image.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
NaiJi 9c9fd95ea9 Add multifolder support 1 month ago
.gitignore Change qmake to cmake and build sfml statically 6 months ago
CMakeLists.txt Add multifolder support 1 month ago
README.md Fix README 5 months ago
application.cpp Clean code 2 months ago
application.h Optimize winning condition 5 months ago
argsprocessor.cpp Add multifolder support 1 month ago
argsprocessor.h Add multifolder support 1 month ago
board.cpp Add multifolder support 1 month ago
board.h Clean code 2 months ago
filepath_util.h Add multifolder support 1 month ago
main.cpp Add multifolder support 1 month ago
output_util.h Update --help and add README 5 months ago

README.md

sliding-puzzle

A simple game which takes an image, then slices it into tiles and shuffles. You need to restore the initial image by swapping neighbor tiles! It's a command line application and does support --help.

How to build

You only need a compiler supporting c++17 and sfml 2.5.1 (or latter versions).

First of all, clone the project and go to the project folder

git clone https://dev.udongein.xyz/NaiJi/sliding-puzzle
cd sliding-puzzle/

Then simply build it with CMake

cmake CMakeLists.txt -B ../sliding-puzzle-build
cd ../sliding-puzzle-build
make

Usage

Run it from terminal, providing optional flags and filepath. Move cursor by either WASD or arrows. Press Z to select a tile and then select a direction to swap the tile with a neighbor from that direction. Repeat until the inital image gets completely assembled!

usage: sliding-puzzle [-OPTIONS...] FILE-OR-DIRECTORY

    Provide FILE-OR-DIRECTORY variable as a path to either a directory
    which contains images (one will be picked randomly) or a specific
    image file of .bmp, .jpg, of .png format.

    If no path was provided, it will be assumed as '.'!

    Options:
      [-r NUMxNUM] Provide it if you want to explicitly define
                   window resolution.
      [-s NUM]     Provide it if you want to explicitly define
                   qualifier for image slicing, it's counted
                   by the smallest side of given source texture.
                   Hence, if your image is square, the amount of tiles
                   will be num * num.