Conway's Game of Life: Difference between revisions
Content added Content deleted
imported>Arakov |
imported>Acediast m (→{{header|COBOL}}: Syntax highlighting.) |
||
Line 4,494: | Line 4,494: | ||
=={{header|COBOL}}== |
=={{header|COBOL}}== |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="cobolfree">identification division. |
||
program-id. game-of-life-program. |
program-id. game-of-life-program. |
||
data division. |
data division. |
||
working-storage section. |
working-storage section. |
||
Line 4,514: | Line 4,515: | ||
05 check-row pic s9. |
05 check-row pic s9. |
||
05 check-cell pic s9. |
05 check-cell pic s9. |
||
procedure division. |
procedure division. |
||
control-paragraph. |
control-paragraph. |
||
Line 4,562: | Line 4,564: | ||
if cell(neighbour-row,neighbour-cell) is equal to '#', |
if cell(neighbour-row,neighbour-cell) is equal to '#', |
||
and check-cell is not equal to zero or check-row is not equal to zero, |
and check-cell is not equal to zero or check-row is not equal to zero, |
||
then add 1 to living-neighbours. |
then add 1 to living-neighbours. |
||
end program game-of-life-program.</syntaxhighlight> |
|||
{{out}} |
{{out}} |
||
<pre>GENERATION 0: |
<pre>GENERATION 0: |