Skip to content

Commit 69721a9

Browse files
committed
some file definitely merged and removed
1 parent 41bf217 commit 69721a9

File tree

14 files changed

+0
-1162
lines changed

14 files changed

+0
-1162
lines changed

Makefile

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
# Compiler and Flags
22
CXX = g++
3-
<<<<<<< HEAD
43

54
# Source files and object files
65
SRC = main.cpp eval.cpp search.cpp
7-
=======
8-
CXXFLAGS = -march=native -mtune=native -msse4.2 -std=c++17 $(FLAGS) -DNDEBUG
9-
10-
# Source files and object files
11-
SRC = main.cpp eval.cpp search.cpp pieces.cpp pawns.cpp patterns.cpp
12-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
136
OBJ = $(SRC:.cpp=.o)
147

158
# Output file
@@ -20,19 +13,11 @@ all: $(EXEC)
2013

2114
# Linking the object files into the executable
2215
$(EXEC): $(OBJ)
23-
<<<<<<< HEAD
2416
$(CXX) $(CXXFLAGS) -std=c++17 -o $(EXEC) $(OBJ)
2517

2618
# Rule to build object files from source files
2719
%.o: %.cpp
2820
$(CXX) $(CXXFLAGS) -std=c++17 -c $< -o $@
29-
=======
30-
$(CXX) $(CXXFLAGS) -o $(EXEC) $(OBJ)
31-
32-
# Rule to build object files from source files
33-
%.o: %.cpp
34-
$(CXX) $(CXXFLAGS) -c $< -o $@
35-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
3621

3722
# Clean up the compiled files
3823
clean:

eval.cpp

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "eval.h"
22

3-
<<<<<<< HEAD
43
// Define enum class for evaluation keys
54
enum class EvalKey {
65
DOUBLED, BACKWARD, BLOCKED, ISLANDED, ISOLATED, DBLISOLATED, WEAK, PAWNRACE,
@@ -1008,15 +1007,6 @@ int psqt_eval(const chess::Position& board) {
10081007
}
10091008

10101009
int eval(chess::Position board) {
1011-
=======
1012-
std::unordered_map<U64, int> transposition; // Faster lookup
1013-
1014-
// Declare only missing functions
1015-
int evaluatePawnStructure(const chess::Board& board);
1016-
int evaluatePieces(const chess::Board& board);
1017-
1018-
int eval(chess::Board &board) {
1019-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
10201010
U64 hash = board.hash();
10211011
// Faster lookup & insertion
10221012
auto [it, inserted] = transposition.emplace(hash, 0);
@@ -1040,42 +1030,30 @@ int eval(chess::Board &board) {
10401030
};
10411031

10421032
// Compute material score
1043-
<<<<<<< HEAD
10441033
int eval = (EvalWeights::getWeight(EvalKey::PAWN) * (pieceCount[0] - pieceCount[5])) +
10451034
(EvalWeights::getWeight(EvalKey::KNIGHT) * (pieceCount[1] - pieceCount[6])) +
10461035
(EvalWeights::getWeight(EvalKey::BISHOP) * (pieceCount[2] - pieceCount[7])) +
10471036
(EvalWeights::getWeight(EvalKey::ROOK) * (pieceCount[3] - pieceCount[8])) +
10481037
(EvalWeights::getWeight(EvalKey::QUEEN) * (pieceCount[4] - pieceCount[9]));
1049-
=======
1050-
int eval = (Pawn * (pieceCount[0] - pieceCount[5])) +
1051-
(Knight * (pieceCount[1] - pieceCount[6])) +
1052-
(Bishop * (pieceCount[2] - pieceCount[7])) +
1053-
(Rook * (pieceCount[3] - pieceCount[8])) +
1054-
(Queen * (pieceCount[4] - pieceCount[9]));
1055-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
10561038

10571039
// Evaluate positional aspects
10581040
eval += evaluatePawnStructure(board);
10591041
eval += evaluatePieces(board);
10601042
eval += evaluateKingSafety(board);
10611043
eval += evaluateTactics(board);
1062-
<<<<<<< HEAD
10631044
eval += piece_activity(board);
10641045
eval += development(board);
10651046
eval += rook_placement(board);
10661047
eval += center_control(board);
10671048
eval += key_center_squares_control(board);
10681049
eval += psqt_eval(board);
10691050
eval += evaluatePieceActivity(board);
1070-
=======
1071-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
10721051
board.makeNullMove();
10731052
// Evaluate positional aspects
10741053
eval -= evaluatePawnStructure(board);
10751054
eval -= evaluatePieces(board);
10761055
eval -= evaluateKingSafety(board);
10771056
eval -= evaluateTactics(board);
1078-
<<<<<<< HEAD
10791057
eval -= piece_activity(board);
10801058
eval -= development(board);
10811059
eval -= rook_placement(board);
@@ -1085,40 +1063,25 @@ int eval(chess::Board &board) {
10851063
eval -= evaluatePieceActivity(board);
10861064
board.unmakeNullMove();
10871065

1088-
=======
1089-
board.unmakeNullMove();
1090-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
10911066
it->second = eval; // Store result
10921067
return eval;
10931068
}
10941069

1095-
<<<<<<< HEAD
10961070
// Use `const chess::Position&` to avoid copies
10971071
int evaluatePawnStructure(const chess::Position& board) {
10981072
chess::Position b=board;
1099-
=======
1100-
// Use `const chess::Board&` to avoid copies
1101-
int evaluatePawnStructure(const chess::Board& board) {
1102-
chess::Board b=board;
1103-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
11041073
return -(isolated(board) + dblisolated(board) + weaks(board) + blockage(board) +
11051074
holes(board) + underpromote(b) + weakness(board) + evaluatePawnRams(board)) +
11061075
(pawnIslands(board) + pawnRace(board) + pawnShield(board) + pawnStorm(board) +
11071076
pawnLevers(board) + outpost(board) + evaluateUnfreePawns(board) + evaluateOpenPawns(board));
11081077
}
11091078

1110-
<<<<<<< HEAD
11111079
// Use `const chess::Position&` to avoid copies
11121080
int evaluatePieces(const chess::Position& board) {
1113-
=======
1114-
// Use `const chess::Board&` to avoid copies
1115-
int evaluatePieces(const chess::Board& board) {
1116-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
11171081
return -(evaluateBadBishops(board) + evaluateTrappedPieces(board) + evaluateKnightForks(board)) +
11181082
(evaluateFianchetto(board) + evaluateRooksOnFiles(board));
11191083
}
11201084

1121-
<<<<<<< HEAD
11221085
int piece_value(chess::PieceType piece) {
11231086
switch (piece) {
11241087
case (int)chess::PieceType::PAWN: return EvalWeights::getWeight(EvalKey::PAWN);
@@ -1129,5 +1092,3 @@ int piece_value(chess::PieceType piece) {
11291092
default: return 0; // King has no standard value
11301093
}
11311094
}
1132-
=======
1133-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7

eval.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22
#include "chess.hpp"
3-
<<<<<<< HEAD
43
#include <map>
54
#include <vector>
65
#include <cstdint>
@@ -139,19 +138,3 @@ inline U64 southWest(U64 b) { return (b & ~FILE_A) >> 9; }
139138
#define MATE_DISTANCE(i) (i-MAX_MATE)
140139
int eval(chess::Position);
141140
int piece_value(chess::PieceType piece);
142-
=======
143-
#include "patterns.h"
144-
#include "pieces.h"
145-
#include <map>
146-
#include <vector>
147-
#define MAX 32767 // for black
148-
#define MAX_MATE 32000
149-
#define Pawn 100
150-
#define Knight 300
151-
#define Bishop 300
152-
#define Rook 500
153-
#define Queen 900
154-
#define MATE(i) MAX-i
155-
#define MATE_DISTANCE(i) i-MAX_MATE
156-
int eval(chess::Board&);
157-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7

main.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "chess.hpp"
22
#include "search.h"
33
#include <iostream>
4-
<<<<<<< HEAD
54
extern unsigned long long nodes, tthits;
65
/*chess::Move find_best_move(chess::Board &board, int depth) {
76
int bestScore = -MAX;
@@ -33,17 +32,6 @@ int main(){
3332
printf("%i %llu %llu\n", s, nodes, tthits);
3433
printPV(board);
3534
nodes=0, tthits=0;
36-
=======
37-
extern unsigned long long nodes;
38-
int main(){
39-
chess::Board board;
40-
for (int i=1;i<=8;++i){
41-
//Clear transposition
42-
if (!clearTransposition())int x=1/0;//force div/0 err
43-
std::cout<<i<<" ";
44-
std::cout<<search(board,i,-MAX,MAX,0)<<" "<<nodes<<std::endl;
45-
nodes=0;
46-
>>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
4735
}
4836
return 0;
4937
}

0 commit comments

Comments
 (0)