Implementation of the classic
15 Puzzle
game for Neovim.
15puzzle_showcase.mp4
- [26/03/2024] A puzzle solver is now available. Press
s
(or the key you mapped tosolve
) 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 (seesolver_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.
lazy:
{
"NStefan002/15puzzle.nvim",
cmd = "Play15puzzle",
config = true,
}
use({
"NStefan002/15puzzle.nvim",
config = function()
require("15puzzle").setup()
end,
})
:Rocks install 15puzzle.nvim
:Play15puzzle
- Use the
h
,j
,k
,l
to slide the squares in the desired direction. - Place each square in its correct place.
- Try to solve the puzzle in the fewest moves and as fast as possible.
h
- move the squares to the leftj
- move the squares downk
- move the squares upl
- move the squares to the rightn
- new games
- activate the puzzle solver<c-l>
- next theme<c-h>
- previous theme<CR>
- confirm in menus<Esc>
- cancel in menus
NOTE:
You can change the default mappings and some additional settings.
require("15puzzle").setup({
keys = {
up = "k",
down = "j",
left = "h",
right = "l",
new_game = "n",
confirm = "<CR>",
cancel = "<Esc>",
next_theme = "<c-l>",
prev_theme = "<c-h>",
solve = "s",
},
-- additional settings
solver_time_limit = 7000,
})