-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconway.h
48 lines (36 loc) · 1 KB
/
conway.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/***********************************************
* An Implementation of Conway's Game of Life. *
* ********************************************/
/*
* David Mayes
* 150012384
*
* Gavin Henderson
* 150010848
*
* AC21009
*/
#ifndef _CONWAY_
#define _CONWAY_
#include <stdio.h>
#include <stdlib.h>
#include "cell.h"
//grid of cells
typedef struct MyCellGrid{
CellGroup* head;
int width;
int height;
}CellGrid;
//creates a grid of cells, takes in parameters for width and height
CellGrid* createCellGrid(int grid_height, int grid_width, int newValues[grid_height][grid_width]);
//frees the memory used by the grid
int deleteCellGrid(CellGrid* cell_grid);
//inserts the next CellGroup
void insertCellGroup(CellGrid* cell_grid, CellGroup* cell_group);
//creates the next generation in Conway's Game of Life
CellGrid* nextConway(CellGrid* cell_grid);
//Prints the conway that is passed in
void printGrid(CellGrid* myConway);
//Gets the initial grid from the user
CellGrid* getInitialGrid();
#endif //_CONWAY_