Skip to content
Snippets Groups Projects
Commit 53a25abe authored by Constantin Geier's avatar Constantin Geier
Browse files

ki promotePieces

parent 1d6adeaf
Branches master
No related tags found
No related merge requests found
......@@ -40,8 +40,25 @@ int heuristic_simple(const char playingField[8][8],const bool white){
}
void promotePieces(char playingField[8][8],const bool white){
const char youMen=white ? 'w' : 'b';
const char youQueen=white ? 'W' : 'B';
const int youFarthestRow= white ? 8 : 0;
for(int i=0;i<8;i++){
if(playingField[i][youFarthestRow]==youMen){
playingField[i][youFarthestRow]=youQueen;
}
}
}
//uses the loockup table that takes positions into account
int heuristic_advanced(const char playingField[8][8],const bool white){
int heuristic_advanced(char playingField[8][8],const bool white){
//HACK
//we did not promote men to queens yet when this function is called
promotePieces(playingField,white);
const char youMen=white ? 'w' : 'b';
const char youQueen=white ? 'W' : 'B';
int score=0;
......
......@@ -7,7 +7,7 @@
int heuristic_simple(const char playingField[8][8],const bool white);
int heuristic_advanced(const char playingField[8][8],const bool white);
int heuristic_advanced(char playingField[8][8],const bool white);
......
......@@ -109,6 +109,7 @@ void random_selectMove(Table* now, char* moveCommandB){
}
}
//select the best jump / best step move possible,
//based on the lookup table
void weighted_selectMove(Table* now, char* moveCommandB){
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment