and optionally randomise worm lengths. Just exit instead of
continuing with a nonsense display if the window shrinks (and
for consistency if it grows).
Most of the ideas and code from RVP. Bugs and man page mangling
from me.
(Very long worms in a smallish window could result in the max number of
worms being 0...)
While here (also suggested by RVP) seed the random number generator,
also add a -S option to set the seed (note: while this is documented
in the updated man page, it does not appear in the usage message in
case of an error ... not likely to be used often enough to include there).
Also some minor improvements suggested by RVP:
delete the prototype for main()
exit curses mode before abort() (which should not happen, but...)
no need to return (->exit) after abort() as modern abort() can
never return.
In addition, check for extraneous (ignored) (non-option) args.
Check for absurdly small or big screens (the worm placement algorithm
doesn't work well for lines of columns < 3, and the abort() mentioned
above actually happens if one of those is == 1).
More flavours of worms added.
Some minor man page wording improvements.
simplifying the code and improving its portability. It also adds a
delay option from OpenBSD, to allow reasonable speed display on fast
terminals, adds use of const, and fixes signal handling and use of
errx() where appropriate.
Patch supplied in PR 6661 by Joseph Myers <jsm28@cam.ac.uk>.