-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_utilities.h
More file actions
54 lines (48 loc) · 1.57 KB
/
file_utilities.h
File metadata and controls
54 lines (48 loc) · 1.57 KB
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
49
50
51
52
53
54
/*
*Header file for Game of Life simulator
*Created By: Andrew Overman & Tim Van Dyke
*Date: January 29, 2018
*/
/*
*Reads in the contents of a file to the program
*@Param char* filename: The name of the file bing read
*@Param char** buffer: this is the actual board
*@return int: 0 if successful
*/
int read_file( char* filename, char** buffer );
/*
*Saves the contents of the simulator to a file.
*@Param char* filename: This is the name of the file that it saves to
*@Param char* buffer: This is the actual board
*@Param int size: This is the number of elements FIXME
*@return int: 0 if successful
*/
int write_file( char* filename, char* buffer, int size);
/*
*A method to request memory for the board
*@Param int x: the height of the board
*@Param int y: the width of the board
*@return int: 0 if successful
*/
void createBoard(int x, int y, int*** buffer);
/*
*A method to check the surroundings of a cell and update that cell
*@Param int x: the x coordinate of the cell
*@Param int y: the y coordinate of the cell
*@return int: returns what the cell should be: 0 if empty, 1 if alive, 2 if dead
*/
int checkSurround(int x, int y, int*** buffer);
/*
*A method to make a copy of the board
*@Param int** buffer: the board
*@Param int x: the width of the board
*@Param int y: the height of the board
*/
void copyBoard(int x, int y, int*** buffer, int*** copy);
/*
*A method to update the cells on the board
*@Param int** buffer: the board
*@Param int x: the width of the board
*@Param int y: the height of the board
*/
void updateBoard(int x, int y, int*** buffer);