From e6742d54a06c87d117c064fd6cd856d765c799f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar?= Date: Tue, 21 Feb 2023 14:46:03 +0100 Subject: [PATCH] =?UTF-8?q?=C3=A7a=20marche=20bof?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TP1/C-Cpp/includes/mysok.h | 2 +- TP1/C-Cpp/src/mysok.cpp | 10 ++++------ TP1/C-Cpp/src/r0.cpp | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/TP1/C-Cpp/includes/mysok.h b/TP1/C-Cpp/includes/mysok.h index a0af94c..8b324d2 100644 --- a/TP1/C-Cpp/includes/mysok.h +++ b/TP1/C-Cpp/includes/mysok.h @@ -8,7 +8,7 @@ #define NBL 20 #define NBC 20 -#define MAX_DEPTH 30 +#define MAX_DEPTH 60 enum movement { MOVE_U = 0, MOVE_D, MOVE_L, MOVE_R, MOVE_W }; diff --git a/TP1/C-Cpp/src/mysok.cpp b/TP1/C-Cpp/src/mysok.cpp index 65910f1..b2e4069 100644 --- a/TP1/C-Cpp/src/mysok.cpp +++ b/TP1/C-Cpp/src/mysok.cpp @@ -100,8 +100,10 @@ void sok_board_t::load(char *_file) { } bool is_in_history(Node current, std::vector history) { - for (ulong i = 0; i < history.size(); ++i) { - Node noeud = history[i]; + + //printf("Taille history : %d\n", history.size()); + + for (auto &noeud : history) { int c = 0; for (int l = 0; l < NBL; ++l) { @@ -294,8 +296,6 @@ int dfs(Node &result, int depth, std::vector history) { result = next_dfs; return 0; } - } else { - return -1; } } @@ -356,8 +356,6 @@ int dfs(Node &result, int depth, std::vector history) { result = next_dfs; return 0; } - } else { - return -1; } } } diff --git a/TP1/C-Cpp/src/r0.cpp b/TP1/C-Cpp/src/r0.cpp index 8e6dbe5..33659eb 100644 --- a/TP1/C-Cpp/src/r0.cpp +++ b/TP1/C-Cpp/src/r0.cpp @@ -32,7 +32,7 @@ int main(int _ac, char **_av) { std::cout << "Solution : " << result.path << "\n"; } - // result.state.print_board(); + //result.state.print_board(); return 0; }