ANN: Tower of Hanoi game
- Continuing the tradition of writing games in Vim, I just uploaded Tower
of Hanoi for Vim:
Unlike the age old macro trick for Vi, this one is a full fledged
interactive game, so please try it out. Here is the description:
- Comes with two modes, a demo mode and a play mode.
- You can start the game by using the command :Hanoi optionally passing
the number of disks as an argument.
- If no argument is passed, you are prompted to enter a value.
- The maximum number of disks is determined based on the size of your
- You will be prompted to choose between demo or play mode.
- In demo mode, the script plays for you, just sit and relax.
- In play mode, you can use h, j, k, l keys to move the disks from pole
to pole. The disk with dashes represents the current disk that you can
- Keys h and k select the current pole, and thus the top most disk on
- Keys k and j move the disk up and down.
- In play mode, you can pause the game by pressing <Space>, and come
back by using :Hanoi command again.
- You can stop the game at any time by pressing <C-C> or <C-Break>
I wrote the game for more like the demonstration of Vim's scripting
capabilities (and for my own fun), but the game could be used to
practice the hjkl movements too.
I appreciate any feedback.
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.