-
Notifications
You must be signed in to change notification settings - Fork 1
/
Game.h
68 lines (56 loc) · 1.9 KB
/
Game.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* Game.h
*
* Created on: Dec 11, 2018
* Author: eyal & nadin
*/
#ifndef GAME_H_
#define GAME_H_
/*typedef struct cell_t{
int value;
bool isFix;
} Cell;
*/
/** game_init
* Output: we have created 3 double pointers for matrixes.this function updates pointers of matrixes into NULL
*/
void game_init();
/** game_create
* Input:
* int row: size of rows in a matrix.
* int col: size of columns in a matrix.
* int fixcell: how many fixed cells we received from the user to put into out matrix.
* int seed: the seed we receive in our program.
* Output:
* checks if matrixes are already exists in the program and destroy.
* otherwise creates 3 double sized arrays(our matrixes): matrixPlay, matrixSolve, matrixFixed.
* updates matrixFixed to be a randomized legal puzzle. updates matrixPlay and matrixSolve with fixed cells.
*/
void game_create(int row, int col,int fixCell);
/** game_destroyGame
* Output: destroy all matrixes in the program and free memory.
*/
void game_destroyGame();
/** game_playTurn
* Input: Command* command : command received from the user.
* return: ADTErr. check which command entered by user : set, validate or hint and calls the suitable function.
* return the error occurred if any.
*/
ADTErr game_playTurn(Command* command);
/**game_randomlyPickFixCells
* Input: int number : how many fixed cells the user wants in the puzzle.
* Output: update the fixed matrix and the play matrix with the number of fixed cells the user entered.
*/
void game_randomlyPickFixCells(int number);
/** game_isGameFinish
* Input:
* int rows : how many rows in a matrix
* int cols : how many columns in a matrix
* return: bool true or false. if the matrix is full and all legal are valid return true otherwise false.
*/
bool game_isGameFinish(int rows, int cols);
/** game_printBoard
* Output: prints the matrix matrixPlay.
*/
void game_printBoard();
#endif