enabled compiler optimizations + sped up search a little bit

This commit is contained in:
rektdie committed 2024-05-15 00:32:57 +02:00
1 parent d89956a2fb
commit a23918ab8d
3 files changed
+7 -9

No files matched your search

+2 -2
View File
@@ -17,11 +17,11 @@ OBJS := $(addprefix $(OBJ_DIR)/, $(notdir $(SRCS:.cpp=.o)))
# Target executable # Target executable
Eleanor$(EXE_EXT): $(OBJS) Eleanor$(EXE_EXT): $(OBJS)
g++ -o $@ $^ g++ -o $@ $^ -O3
# Rule to compile source files to object files # Rule to compile source files to object files
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/types.h | $(OBJ_DIR) $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/types.h | $(OBJ_DIR)
g++ -c -o $@ $< g++ -c -o $@ $< -O3
# Create the object directory if it doesn't exist # Create the object directory if it doesn't exist
$(OBJ_DIR): $(OBJ_DIR):
-3
View File
@@ -1,8 +1,5 @@
#include <iostream>
#include "types.h"
#include "board.h" #include "board.h"
#include "movegen.h" #include "movegen.h"
#include "perft.h"
#include "uci.h" #include "uci.h"
int main() { int main() {
+5 -4
View File
@@ -40,6 +40,11 @@ int Quiescence(Board board, int alpha, int beta) {
} }
int NegaMax(Board board, int depth, int alpha, int beta, bool isRoot) { int NegaMax(Board board, int depth, int alpha, int beta, bool isRoot) {
if (depth == 0) {
return Quiescence(board, -50000, 50000);
//return Evaluate(board);
}
GenerateMoves(board, board.sideToMove); GenerateMoves(board, board.sideToMove);
if (board.moveList.size() == 0) { if (board.moveList.size() == 0) {
@@ -50,10 +55,6 @@ int NegaMax(Board board, int depth, int alpha, int beta, bool isRoot) {
} }
} }
if (depth == 0) {
return Quiescence(board, -50000, 50000);
//return Evaluate(board);
}
int max = -50000; int max = -50000;