Skip to content

Commit

Permalink
Add doxygen comments to files
Browse files Browse the repository at this point in the history
  • Loading branch information
m-heim committed Feb 19, 2024
1 parent 2e65a78 commit bb6fbc2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/position/fen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#include <iostream>
#include <square.hpp>

/*
@brief Parse a fen from a string, exits on error
*/
Position parseFen(const std::string &fen) {
int start = 0;
size_t next = fen.find(' ', start);
Expand Down Expand Up @@ -86,6 +89,9 @@ Position parseFen(const std::string &fen) {
return position;
}

/*
@brief read a fen from a file, does not check for validity
*/
std::string readFen(const std::string &fenPath) {
std::ifstream fen_file_stream(fenPath, std::ios::in);
if (!fen_file_stream.is_open()) {
Expand Down
6 changes: 6 additions & 0 deletions src/position/zobrist.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
#include <bitboard.hpp>
#include <chess.hpp>

/*
@link https://www.chessprogramming.org/Zobrist_Hashing
@brief Allows to hash a position into a 64 Bit number for transposition purposes
*/

constexpr Bitboard ZOBRIST_SEED = fileA | fileH | rank4;

extern std::array<std::array<std::array<Bitboard, Square::SQUARE_COUNT>, Piece::KING + 1>,
Color::BLACK + 1>
zobristKeys;

extern Bitboard zobristSide;
extern std::array<Bitboard, File::FILE_COUNT> zobristEnPassant;
extern std::array<std::array<std::array<Bitboard, 2>, Castle::CASTLE_COUNT>, Color::BLACK + 1>
Expand Down

0 comments on commit bb6fbc2

Please sign in to comment.