https://github.com/nstefan002/15puzzle.nvim
Classic 15 puzzle for Neovim.
https://github.com/nstefan002/15puzzle.nvim
game lua neovim neovim-plugin plugin puzzle-game
Last synced: 6 months ago
JSON representation
Classic 15 puzzle for Neovim.
- Host: GitHub
- URL: https://github.com/nstefan002/15puzzle.nvim
- Owner: NStefan002
- License: mit
- Created: 2024-03-17T16:08:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-30T23:16:25.000Z (over 1 year ago)
- Last Synced: 2024-03-31T23:22:04.853Z (over 1 year ago)
- Topics: game, lua, neovim, neovim-plugin, plugin, puzzle-game
- Language: Lua
- Homepage:
- Size: 44.9 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 15 Puzzle
> Implementation of the classic `15 Puzzle` game for Neovim.
## 📺 Showcase
https://github.com/NStefan002/15puzzle.nvim/assets/100767853/d613555a-b603-490f-b24a-cb8ef89246a3
### 🖼️ Gallery
Preview themes





## 🗞️ News
* **[26/03/2024]** A puzzle solver is now available. Press `s` (or the key you mapped to `solve`) and the solver will try to find
the **best** possible solution to the current puzzle state. If the solver does not find the solution in the
given time (see `solver_time_limit` option) it will exit and let you continue the game. However, if it finds
the solution quickly enough, it will start the animation that shows you the best moves to the solution.## 📋 Installation
[lazy](https://github.com/folke/lazy.nvim):
```lua
{
"NStefan002/15puzzle.nvim",
cmd = "Play15puzzle",
config = true,
}
```[packer](https://github.com/wbthomason/packer.nvim):
```lua
use({
"NStefan002/15puzzle.nvim",
config = function()
require("15puzzle").setup()
end,
})
```[rocks.nvim](https://github.com/nvim-neorocks/rocks.nvim)
`:Rocks install 15puzzle.nvim`
## ❓ How to Play
1. `:Play15puzzle`
2. Use the `h`, `j`, `k`, `l` to slide the squares in the desired direction.
3. Place each square in its correct place.
4. Try to solve the puzzle in the fewest moves and as fast as possible.## 🎮 Controls
- `h` - move the squares to the left
- `j` - move the squares down
- `k` - move the squares up
- `l` - move the squares to the right
- `n` - new game
- `s` - activate the puzzle solver
- `` - next theme
- `` - previous theme
- `` - confirm in menus
- `` - cancel in menus**NOTE:**
You can change the default mappings and some additional settings.
```lua
require("15puzzle").setup({
keys = {
up = "k",
down = "j",
left = "h",
right = "l",
new_game = "n",
confirm = "",
cancel = "",
next_theme = "",
prev_theme = "",
solve = "s",
},
-- additional settingssolver_time_limit = 7000,
})
```