add comments + errpoitner
This commit is contained in:
1 parent
bd2ce3c07b
commit
fafb1550fe
2 files changed
+26
No files matched your search
@@ -1,5 +1,15 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
int max(int a, int b) {
|
int max(int a, int b) {
|
||||||
if (a > b)
|
if (a > b)
|
||||||
return a;
|
return a;
|
||||||
return b;
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
void checkPointer(void* p) {
|
||||||
|
if (!p) {
|
||||||
|
fprintf(stderr, "Error on given pointer.\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -3,13 +3,29 @@
|
|||||||
#include "history.h"
|
#include "history.h"
|
||||||
|
|
||||||
struct game_s {
|
struct game_s {
|
||||||
|
// tab of tab of square (eg: tab_cell[i][j])
|
||||||
square** tab_cell;
|
square** tab_cell;
|
||||||
bool wrapping;
|
bool wrapping;
|
||||||
uint height; // i in general
|
uint height; // i in general
|
||||||
uint width; // j in general
|
uint width; // j in general
|
||||||
|
// case of history
|
||||||
history hist;
|
history hist;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief return the max between a and b
|
||||||
|
*
|
||||||
|
* @param a int to test
|
||||||
|
* @param b int to test
|
||||||
|
* @return the max between a and b
|
||||||
|
*/
|
||||||
int max(int a, int b);
|
int max(int a, int b);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief check if the pointer is NULL fprinf and exit else nothing
|
||||||
|
*
|
||||||
|
* @param p any pointer
|
||||||
|
*/
|
||||||
|
void checkPointer(void* p);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user