Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jurmc/wx_game_of_life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

In Powershell: cd C:\Users\amj018\Documents\isi\wx_game_of_life\src werl -name [email protected] -setcookie In Arch: erl -name [email protected] -setcookie abc -remsh '[email protected]' wx_gof:start_link(5).

Game of Life

Your task is to write a program to calculate the next generation of Conway's game of life, given any starting position. You start with a two dimensional grid of cells, where each cell is either alive or dead. The grid is finite, and no life can exist off the edges. When calculating the next generation of the grid, follow these four rules:

  1. Any live cell with fewer than two live neighbors dies, as if caused by underpopulation.

  2. Any live cell with more than three live neighbors dies, as if by overcrowding.

  3. Any live cell with two or three live neighbors lives on to the next generation.

  4. Any dead cell with exactly three live neighbors becomes a live cell.

Examples: * indicates live cell, . indicates dead cell

Example input: (4 x 8 grid)

4 8

........ ....*... ...**... ........

Example output:

4 8

........ ...... ...... ........

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages