Skip to content

OlegDokuka/15puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

15puzzle

How To Build

This Project is based on Gradle Wrapper Build tool.

Open your terminal in the project folder and run following command:

./gradlew clean jar

How To Run

To Run compiled game execute the following command:

java -jar ./build/libs/15puzzle*

How To Play

After the game has been run, you will see similar to the following output

---------------------------------
|       |       |       |       |
|   6   |  10   |   9   |   7   |
|       |       |       |       |
---------------------------------
|       |       |       |       |
|   2   |  12   |  15   |   8   |
|       |       |       |       |
---------------------------------
|       |       |       |       |
|  14   |  11   |   4   |   5   |
|       |       |       |       |
---------------------------------
|       |       |       |       |
|   1   |   3   |  13   |       |
|       |       |       |       |
---------------------------------
Please, use following game-play commands :
  * Use 1 to move element from left to right empty space
  * Use 2 to move element from right to left empty space
  * Use 3 to move element from top to bottom empty space
  * Use 4 to move element from bottom to top empty space
  * Use r to restart the game
  * Use q to quit the game
  * Use h to show help menu

The first part of the content is GameBoard. The second part of the output is helping window with available terminal commands.

Note: All commands will be executed only after you have pressed enter on the keyboard

Important: All movement (from left to right, etc) is relative to the puzzle without number, so it means that by entering 1 you will swap 13 with empty puzzle.

---------------------------------    ---------------------------------
|       |       |       |       |    |       |       |       |       |
|   6   |  10   |   9   |   7   |    |   6   |  10   |   9   |   7   |
|       |       |       |       |    |       |       |       |       |
---------------------------------    ---------------------------------
|       |       |       |       |    |       |       |       |       |
|   2   |  12   |  15   |   8   |    |   2   |  12   |  15   |   8   |
|       |       |       |       |    |       |       |       |       |
---------------------------------    ---------------------------------
|       |       |       |       |    |       |       |       |       |
|  14   |  11   |   4   |   5   |    |  14   |  11   |   4   |   5   |
|       |       |       |       |    |       |       |       |       |
---------------------------------    ---------------------------------
|       |       |       |       |    |       |       |       |       |
|   1   |   3   |  13   |       |    |   1   |   3   |       |  13   |
|       |       |       |       |    |       |       |       |       |
---------------------------------    ---------------------------------
                   ↑                                            ↑ 

About

No description, website, or topics provided.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages