Skip to content

eternalnoob/conway

Repository files navigation

#This is an implementation of Conway's Game of Life in C++ for linux ##By: Ethan Seither

  1. Getting Started
  2. This requires the SDL2 graphics library for the GUI to work 1. apt-get install libsdl2-dev if you have that apt magic 2. otherwise you can install it however you want 3. If you do not want these or cannot get these, you can still use the old console interface 4. To do so, run g++ driver.cpp -std=c++11
  3. Compile by running make in the cloned directory
  4. Provide a properly formatted input file 1. First line should supply the number of rows in the input file 2. Second line should supply the number of columns in the input file 3. Next line begins the pattern. Live cells are represented by 1, dead are 0
  5. A window will open, running your simulation 1. press left to slow the simulation down 2. press right to speed it up 3. press down to set the grid to toroidal off(default); 4. press up to st the grid to toroidal on 5. press space to pause 6. press left mouse button on any cell to switch it on or off
  6. Behavior
  7. This implementation uses a multidimensional array to store a grid of cells
  8. The grid can be toroidal, meaning when a shape goes off one edge, it will continue onto the other 1. Your glider guns will all die eventually, don't take it to heart.
  9. You can decide whether the array will be toroidal or not in the driver program
  10. What's Next
  11. Translate the graphics side of this into a class to avoid passing so many references
  12. Get this working on windows using equivalent of linux-exclusive functions

About

C++ implementation of Conway's game of life

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published