diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-06-13 20:20:40 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-06-13 20:20:40 +0000 |
commit | 071d4279d6ab81b7187b48f3a0fc61e587b6db6c (patch) | |
tree | 221cbe3c40e043163c06f61c52a7ba2eb41e12ce /runtime/macros/hanoi | |
parent | b4210b3bc14e2918f153a7307530fbe6eba659e1 (diff) | |
download | vim-git-071d4279d6ab81b7187b48f3a0fc61e587b6db6c.tar.gz |
updated for version 7.0001v7.0001
Diffstat (limited to 'runtime/macros/hanoi')
-rw-r--r-- | runtime/macros/hanoi/click.me | 14 | ||||
-rw-r--r-- | runtime/macros/hanoi/click.me.info | bin | 0 -> 973 bytes | |||
-rw-r--r-- | runtime/macros/hanoi/hanoi.vim | 64 | ||||
-rw-r--r-- | runtime/macros/hanoi/poster | 36 | ||||
-rw-r--r-- | runtime/macros/hanoi/poster.info | bin | 0 -> 735 bytes |
5 files changed, 114 insertions, 0 deletions
diff --git a/runtime/macros/hanoi/click.me b/runtime/macros/hanoi/click.me new file mode 100644 index 000000000..24f178bfe --- /dev/null +++ b/runtime/macros/hanoi/click.me @@ -0,0 +1,14 @@ + + +See Vim solve the towers of Hanoi! + +Instructions: + type ":so hanoi.vim<RETURN>" to load the macros + type "g" to start it + +and watch it go. + + to quit type ":q!<RETURN>" +to interrupt type CTRL-C + +(This text will disappear as soon as you type "g") diff --git a/runtime/macros/hanoi/click.me.info b/runtime/macros/hanoi/click.me.info Binary files differnew file mode 100644 index 000000000..f38cb5a0a --- /dev/null +++ b/runtime/macros/hanoi/click.me.info diff --git a/runtime/macros/hanoi/hanoi.vim b/runtime/macros/hanoi/hanoi.vim new file mode 100644 index 000000000..834d6f2c4 --- /dev/null +++ b/runtime/macros/hanoi/hanoi.vim @@ -0,0 +1,64 @@ +set remap +set noterse +set wrapscan +" to set the height of the tower, change the digit in the following +" two lines to the height you want (select from 1 to 9) +map t 7 +map! t 7 +map L 1G/t
X/^0
$P1GJ$An$BGC0e$X0E0F$X/T
@f
@h
$A1GJ@f0l$Xn$PU +map g IL + +map J /^0[^t]*$
+map X x +map P p +map U L +map A "fyl +map B "hyl +map C "fp +map e "fy2l +map E "hp +map F "hy2l + +" initialisations: +" KM cleanup buffer +" Y create tower of desired height +" NOQ copy it and inster a T +" NO copy this one +" S change last char into a $ +" R change last char in previous line into a n +" T insert two lines containing a zero +" V add a last line containing a backslash +map I KMYNOQNOSkRTV + +"create empty line +map K 1Go + +"delete to end of file +map M dG + +"yank one line +map N yy + +"put +map O p + +"delete more than height-of-tower characters +map q tllD + +"create a tower of desired height +map Y o0123456789Z0q + +"insert a T in column 1 +map Q 0iT + +"substitute last character with a n +map R $rn + +"substitute last character with a $ +map S $r$ + +"insert two lines containing a zero +map T ko0
0
+ +"add a backslash at the end +map V Go/ diff --git a/runtime/macros/hanoi/poster b/runtime/macros/hanoi/poster new file mode 100644 index 000000000..dd03b2613 --- /dev/null +++ b/runtime/macros/hanoi/poster @@ -0,0 +1,36 @@ +Article 2913 of alt.sources: +Path: oce-rd1!hp4nl!mcsun!uunet!munnari.oz.au!metro!cluster!swift!softway!otc!gregm +From: gregm@otc.otca.oz.au (Greg McFarlane) +Newsgroups: comp.sources.d,alt.sources,comp.editors +Subject: VI SOLVES HANOI +Message-ID: <2323@otc.otca.oz> +Date: 19 Feb 91 01:32:14 GMT +Sender: news@otc.otca.oz +Reply-To: gregm@otc.otca.oz.au (Greg McFarlane) +Organization: OTC Development Unit, Australia +Lines: 80 +Xref: oce-rd1 comp.sources.d:5702 alt.sources:2913 comp.editors:2313 + +Submitted-by: gregm@otc.otca.oz.au +Archive-name: hanoi.vi.macros/part01 + +Everyone seems to be writing stupid Tower of Hanoi programs. +Well, here is the stupidest of them all: the hanoi solving vi macros. + +Save this article, unshar it, and run uudecode on hanoi.vi.macros.uu. +This will give you the macro file hanoi.vi.macros. +Then run vi (with no file: just type "vi") and type: + :so hanoi.vi.macros + g +and watch it go. + +The default height of the tower is 7 but can be easily changed by editing +the macro file. + +The disks aren't actually shown in this version, only numbers representing +each disk, but I believe it is possible to write some macros to show the +disks moving about as well. Any takers? + +(For maze solving macros, see alt.sources or comp.editors) + +Greg diff --git a/runtime/macros/hanoi/poster.info b/runtime/macros/hanoi/poster.info Binary files differnew file mode 100644 index 000000000..780fa35ed --- /dev/null +++ b/runtime/macros/hanoi/poster.info |