diff --git a/.vscode/launch.json b/.vscode/launch.json index 7ad5aac..36ad3ae 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -35,7 +35,9 @@ "program": "${workspaceFolder}/build/game_solve", "args": [ "-c", - "${workspaceFolder}/build/test.txt" + "${workspaceFolder}/build/test.txt", + "${workspaceFolder}/build/testsol.txt" + ], "stopAtEntry": false, "cwd": "${fileDirname}", diff --git a/game_solve.c b/game_solve.c index 58b7b46..dab4687 100644 --- a/game_solve.c +++ b/game_solve.c @@ -59,10 +59,11 @@ int main(int argc, char* argv[]) { if (argc == 4) { char* filename = argv[3]; FILE* f = fopen(filename, "w"); - checkPointer((void*)f, "Couldn't open file in game_solve executable\n"); - test_output(fprintf(f, "%u\n", nbSolutions), 2, "Error when printing in file in game_solve executable\n"); + checkPointer((void*)f, "\nCouldn't open file in game_solve executable\n"); + uint nbchar_nbsolution = nbSolutions / 10; + test_output(fprintf(f, "%u\n", nbSolutions), nbchar_nbsolution + 1, "\nError when printing in file in game_solve executable\n"); fclose(f); - printf(" this number has been saved in file named : %s", filename); + printf(", this number has been saved in file named : %s", filename); } printf("\n"); game_delete(g2);