sponsor Vim development Vim logo Vim Book Ad

Tower of Hanoi : Tower of Hanoi game for Vim

 script karma  Rating 24/8, Downloaded by 2741    Comments, bugs, improvements  Vim wiki

created by
Hari Krishna Dara
 
script type
game
 
description
Continuing the tradition of creating games for Vim, here is a Tower of Hanoi implementation. Best played in GUI version of Vim.

- 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 vim window.
- 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 move.
- Keys h and k select the current pole, and thus the top most disk on the pole.
- 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>

Good exerciese to practice hjkl key movements, if you are new to Vi realm :)



Search_key_words: tower hanoi game games hari krishna dara
 
install details
- Requires Vim 7 GUI version.
- Extract the zip file into your runtime directory.
- The plugin is loaded only on demand.
- Requires genutils.vim (vimscript #197)
 

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
hanoi-2.0.zip 2.0 2007-02-07 7.0 Hari Krishna Dara Just made compatible with Vim7. Also removed dependency on multvals, as it now uses Vim7 Lists and Dictionaries.
hanoi-1.3.zip 1.3 2004-02-20 6.0 Hari Krishna Dara Updated with more feedback.
- Space should resume paused game.
- When paused, should be able to close the game window and still be able to resume it.
- Highlighting definition may not work on all the color schemes.
hanoi-1.2.zip 1.2 2004-02-19 6.0 Hari Krishna Dara Just minor improvements, mostly scripting related for my satisfaction (and for the ease of adding any new features in the future). It now shows the number of moves and a message when the game is paused.
hanoi-1.1.zip 1.1 2004-02-09 6.0 Hari Krishna Dara Fixed some incompatibilities/problems reported by Anoine J. Mechelynck. If you are facing other problems please report them to me.
hanoi-1.0.zip 1.0 2004-02-05 6.0 Hari Krishna Dara Initial upload
ip used for rating: 54.205.241.107

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.
   
SourceForge.net Logo