aboutsummaryrefslogtreecommitdiff
path: root/include/state.c
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2020-12-29 18:55:06 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit4a8e687b14b50e3a2a4a3632f6553872f4c301d5 (patch)
tree105efe213f5d69eaa8d9a40531a4ccb72a1c793e /include/state.c
parentfd22e4cf3198c1e63cf26dd5fdce588a1e969ac1 (diff)
PTN code looks correct, minor tweaks and header guards
Diffstat (limited to 'include/state.c')
-rw-r--r--include/state.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/state.c b/include/state.c
index 1505881..3708792 100644
--- a/include/state.c
+++ b/include/state.c
@@ -18,14 +18,16 @@
// -------------------------------------------------------------------
// Game management
-void reset_game() {
- if (board_size == 6) {
+void reset_state(const uint8_t new_board_size) {
+ if (new_board_size == 6) {
+ board_size = 6;
white_flats = 30; black_flats = 30;
} else {
board_size = 5;
white_flats = 21; black_flats = 21;
}
- white_caps = 1; black_caps = 1;
+ white_caps = 1;
+ black_caps = 1;
turn = 0;