R.I.P. John Conway

50 views
Skip to first unread message

Eli the Bearded

unread,
Apr 14, 2020, 9:28:06 PM4/14/20
to vim...@googlegroups.com
Many years ago I wrote Conway's Game of Life in vi macros.
Not vimscript, macros. I posted them, uuencoded, to comp.editors
where you might still find them with Google Groups searches.

But Bram Moolenaar liked the effort, so you can still find those
macros easily. On my Ubuntu system, they are installed at:

$VIM/vim80/macros/life/life.vim

(Where $VIM is set by vim itself, so ":e $VIM/..." to edit and
":so $VIM/..." to source, but don't use that on the command line.)

After sourcing it, you can hit "I" to initialize the board, edit
the text in the box that says "VIM LIVES":

top---------------------------------------------------------------
- --....................--....................-
- --....................--....................-
- --....................--....................-
- VIM --....................--....................-
- --....................--....................-
- --....................--....................-
- LIVES --....................--....................-
- --....................--....................-
- --....................--....................-
- --....................--....................-
------------------------------------------------------------------

(which will probably be below your cursor point) then "R"un the game.
<control-C> to interrupt it.

The game plays only in that left hand box, everything else before
and after it is there to make the game run faster by storing state
and tables in the edit buffer. Bram tweaked the game somewhat, such
as have the letter of the alphabet indicate age, with old letters
just dying.

The macros are well documented, and were originally written for the vi
on my Solaris box at the time. That program was buggy and would forget
marks after a while, which would exit the game with an error. vim
never had that problem.

It's a rather CPU intensive way to play the Game of Life, whether
you use vi, vim, nvi, or elvis.

Elijah

Tony Mechelynck

unread,
Apr 15, 2020, 12:32:42 AM4/15/20
to vim_use
Yes, I hadn't noticed it, but John Horton Conway died a few days ago.

To load the "game of life" mappings once Vim is up,
:runtime macros/life/life.vim

then (in Normal mode) either g (go); or I (uppercase i for initialize)
followed by either C (compute one step) or R (run). After I you can
edit the left field to change the seed.

Note: AFAICT, once you have started computing all successive
generations recursively by g or R, there's no way to stop the
automaton short of killing Vim.

Best regards,
Tony.
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/4924VK1FyMzfYt%40panix5.panix.com.
Reply all
Reply to author
Forward
0 new messages