This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#ifndef MAIN_H | |
#define MAIN_H | |
#include <conio.h> | |
#include <iostream> | |
#include <ctype.h> | |
//dimensions of the board |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <cmath> | |
#include <conio.h> | |
#include "main.h" | |
int main() { | |
setup(); | |
printBoard(); | |
introduction(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
largeNum operator+(largeNum& summand1, largeNum& summand2) { | |
largeNum returnNum; | |
//macros to shorten the code | |
std::vector<int> &tmp1 = summand1.getValue(); | |
std::vector<int> &tmp2 = summand2.getValue(); | |
int size = 0; | |
bool storedTen = false; | |
int temp = 0; | |
if (summand1 == *zero) return summand2; | |
if (summand2 == *zero) return summand1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
largeNum operator+(largeNum& summand1, largeNum& summand2) { | |
largeNum returnNum; | |
//macros to shorten the code | |
std::vector<int> &tmp1 = summand1.getValue(); | |
std::vector<int> &tmp2 = summand2.getValue(); | |
int size; | |
bool storedTen = false; | |
int temp; | |
if (summand1 == *zero) return summand2; | |
if (summand2 == *zero) return summand1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
largeNum operator+(largeNum& summand1, largeNum& summand2) | |
{ | |
largeNum returnNum; | |
//macros to shorten the code | |
largeNum LNtmp1 = summand1; | |
largeNum LNtmp2 = summand2; | |
std::vector<int>& tmp1 = LNtmp1.getValue(); | |
std::vector<int>& tmp2 = LNtmp2.getValue(); | |
int size; | |
bool storedTen = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Forcier%!v(MISSING)Lazaro%!v(MISSING)Vachil%!v(MISSING)Terryn%!v(MISSING)Massimo%!v(MISSING)Wilek%!v(MISSING)Freeman%!v(MISSING)Hannon%!v(MISSING)Thisbe%!v(MISSING)Procto%!v(MISSING)Natascha%!v(MISSING)Dewitt%!v(MISSING)Luciana%!v(MISSING)Zoa%!v(MISSING)Strickman%!v(MISSING)Toms%!v(MISSING)Douville%!v(MISSING)Yehudi%!v(MISSING)Ridinger%!v(MISSING)Mitch%!v(MISSING)Kress%!v(MISSING)Leshia%!v(MISSING)Zetana%!v(MISSING)Wolcott%!v(MISSING)Lord%!v(MISSING)Elicia%!v(MISSING)Bale%!v(MISSING)Elvera%!v(MISSING)Ricky%!v(MISSING)Fawn%!v(MISSING)Tobye%!v(MISSING)Zak%!v(MISSING)Gillette%!v(MISSING)Humberto%!v(MISSING)Brad%!v(MISSING)Aldarcie%!v(MISSING)Feld%!v(MISSING)Treacy%!v(MISSING)Jamin%!v(MISSING)Marentic%!v(MISSING)Michelle%!v(MISSING)Tabatha%!v(MISSING)Galer%!v(MISSING)Rosemare%!v(MISSING)Novick%!v(MISSING)Wilkison%!v(MISSING)Terrel%!v(MISSING)Amelia%!v(MISSING)Hake%!v(MISSING)Drida%!v(MISSING)Downs%!v(MISSING)Senalda%!v(MISSING)Bobbee%!v(MISSING)Hali%!v(MISSING)Mehalek%!v(MISSING)Allwein%!v(MISSING)Harned%!v(MISSI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (piece == pawn) | |
{ | |
//check if capture is possible or not | |
if (toLine == line + 1 && (toRow == row + 1 || toRow == row - 1)) | |
{ | |
if (board[toLine][toRow] < 0 || checkForCheck) | |
{ | |
if (toLine == 7) | |
{ | |
board[line][row] = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void position::parseFEN(std::string FEN) | |
{ | |
ASSERT(FEN != ""); | |
ASSERT(this != nullptr); | |
int rank = RANK_8; | |
int file = FILE_A; | |
int piece = 0; | |
int count = 0; | |
int sq64 = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void generateAllMoves(const position* pos, moveList* list) | |
{ | |
// TODO reduce pawn move generation to not use the "if" and maybe reduce it to one addPawnMove function | |
ASSERT(pos->checkBoard()); | |
list->count = 0; | |
int side = pos->side; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void generateAllMoves(const position* pos, moveList* list) { | |
ASSERT(pos->checkBoard()); | |
list->count = 0; | |
int side = pos->side; | |
bool isWhite = side == WHITE; | |
// loop for all pawns | |
if (side == WHITE) { | |
for (int i = 0; i < pos->pieceNum[P]; i++) { | |
int sq = pos->pList[P][i]; |
OlderNewer