Skip to content

claytn/Game_Of_Life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game_Of_Life

Rust implementation of John Conway's "Game of Life"

Rules

For a cell that is 'populated':

  1. Each cell with one or no neighbors dies
  2. Each cell with four or more neighbors dies
  3. Each cell with two or three neighbors survives

For a space that is 'unpopulated':

  1. Each cell with three neighbors becomes populated.

Usage

  • A GUI version should be released soon, but until then we shall use files!

Step 1: Install cargo and the nightly rust compiler

Step 2: Make a file (inside project root) that contains an 8x8 grid using the characters '-' and '*'

'*' represents a populated cell and '-' is an unpopulated cell.

Step 3: Inside the project directory run cargo run <file name> <# of iterations>

Example:

Inside of example_grid.txt

--------
--------
---*----
--***---
--*-*---
---*----
--------
--------

cargo run example_grid.txt 4

Output:

--------
--***---
-*---*--
*-----*-
-*---*--
--***---
--------
--------

About

Rust implementation of John Conway's "Game of Life"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages