simple-go.h
| 1 | #ifndef SIMPLE_GO_H |
| 2 | #define SIMPLE_GO_H |
| 3 | #include <stdlib.h> |
| 4 | #include <stdint.h> |
| 5 | #include <stdbool.h> |
| 6 | #include <stdio.h> |
| 7 | |
| 8 | #define BLACK 'b' |
| 9 | #define WHITE 'w' |
| 10 | #define EMPTY ' ' |
| 11 | #define GROUP '#' |
| 12 | #define INVALID_FIELD '\0' |
| 13 | |
| 14 | typedef struct go_board |
| 15 | { |
| 16 | char* field_array; |
| 17 | size_t size; |
| 18 | } go_board; |
| 19 | |
| 20 | typedef struct game_state |
| 21 | { |
| 22 | struct go_board* board; |
| 23 | bool black_turn; |
| 24 | } game_state; |
| 25 | |
| 26 | |
| 27 | go_board* create_board(size_t size); |
| 28 | char get_board_at(go_board* board, size_t y, size_t x); |
| 29 | void set_board_at(go_board* board, size_t y, size_t x, char item); |
| 30 | |
| 31 | |
| 32 | #endif //SIMPLE_GO_H |
| 33 |