diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-02-23 14:14:50 +0100 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-02-23 14:14:50 +0100 |
commit | 1a55f52bb79b609cd850a77e2f7a9fdc6b4fbf6b (patch) | |
tree | a28604c4e89be863954baa887e758bd0419d2e53 /voerbak/voerbak.h | |
parent | 34c9fa5176f0d2c18457a72085f5803c2d616cc6 (diff) |
split up code into seperate files
Diffstat (limited to 'voerbak/voerbak.h')
-rw-r--r-- | voerbak/voerbak.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/voerbak/voerbak.h b/voerbak/voerbak.h new file mode 100644 index 0000000..0ef6cf9 --- /dev/null +++ b/voerbak/voerbak.h @@ -0,0 +1,44 @@ +#pragma once +#include <stdio.h> +#include <stdlib.h> +#include <memory.h> +#include <stdbool.h> + +/** + * @brief Structure to store a board + * + * @param width Board width + * @param height Board height + * @param length Board state array length (width * height) + * @param board Board state array + */ +typedef struct { + int width; + int height; + int length; + int* board; +} Board; + +/** + * @brief Print the board array + */ +void printBoard(Board*); + +/** + * @brief Check if the board is full (draw) + * + * @return `true` board is full + */ +bool boardFull(Board*); + +/** + * @brief Drop a disc into the board + * + * @return `true` if drop was successful, `false` if column full + */ +bool dropFisje(Board*, int, int); + +/** + * @brief Main function + */ +int main(); |