diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-28 10:42:53 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-28 10:42:53 +0200 |
| commit | bb30752226c59148ae36beb248c8e4ed6eac39d1 (patch) | |
| tree | c34a10d563f3c37f2c388de1cc00db3704e862ca /src | |
| parent | bc20789325250b1ca6b5b06a8021a99d91a5dc20 (diff) | |
again fixing memory bugs
Diffstat (limited to 'src')
| -rw-r--r-- | src/board.hpp | 22 | ||||
| -rw-r--r-- | src/moves.cpp | 1 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/board.hpp b/src/board.hpp index 5e4e777..1c53827 100644 --- a/src/board.hpp +++ b/src/board.hpp @@ -23,27 +23,27 @@ enum GameState { std::string toChar(PieceType type, bool white); struct Piece { - bool color; - PieceType type; - bool moved; + bool color = 0; + PieceType type = NONE; + bool moved = false; }; struct Position { - uint8_t rank; - uint8_t file; + uint8_t rank = 0; + uint8_t file = 0; bool operator==(const Position &) const = default; }; struct Game { Piece pieces[64]; - bool turn; // 1 white; 0 black - std::string castle; - uint8_t halfMoveClock; - uint16_t MoveClock; + bool turn = 1; // 1 white; 0 black + std::string castle = ""; + uint8_t halfMoveClock = 0; + uint16_t MoveClock = 0; Position enPassant; - bool canEnpassant; - GameState state; + bool canEnpassant = 0; + GameState state = TURN; }; struct Move { diff --git a/src/moves.cpp b/src/moves.cpp index 00cd437..3463fe8 100644 --- a/src/moves.cpp +++ b/src/moves.cpp @@ -1,7 +1,6 @@ #include <array> #include <cassert> #include <cstdint> -#include <iostream> #include <sys/types.h> #include <vector> |
