Sokoban/C: Difference between revisions
Content deleted Content added
adding modified solution: quite more complicated, but tends to be faster and use much less memory. |
various bugs |
||
Line 8:
#include <stdbool.h>
int w, h, n_boxes;
int offset[4] = {0, 0, 1, -1};
Line 87 ⟶ 86:
if (board[c + d] != wall && board[c + d * 2] != wall)
mark_live(c + d);
}
}
Line 189 ⟶ 178:
fill_limit = hash_size * 3 / 4; // 0.75 load factor
} else {
hash_size *=
fill_limit *=
}
buckets = realloc(buckets,
assert(buckets);
Line 485 ⟶ 474:
state_t *s = parse_board(
#define BIG
#if BIG == 0
|