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; }