Tuesday, April 14, 2020

R.I.P. John Conway

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

--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/4924VK1FyMzfYt%40panix5.panix.com.

No comments: