blob: 0ef6cf91f6f8e84ab0402568ba68f184a0d6f338 (
plain)
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
|
#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();
|