good enough
This commit is contained in:
@@ -121,29 +121,32 @@ int main () {
|
|||||||
|
|
||||||
spdlog::debug("Folder {} is ready", folder.string());
|
spdlog::debug("Folder {} is ready", folder.string());
|
||||||
} catch (const fs::filesystem_error& e) {
|
} catch (const fs::filesystem_error& e) {
|
||||||
std::cerr << "Filesystem error: " << e.what() << std::endl;
|
spdlog::error("FS error {}", e.what());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int counter = {0};
|
int counter = {0};
|
||||||
|
|
||||||
while(counter<1000){
|
while(true){
|
||||||
for (int n={5}; n<100; n++) {
|
for (int n={55}; n<100; n++) {
|
||||||
for (int m={5}; m<100; m++) {
|
for (int m={55}; m<100; m++) {
|
||||||
for (double wall_prob={0.01}; wall_prob<0.5; wall_prob+=0.01) {
|
for (double wall_prob={0.01}; wall_prob<0.5; wall_prob+=0.01) {
|
||||||
std::vector<std::vector<char>> grid = generate_maze(n,m,wall_prob);
|
std::vector<std::vector<char>> grid = generate_maze(n,m,wall_prob);
|
||||||
int answer = solution(n, m, grid);
|
int answer = solution(n, m, grid);
|
||||||
if (answer==-1) continue;
|
if (answer==-1) continue;
|
||||||
std::ofstream input_file = std::ofstream{fmt::format("{}/{}-{}-{}.in", folder.string(), n,m,wall_prob)};
|
std::ofstream input_file = std::ofstream{fmt::format("{}/{}-{}-{}.in", folder.string(), n,m,static_cast<int>(wall_prob*100))};
|
||||||
std::ofstream out_file = std::ofstream{fmt::format("{}/{}-{}-{}.out", folder.string(), n,m,wall_prob)};
|
std::ofstream out_file = std::ofstream{fmt::format("{}/{}-{}-{}.out", folder.string(), n,m, static_cast<int>(wall_prob*100))};
|
||||||
input_file << fmt::format("{} {}\n", n,m);
|
input_file << fmt::format("{} {}\n", n,m);
|
||||||
input_file << format_grid(grid);
|
input_file << format_grid(grid);
|
||||||
|
out_file << fmt::format("{}",answer);
|
||||||
input_file.flush(); out_file.flush(); input_file.close(); out_file.close();
|
input_file.flush(); out_file.flush(); input_file.close(); out_file.close();
|
||||||
counter++;
|
counter++;
|
||||||
|
if(counter>50000)goto done_mega_loop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
done_mega_loop:
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user