3,4c3,6
< # Version 2: Patched by Daniel Albers
< #+           to allow non-square grids as input.
---
> 
> # Version 0.2:   Patched by Daniel Albers
> #+               to allow non-square grids as input.
> # Version 0.2.1: Added 2-second delay between generations.
10c12
< # On a rectangular grid, let each "cell" be either "living" or "dead".  #
---
> # On a rectangular grid, let each "cell" be either "living" or "dead."  #
15,16c17,18
< # 1) Each cell has 8 neighbors, the adjoining cells                     #
< #+   left, right, top, bottom, and the 4 diagonals.                     #
---
> #   1) Each cell has 8 neighbors, the adjoining cells                   #
> #+     left, right, top, bottom, and the 4 diagonals.                   #
19c21
< #                       4*5        The * is the cell in question.       #
---
> #                       4*5     The * is the cell under consideration.  #
24c26
< # 3) A dead cell with 3 living neighbors becomes alive (a "birth").     #
---
> # 3) A dead cell with 3 living neighbors comes alive (a "birth").       #
41c43
< #+ "gen0" not present.
---
> #+ default file "gen0" not present.
43c45
< E_NOSTARTFILE=68
---
> E_NOSTARTFILE=86
55c57
<                  # Represent living and "dead" cells in the start-up file.
---
>                  # Represent living and dead cells in the start-up file.
59c61
< #+ but a large grid will will cause very slow execution).
---
> #+ but a large grid will slow execution).
66c68
<                         #  Adjust this upwards,
---
>                         #  Adjust this upwards
69c71
< NONE_ALIVE=80           #  Exit status on premature bailout,
---
> NONE_ALIVE=85           #  Exit status on premature bailout,
70a73
> DELAY=2                 #  Pause between generations, etc.
80a84
> let "cells = $ROWS * $COLS"   # How many cells.
82,85c86,87
< let "cells = $ROWS * $COLS"
<                         # How many cells.
< 
< declare -a initial      # Arrays containing "cells."
---
> # Arrays containing "cells."
> declare -a initial
91c93
< alive=0                 # How many cells "alive" at any given time.
---
> alive=0                 # How many cells alive at any given time.
121c123
<   # Print out array and change underscores to spaces.
---
>   # Print out array, changing underscores to spaces.
164,167c166,169
< IsAlive ()              # Test whether cell is alive.
<                         # Takes array, cell number, state of cell as arguments.
< {
<   GetCount "$1" $2      # Get alive cell count in neighborhood.
---
> IsAlive ()              #  Test whether cell is alive.
>                         #  Takes array, cell number, and
> {                       #+ state of cell as arguments.
>   GetCount "$1" $2      #  Get alive cell count in neighborhood.
170d171
< 
181c182
<   return $DEAD          # Default.
---
>   return $DEAD          # Dead, by default.
219c220
<     let "row = $r"                        # Count center row of neighborhood.
---
>     let "row = $r"                        # Count center row.
224c225
<       then                                # Yes?
---
>       then                                # If yes, then ...
283c284
< # let "generation += 1"   # Increment generation count.
---
> # let "generation += 1"          # Increment generation count.
309d309
< sed -e 's/\./\. /g' -e 's/_/_ /g'` )
310a311
>            sed -e 's/\./\. /g' -e 's/_/_ /g'` )
315a317
> setterm -reverse on
316a319
> setterm -reverse off
319a323
> setterm -reverse on
320a325,327
> setterm -reverse off
> 
> sleep $DELAY   # Display "splash screen" for 2 seconds.
327a335
> sleep $DELAY
331c339
< let "generation += 1"     # Increment generation count.
---
> let "generation += 1"     # Bump generation count.
336a345
> sleep $DELAY
346a356
>   sleep $DELAY
352c362
< exit 0   # END
---
> exit 0   # CEOF:EOF
374,375c384
< #           It has some repetitive and redundant code,
< #+          for example, lines 335-336.
---
> #           It has some redundant code.
