From 27e879c62ecc019591201b1b1068b0c41870cfab Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 3 Aug 2026 21:56:36 +0200 Subject: a big hell of a commit --- src/board/fen.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/board/fen.cpp') diff --git a/src/board/fen.cpp b/src/board/fen.cpp index fc52bfe..c4c5e7a 100644 --- a/src/board/fen.cpp +++ b/src/board/fen.cpp @@ -2,7 +2,6 @@ #include "board.hpp" #include #include -#include #include #include #include @@ -14,7 +13,7 @@ bool BLACK = false; void setBoardFen(const std::string fen, Game *g) { // example fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 int file = 0; - int rank = 0; + int rank = 7; Position enpassant = {}; enum parserState { @@ -52,14 +51,6 @@ void setBoardFen(const std::string fen, Game *g) { } } if (parser_state == ENPASSANT) { - if (toupper(c) >= 'A' && toupper(c) <= 'H') { - enpassant.file = static_cast(toupper(c) - 'A'); - g->canEnpassant = true; - } - if (c >= '1' && c <= '8') { - enpassant.rank = static_cast(c - '0'); - g->canEnpassant = true; - } continue; } if (parser_state == CASTLE) { @@ -111,8 +102,8 @@ void setBoardFen(const std::string fen, Game *g) { } if (c == '/') { file = 0; - rank++; - if (rank >= 8) { + rank--; + if (rank < 0) { std::println("Fatal: rank was to big"); assert(false && "Malformed rank"); exit(1); -- cgit v1.2.3