diff options
| author | tslil clingman <tslil@posteo.de> | 2021-01-28 21:30:30 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | a77062ce3dc9a99ad0662010cc7eeb00dd5036a6 (patch) | |
| tree | 6936b60eb7a8221d38886d0db11953fe6ee56f23 /include/tak.h | |
| parent | 473797d820b3b224ee1d370a50e4bcd01d09d48e (diff) | |
Added license information!
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); |
