Skip to content
/ Life Public

Haskell implementation of Conway's Game of Life

License

Notifications You must be signed in to change notification settings

Fylipp/Life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Life

A Haskell implementation of Conway's Game of Life in a 2D matrix with periodic boundaries.

stack build
stack exec Life <ITERATIONS> <INTIAL_STATE_FILE> <OUTPUT_FOLDER>
  • ITERATIONS: The amount of discrete iterations to perform on the initial state.
  • INITIAL_STATE_FILE: Path to a .png file containing the initial state. The image must use black (exactly #000000) pixels to represent alive cells and white (exactly #FFFFFF) to represent dead cells. The size of the initial state determines the size of the simulation.
  • OUTPUT_FOLDER: The folder where the output images (also .png) are stored. The images are named by their generation (0.png, 1.png, ...) where generation 0 is the initial state. If the directory does not exist it will be created.

There are several example states in the worlds folder.

Note: The pictures use a single pixel to represent a cell. The rendered images will appear very small in some viewers/editors.

Example

stack exec Life 30 worlds/lwss.png out

Example: Generation 0 Example: Generation 1 Example: Generation 2 Example: Generation 3 Example: Generation 4 Example: Generation 5 Example: Generation 6 Example: Generation 7 Example: Generation 8 Example: Generation 9 Example: Generation 10 Example: Generation 11 Example: Generation 12 Example: Generation 13 Example: Generation 14 Example: Generation 15 Example: Generation 16 Example: Generation 17 Example: Generation 18 Example: Generation 19 Example: Generation 20 Example: Generation 21 Example: Generation 22 Example: Generation 23 Example: Generation 24 Example: Generation 25 Example: Generation 26 Example: Generation 27 Example: Generation 28 Example: Generation 29 Example: Generation 30

License

MIT.

About

Haskell implementation of Conway's Game of Life

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published