Update --help and add README

This commit is contained in:
NaiJi ✨ 2021-01-09 00:27:07 +03:00
parent 37485820a4
commit 90ed819f17
2 changed files with 34 additions and 8 deletions

23
README.md Normal file
View File

@ -0,0 +1,23 @@
# 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).
### Usage
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.

View File

@ -8,15 +8,18 @@ namespace output
const char* NO_ARG_MSG = "Please at least provide a path to a target image. --help for more information.\n"; const char* NO_ARG_MSG = "Please at least provide a path to a target image. --help for more information.\n";
const char* HELP_MSG = "usage: sliding-puzzle [-OPTIONS...] FILE-OR-DIRECTORY\n\n" const char* HELP_MSG = "usage: sliding-puzzle [-OPTIONS...] FILE-OR-DIRECTORY\n\n"
" Necessarily provide the latter variable as path to either a directory\n" " Provide FILE-OR-DIRECTORY variable as a path to either a directory\n"
" which contains arts (one will be picked randomly) or a specific\n" " which contains images (one will be picked randomly) or a specific\n"
" image file of .bmp, .dds, .jpg, .png, .tga, or .psd format.\n\n" " image file of .bmp, .jpg, of .png format.\n\n"
" If no path was provided, it will be assumed as \'.\'!\n\n"
" Options:\n" " Options:\n"
" [-s num] Provide it if you want to explicitly define\n" " [-r NUMxNUM] Provide it if you want to explicitly define\n"
" qualifier for image slicing, it's counted\n" " window resolution.\n"
" by the smallest side of given source texture.\n" " [-s NUM] Provide it if you want to explicitly define\n"
" Hence, if your image is square, the amount of tiles\n" " qualifier for image slicing, it's counted\n"
" will be num * num.\n"; " by the smallest side of given source texture.\n"
" Hence, if your image is square, the amount of tiles\n"
" will be num * num.\n";
const char* SPLITTING_MSG = "-s should be given with a positive num >= 2 as in [-s num].\n"; const char* SPLITTING_MSG = "-s should be given with a positive num >= 2 as in [-s num].\n";
const char* IMG_FAIL_MSG = "Couldn't load image from given path.\n"; const char* IMG_FAIL_MSG = "Couldn't load image from given path.\n";
const char* RESOLUTION_MSG = "Couldn't recognize given screen resolution.\n" const char* RESOLUTION_MSG = "Couldn't recognize given screen resolution.\n"