Course:CPSC312-2017-Conways-Game-of-life

From UBC Wiki

Title

Authors: Ethan Wilberforce, Jillian Kong, Jack Still

Code: https://github.com/jskong/game-of-life

What is the problem?

We will be providing a solver for Conways Game of Life (https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life). Conway's Game of Life is a zero player game that takes in a board, and creates the next generation of the board based on four rules:

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

2) Any live cell with two or three live neighbours lives on to the next generation.

3) Any live cell with more than three live neighbours dies, as if by overpopulation.

4) Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

What is the something extra?

We will provide an ASCII visualization of each generation for the inputed game. We made a random board generator to go with our game. The game also stops if there are no more cells alive on the board, as well as outputs the generation which all the cells died on out of generations requested.

What did we learn from doing this?

Initially we had trouble getting IO to work. After a bit of research and crunching, we realized this kind of project shines when written in Haskell. IO was incredibly useful in our implementation of Conway's Game of Life. Originally we had a play function that we would pass through a board to play and the number of generations desired from the user, only to upgrade later using IO through a main function which prompts the user for a board and the number of generation desired. Additionally, IO made printing the state of the board at the current generation simple, as well as having the capability of stopping the game if there are no more cells alive on the board. We also made a typescript program to generate a random board for our game.