sponsor Vim development Vim logo Vim Book Ad

HJKL : Use H,J,K,L to explore maze

 script karma  Rating 283/132, Downloaded by 8535  Comments, bugs, improvements  Vim wiki

created by
Ran Bi
script type
Lots of beginners do not like to use vim's h,j,k,l key to move concur, so I made this game, hopefully can help beginners get used to h,j,k and l.

This is a maze exploring game.
A 15*15 maze is randomly generated, and user('@') need to go to target position('X').
Only h,j,k,l are allowed for controlling.
Type 'q' twice to quit the game.

Maximize the window before starting the game to get better view.

Type :HJKL to start a new game.

Want more challenge, try konami code(kkjjhlhlba)

Future plan:
1. Better random number generator is needed. Current version sometimes leads to infinite loop when generating random maze.
2. Need more challenging maze. Better maze construction algorithm is needed.
3. More fancy features...
install details
Copy hjkl.vim into ~/.vim/plugin/


rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
hjkl.vim 1.08 2012-12-27 7.0 Ran Bi How need type q twice to quit.
When no argument is passed, the game starts with 5*5 sized maze.
Then you reach the target, a bigger sized maze will be generated and a new game will be started.
hjkl.vim 1.07 2011-02-06 7.0 Ran Bi Now does not create new window when current buffer is empty
hjkl.vim 1.06 2011-01-28 7.0 Ran Bi Thanks to Xavier Wang's patch! the maze looks better now
hjkl.vim 1.04 2011-01-26 7.0 Ran Bi show progress bar when constructing maze
quite game automatically after winning(and press any key)
hjkl.vim 1.02 2011-01-21 7.0 Ran Bi Make '@' and 'X' bold to make them easy to find.
Change size constrain on maze: depends on the size of vim window now.
hjkl.vim 1.01 2011-01-21 7.0 Ran Bi Fix a bug in "konami mode".
Want Faster? type konami code multiple times !
It becomes much more tricky when your target gets faster
hjkl.vim 1.0 2011-01-21 7.0 Ran Bi Tired of static target?
Try to type vim's konami code(kkjjhlhlba), see what would happen !
hjkl.vim 0.99 2011-01-21 7.0 Ran Bi Improved the maze generating algorithm, and now it runs faster(hopefully).
hjkl.vim 0.98 2011-01-20 7.0 Ran Bi Simple modification on algorithm, hopefully make the game more challenging
hjkl.vim 0.97 2011-01-20 7.0 Ran Bi In order to make the game more challenging, more complicated algorithm is used to generate maze, and determine target. However, this slow the script down drastically, especially when generating large maze. If you find it too slow, you may want to use older version(0.96) of the script.
Now the constrain of row is [5,30] and column is [5,40]. Please choose appropriate size according to the size of your vim window and the code's running time you can tolerate.
hjkl.vim 0.96 2011-01-20 7.0 Ran Bi Use syntax highlight to make the maze looks better
hjkl.vim 0.95 2011-01-20 7.0 Ran Bi HJKL command can have 2 arguments: Row and Column, which specify size of maze. Both number should in [5,20]
hjkl.vim 0.93 2011-01-20 7.0 Ran Bi Fix a bug: when row number and column number are different, it fails to generate random maze
hjkl.vim 0.92 2011-01-20 7.0 Ran Bi Remove duplicated "press any key to continue"
hjkl.vim 0.91 2011-01-20 7.0 Ran Bi change file format to unix
hjkl.vim 0.9 2011-01-19 7.0 Ran Bi Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.