Minor changes.
This commit is contained in:
3 files changed
+16
-10
No files matched your search
@@ -72,6 +72,9 @@ bool run_bfs(int128_t* sum, int128_t a0, int128_t b0, int128_t c0, int print_mod
|
|||||||
}
|
}
|
||||||
*sum+=max_moves;
|
*sum+=max_moves;
|
||||||
|
|
||||||
if (print_mode == 1) free(moves);
|
if (print_mode == 1) {
|
||||||
|
free(moves);
|
||||||
|
moves = NULL;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
+11
-9
@@ -44,7 +44,14 @@ void node_pool_reset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void node_pool_destroy() {
|
void node_pool_destroy() {
|
||||||
if (pool) free(pool);
|
if (pool) {
|
||||||
|
free(pool);
|
||||||
|
pool = NULL;
|
||||||
|
}
|
||||||
|
if (visited_pool) {
|
||||||
|
free(visited_pool);
|
||||||
|
visited_pool = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t node_pool_usage() {
|
int32_t node_pool_usage() {
|
||||||
@@ -84,18 +91,13 @@ void try_push_children(Node* curr) {
|
|||||||
make_move('A', curr);
|
make_move('A', curr);
|
||||||
make_move('B', curr);
|
make_move('B', curr);
|
||||||
make_move('C', curr);
|
make_move('C', curr);
|
||||||
return;
|
} else if (last == 'A') {
|
||||||
}
|
|
||||||
|
|
||||||
if (last == 'A') {
|
|
||||||
make_move('C', curr);
|
make_move('C', curr);
|
||||||
make_move('B', curr);
|
make_move('B', curr);
|
||||||
}
|
} else if (last == 'B') {
|
||||||
else if (last == 'B') {
|
|
||||||
make_move('C', curr);
|
make_move('C', curr);
|
||||||
make_move('A', curr);
|
make_move('A', curr);
|
||||||
}
|
} else if (last == 'C') {
|
||||||
else if (last == 'C') {
|
|
||||||
make_move('B', curr);
|
make_move('B', curr);
|
||||||
make_move('A', curr);
|
make_move('A', curr);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user