rsmc
Loading...
Searching...
No Matches
rsmc.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2// Copyright (c) 2026 01eksa
3
10#ifndef RSMC_RSMC_H
11#define RSMC_RSMC_H
12
13#include "rsmc/abstractions.h"
14#include "rsmc/core.h"
15#include "rsmc/version.h"
16
17#include <stdbool.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
28
32const static RsmcBoard RsmcStartPosition = {.black = 0x810000000, .white = 0x1008000000};
33
39
48RsmcBoard rsmc_apply_move(RsmcBoard board, RsmcBitMask cell_bit_mask, RsmcPlayer player);
49
65bool rsmc_is_move_valid(RsmcBoard board, RsmcBitMask cell_bit_mask, RsmcPlayer player);
66
75
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif // RSMC_RSMC_H
Thin abstract layer for rsmc.
Types and constants for rsmc.
uint8_t RsmcPlayer
Player's color.
Definition core.h:70
uint64_t RsmcBitMask
Definition core.h:134
uint64_t RsmcBitMap
Definition core.h:133
uint32_t RsmcVersion
Definition core.h:23
RsmcVersion rsmc_version(void)
Definition rsmc.c:14
RsmcBoard rsmc_get_start_position(void)
Definition rsmc.c:45
RsmcBoard rsmc_apply_move(RsmcBoard board, RsmcBitMask cell_bit_mask, RsmcPlayer player)
Set piece and flip opponent's pieces if move is valid.
Definition rsmc.c:50
RsmcPlayersScore rsmc_get_players_score(RsmcBoard board)
Calculates score of both players.
Definition rsmc.c:91
RsmcGameState rsmc_get_game_state(RsmcBoard board)
Analyzes current game state: finds player score and game status.
Definition rsmc.c:113
RsmcBitMap rsmc_get_valid_moves(RsmcBoard board, RsmcPlayer player)
Finds all valid moves for given player.
Definition rsmc.c:19
bool rsmc_is_move_valid(RsmcBoard board, RsmcBitMask cell_bit_mask, RsmcPlayer player)
Checks if move is valid.
Definition rsmc.c:100
Stores board as two RsmcBitMap for each player pieces.
Definition core.h:139
RsmcBitMap black
Definition core.h:142
Stores score for both players and game status.
Definition core.h:127
Stores score fot both players.
Definition core.h:118
Macros for rsmc version.