A Rust-based version of Conway's Game of Life run from the command-line.
- Rust 1.40.0 installed.
- Bash shell environment.
The program currently has no dependencies outside of the Rust standard library.
The program can be compiled using the cargo
utility using:
cargo build --release
The program takes command-line input in the following form:
./game_of_life <input_file> <time per step (ms)>
The input files for the program take the following form.
- Line 1 consists of dimensions of the field, in form
<width>,<height>
- Subsequent number of lines of expected length and quantity consist of comma-separated values representing the initial state of the square. 0 represents a dead square and 1 represents an alive square.
An example input file for a "blinker" is as follows:
5,5
0,0,0,0,0
0,0,0,0,0
0,1,1,1,0
0,0,0,0,0
0,0,0,0,0
Some example input files are included in the ./inputs/
folder.