These functions may call malloc, calloc, or realloc
| #define THROW_ERROR |
( |
|
code, |
|
|
|
msg |
|
) |
| |
Value: error(__FILE__
":" TOSTRING(__LINE__)
": " msg); \
} while (0)
void error(const char *errMessage)
print error messagePrint an error message
Definition: print.c:131
u32 _errorState
Definition: error.c:3
send error state and display error message
Value:error(__FILE__
":" TOSTRING(__LINE__) \
": " msg)
void error(const char *errMessage)
print error messagePrint an error message
Definition: print.c:131
display error message
| #define REQUIRE |
( |
|
condition | ) |
|
Value:do { \
if (!(condition)) \
_tests_passed = false; \
} \
} while (0)
void print(const char *str)
print a string to the output streamThis function prints a string to an output stream displayed on the...
Definition: print.c:52
Require condition to be true
| #define REQUIRE_FLT_EQ |
( |
|
L, |
|
|
|
R, |
|
|
|
tol |
|
) |
| REQUIRE(APPROX_ZERO((L) - (R), tol)) |
Require L and R to be within tol of each other
Value:do { \
if (_tests_passed) \
print(
"all tests passed!"); \
} \
} while (0)
void print(const char *str)
print a string to the output streamThis function prints a string to an output stream displayed on the...
Definition: print.c:52
Macro placed in a function after all tests have been run
| void addLogic |
( |
AI * |
ai, |
|
|
const Logic * |
logic |
|
) |
| |
Add single logic rule to AI.
- Parameters
-
- Returns
- none
| void addMove |
( |
AI * |
ai, |
|
|
const Move * |
move |
|
) |
| |
Tell AI to execute a move.
- Parameters
-
| ai | - Pointer to AI struct |
| move | - Pointer to Move struct |
- Returns
- none
Add single input to queue.
- Parameters
-
- Returns
- none
Add entire move to queue.
- Parameters
-
- Returns
- none
Initialize a Vector.
- Parameters
-
| vec | - pointer to a Vector struct |
| size | - number of values in the vector |
- Returns
false if memory allocation fails, true otherwise
Initialize a matrix.
- Parameters
-
| mat | - pointer to a Matrix struct |
| numRows | - number of rows in the matrix |
| numCols | - number of columns in the matrix |
- Returns
false if memory allocation fails, true otherwise
| void print |
( |
const char * |
str | ) |
|
print a string to the output streamThis function prints a string to an output stream displayed on the designated window (tournament mode - replaces debug menu).
- Parameters
-
- Returns
- none
| void error |
( |
const char * |
errMessage | ) |
|
print error messagePrint an error message
- Parameters
-
| errMessage | - error message to print |
- Returns
- none
- Note
- this will still print the error if the print stream has failed to allocate memory