mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 15:41:30 -07:00
Introduce a new dsf_equivalent() function.
Not very interesting, but the idiom for checking equivalence via two calls to dsf_canonify is cumbersome enough to be worth abbreviating.
This commit is contained in:
2
divvy.c
2
divvy.c
@ -632,7 +632,7 @@ DSF *divvy_rectangle_attempt(int w, int h, int k, random_state *rs)
|
||||
dsf_merge(tmpdsf, y*w+x, (y+1)*w+x);
|
||||
for (i = 0; i < wh; i++) {
|
||||
j = dsf_canonify(retdsf, i);
|
||||
assert(dsf_canonify(tmpdsf, j) == dsf_canonify(tmpdsf, i));
|
||||
assert(dsf_equivalent(tmpdsf, j, i));
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
Reference in New Issue
Block a user