Skip to content

Commit 81edd2f

Browse files
committed
table rase sur l'ia, refactoring et correction de bug lié au rendering
1 parent 748a317 commit 81edd2f

9 files changed

Lines changed: 264 additions & 532 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ include/
77
build/
88

99
chess-ui
10+
11+
Bugs_A_Corriger.txt

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ INCLUDE_DIR := lib
77
BUILD_DIR := build
88

99
EXEC := $(BUILD_DIR)/chess
10+
BOT_EXEC := $(BUILD_DIR)/bot
1011
TEST_EXEC := $(BUILD_DIR)/test_runner
1112

1213
LDLIBS := `sdl2-config --libs` -lSDL2_image
@@ -16,6 +17,10 @@ SRC_FILES := $(shell find $(SRC_DIR) -name "*.c")
1617
SRC_FILES := $(filter-out $(SRC_DIR)/main_ai.c, $(SRC_FILES))
1718
OBJ_FILES := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.o,$(SRC_FILES))
1819

20+
BOT_SRC_FILES := $(shell find $(SRC_DIR) -name "*.c")
21+
BOT_SRC_FILES := $(filter-out $(SRC_DIR)/main.c, $(BOT_SRC_FILES))
22+
BOT_OBJ_FILES := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.o,$(BOT_SRC_FILES))
23+
1924
# === INCLUDES ===
2025
INCLUDE_PATHS := $(shell find $(INCLUDE_DIR) -type d)
2126
INCLUDES := $(foreach dir,$(INCLUDE_PATHS),-I$(dir))
@@ -33,12 +38,23 @@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
3338
@echo "🛠️ Compiling $<"
3439
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
3540

41+
$(BOT_EXEC): $(BOT_OBJ_FILES)
42+
@mkdir -p $(BUILD_DIR)
43+
@echo "🔗 Linkage (bot)..."
44+
$(CC) $(BOT_OBJ_FILES) -o $@ $(LDLIBS)
45+
46+
3647
# === EXÉCUTIONS ===
3748
run: $(EXEC)
3849
@echo "🚀 Running $(EXEC)..."
3950
./$(EXEC)
4051

4152

53+
bot: $(BOT_EXEC)
54+
@echo "🚀 Running $(BOT_EXEC)..."
55+
./$(BOT_EXEC)
56+
57+
4258
# === NETTOYAGE ===
4359
clean:
4460
@echo "🧹 Cleaning..."

lib/ai/ai.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#define INFINI 1000000000
1818
#define MAT 900000000
19-
#define MAX_QDEPTH 8
2019
#define MAX_DEPTH 50
2120

2221
#pragma once
@@ -42,4 +41,4 @@ typedef struct
4241
/// @return
4342
Move get_best_move(Chessboard board);
4443

45-
void initialise_ai();
44+
void initialise_ai(int color_ai);

0 commit comments

Comments
 (0)