This repository has been archived on 2023-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
iaj/TP1/C-Cpp/src/r0.cpp
2023-02-22 10:52:30 +01:00

38 lines
778 B
C++

#include "../includes/mysok.h"
int main(int _ac, char **_av) {
if (_ac != 2) {
printf("usage: %s SOK_FILE\n", _av[0]);
return 0;
}
sok_board_t S;
S.load(_av[1]);
S.print_board();
Node result;
result.state = S;
result.path = "";
result.path_len = 0;
/* if (bfs(result) == -1) {
std::cout << "Aucune solution trouvée\n";
} else {
std::cout << "Coups : " << result.path_len << "\n";
std::cout << "Solution : " << result.path << "\n";
} */
std::vector<Node> history;
if (dfs(result, 0, history) == -1) {
std::cout << "Aucune solution trouvée\n";
} else {
std::cout << "Coups : " << result.path_len << "\n";
std::cout << "Solution : " << result.path << "\n";
}
// result.state.print_board();
return 0;
}