WIP
This commit is contained in:
1 parent
d9627ab957
commit
7961a69d18
2 files changed
+9
-11
No files matched your search
Vendored
+3
-3
@@ -34,9 +34,9 @@
|
|||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceFolder}/build/game_solve",
|
"program": "${workspaceFolder}/build/game_solve",
|
||||||
"args": [
|
"args": [
|
||||||
"-s gdefault.txt",
|
"-s",
|
||||||
"gdefault.txt",
|
"${workspaceFolder}/build/gdefault.txt",
|
||||||
"gdefaultsol.txt"
|
"${workspaceFolder}/build/gdefaultsol.txt"
|
||||||
],
|
],
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"cwd": "${fileDirname}",
|
"cwd": "${fileDirname}",
|
||||||
|
|||||||
+6
-8
@@ -117,15 +117,13 @@ bool aux_game_solve(game g, uint deep) {
|
|||||||
if (game_get_state(g, i, j) == S_BLANK) {
|
if (game_get_state(g, i, j) == S_BLANK) {
|
||||||
game_set_square(g, i, j, S_LIGHTBULB);
|
game_set_square(g, i, j, S_LIGHTBULB);
|
||||||
game_update_flags(g);
|
game_update_flags(g);
|
||||||
if (game_has_error_general(g)) {
|
if (!game_has_error_general(g)) {
|
||||||
game_set_square(g, i, j, S_BLANK);
|
if (game_is_over(g))
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (game_is_over(g))
|
|
||||||
return true;
|
|
||||||
if (deep > 1) {
|
|
||||||
if (aux_game_solve(g, deep - 1)) {
|
|
||||||
return true;
|
return true;
|
||||||
|
if (deep > 1) {
|
||||||
|
if (aux_game_solve(g, deep - 1)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
game_set_square(g, i, j, S_BLANK);
|
game_set_square(g, i, j, S_BLANK);
|
||||||
|
|||||||
Reference in new issue
Block a user