diff options
Diffstat (limited to 'include/tak.h')
| -rw-r--r-- | include/tak.h | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/include/tak.h b/include/tak.h index 135e4eb..8b40430 100644 --- a/include/tak.h +++ b/include/tak.h @@ -1,14 +1,32 @@ +/* + This file is part of ctak. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Takwrap. If not, see <https://www.gnu.org/licenses/>. +*/ + #ifndef TAK_H #define TAK_H #include <stdint.h> +// =================================================================== +// Types +// =================================================================== + enum E_RESULT {ACT_OK, ACT_ILLEGAL, ACT_OVERFLOW, PTN_VALID, PTN_INVALID, GAME_END }; -// ------------------------------------------------------------------- -// State management - enum COLOUR { C_WHITE, C_BLACK }; enum STONE_VARIANT { STONE_FLAT, STONE_STANDING, STONE_CAPSTONE }; enum MOVE_DIRECTION { M_UP, M_DOWN, M_LEFT, M_RIGHT }; @@ -27,6 +45,10 @@ typedef uint16_t colour_stack_t; #define COUNT_AT(l) (celldat[(l)] >> NUM_SHIFT) #define THE_COORDS(col,row) ((col)+(row)*board_size) +// =================================================================== +// Variables +// =================================================================== + extern enum WIN_TYPE won; extern uint8_t board_size; extern data_t celldat[36]; @@ -34,6 +56,13 @@ extern colour_stack_t colours[36]; extern enum COLOUR current_colour; extern uint8_t white_count, black_count, ply; +// =================================================================== +// Methods +// =================================================================== + +// ------------------------------------------------------------------- +// Game state + void reset_state(const uint8_t new_board_size); void next_ply(void); |
