/n-puzzle

N Puzzle.

Primary LanguageJavaScript

N-Puzzle

Classic 15-puzzle (or the size of your choice). The numbers initial order are shuffled. You have the possibility to move one or multiple tiles at once, only on the same column or row as the empty space. Once the tiles are sorted in an ascending order, you'll win the game.

Note: The app only handles the same amount of columns as rows, so 3x3, 4x4 etc.

Decide grid size

Start by adding an .env file in root. There is an .env.example in root to copy. Decide the grid size by adding a number to the following variable: Add the size of the board of the puzzle to the variable.

REACT_APP_BOARD_SIZE=4

In this case it's 4, meaning the grid will be 4x4 (4 rows, 4 columns) which will produce 15 tiles and 1 empty space.

styled-components

This app is using styled-components for styling.

https://styled-components.com/docs