cool: I added figlet headings because I'm that cool

This commit is contained in:
A.M. Rowsell 2025-09-01 01:42:42 -04:00
commit b68169dd2b
Signed by untrusted user who does not match committer: amr
GPG key ID: E0879EDBDB0CA7B1

View file

@ -25,6 +25,28 @@ std::vector<Move> Piece::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList; std::vector<Move> moveList;
return moveList; return moveList;
} }
bool Piece::finalMoveChecks(std::vector<Move> *moveList, Board &board) {
// This function needs to do the final checks before declaring a move legal
// Check to see if the piece that is being moves is currently blocking check
// Check to see if a castle is trying to go through check or out of check
// Check if it's a piece trying to capture the King (though this shouldn't happen normally)
return true;
}
// *INDENT-OFF*
// ##
// ## ##
// ##
// ## ## ## # ## ####
// ## # ## ## ## ## #
// ### ## ## ## ## #
// ## # ## ## ## ###
// ## ## ## ## ### ##
// ####
// # #
// ####
// *INDENT-ON*
bool King::checkForCheck(Board &board) const { bool King::checkForCheck(Board &board) const {
std::vector<std::vector<int>> kingVulnerable = { std::vector<std::vector<int>> kingVulnerable = {
{-1, 0}, // Up {-1, 0}, // Up
@ -159,6 +181,16 @@ std::vector<Move> King::getLegalMoves(const Square &from, Board &board) const {
return moveList; return moveList;
} }
// *INDENT-OFF*
// ##
// ##
// ## # ### ### ## ##
// #### ## ## ## ## ## #
// ## ## ## ## ## ###
// ## ## ## ## ## ## #
// ## ### ### ## ##
// *INDENT-OM*
std::vector<Move> Rook::getLegalMoves(const Square &from, Board &board) const { std::vector<Move> Rook::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList; std::vector<Move> moveList;
const int directions[4][2] = { const int directions[4][2] = {
@ -189,6 +221,16 @@ std::vector<Move> Rook::getLegalMoves(const Square &from, Board &board) const {
return moveList; return moveList;
} }
// *INDENT-OFF*
// ### ## ## ### ### # ##
// ## # ## # ## # ## # ## ##
// ## # ## # #### #### ## ##
// ## # ## # ## ## ## ##
// ### ### ### ### ## ###
// ##
// ###
// *INDENT-ON*
std::vector<Move> Queen::getLegalMoves(const Square &from, Board &board) const { std::vector<Move> Queen::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList; std::vector<Move> moveList;
std::vector<std::vector<int>> directions = { std::vector<std::vector<int>> directions = {
@ -226,6 +268,21 @@ std::vector<Move> Queen::getLegalMoves(const Square &from, Board &board) const {
return moveList; return moveList;
} }
// *INDENT-OFF*
//
// ##
// ## ## ## #
// ## ## ##
// ## ## # ## ## #### #### ###
// ## # ## ## ## ## # ## # ##
// ### ## ## ## ## # ## # ##
// ## # ## ## ## ### ## # ##
// ## ## ## ### ## ## ## ## ##
// ####
// # #
// ####
// *INDENT-ON*
std::vector<Move> Knight::getLegalMoves(const Square &from, Board &board) const { std::vector<Move> Knight::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList; std::vector<Move> moveList;
std::vector<std::vector<int>> directions = { std::vector<std::vector<int>> directions = {
@ -241,6 +298,20 @@ std::vector<Move> Knight::getLegalMoves(const Square &from, Board &board) const
return moveList; return moveList;
} }
// *INDENT-OFF*
//
// ##
// ## ## ##
// ## ##
// ### ## ## #### ### ###
// ## # ## ## ## # ## ## ## #
// ## # ## ### ## # ## ## ## #
// ## # ## ## ## # ## ## ## #
// ### ## ### ## ## ### ###
// ##
// ###
// *INDENT-ON*
std::vector<Move> Bishop::getLegalMoves(const Square &from, Board &board) const { std::vector<Move> Bishop::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList; std::vector<Move> moveList;
std::vector<std::vector<int>> directions = { std::vector<std::vector<int>> directions = {
@ -252,6 +323,16 @@ std::vector<Move> Bishop::getLegalMoves(const Square &from, Board &board) const
return moveList; return moveList;
} }
// *INDENT-OFF*
// ### ## # # ## # ##
// ## # # ## # # # ## ##
// ## # ### # ### ## ##
// ## # # # #### ## ##
// ### ##### # # ## ###
// ##
// ###
// *INDENT-ON*
std::vector<Move> Pawn::getLegalMoves(const Square &from, Board &board) const { std::vector<Move> Pawn::getLegalMoves(const Square &from, Board &board) const {
std::vector<Move> moveList; std::vector<Move> moveList;
const int directions[2][4][2] = { const int directions[2][4][2] = {