Vim Tips Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
FANDOM
Explore
Current Wiki
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Vim Tips Wiki
1,649
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
Editing
Script:900
Back to page
Edit source
View history
Talk (0)
Edit Page
Script:900
We recommend that you
log in
before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your
Watchlist
.
Creating an account
is quick and free.
The edit appears to have already been undone.
Anti-spam check. Do
not
fill this in!
{{ScriptComments|hanoi: Tower of Hanoi game for Vim}} ==Bug: Out of range errors== Hanoi gives out of range errors (list element -1) after moving the cursor to an empty pole, and stops. --June 20, 2011 ===Fix=== I've also found the bug "Out of range errors" just like what's described in that bug report, read as "Hanoi gives out of range errors (list element -1) after moving the cursor to an empty pole, and stops." To fix this bug, I've read the script and found a leak when process <code>PoleMoveDisk</code>. It forgot to determine the condition that the target pole to select (i.e. to move to) should have disks when selecting a pole! So to fix it, I make up the condition determination in <code>function! s:play()</code> at row 266/271 in script file <code>autoload/hanoi.vim</code> by adding statement: <code>if s:curpole.next.NOD() > 0</code> and adding <code>endif</code> after statement <code>call s:PoleSelectPole(s:curpole.next/prev)</code> to close <code>if</code> statement. To be more robust, I add another condition determination statement in <code>function! s:PoleSelectPole(newPole)</code> at row 508 in script file <code>autoload/hanoi.vim</code> by adding <code> && a:newPole.NOD() > 0</code> in the if statement <code>if s:curpole != a:newPole </code>. Of course, this supplement is optional if the above leak has been fixed. Hope the author fix the bug and offer the latest copy for downloading. --[[Special:Contributions/218.189.38.36|218.189.38.36]] 05:39, November 23, 2011 (UTC) ==Comments==
Summary:
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:ScriptComments
(
view source
)
Follow on IG
TikTok
Join Fan Lab