Skip to content

Commit 6de4c95

Browse files
committed
Adressed comments (literally)
1 parent 66caf0e commit 6de4c95

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cspuz_rs_puzzles/src/puzzles/fillmat.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ pub fn solve_fillmat(
2525
.ne(num.slice((1.., ..)))
2626
.iff(&is_border.horizontal),
2727
);
28+
29+
// Same numbers cannot be diagonally adjacent. Takes care of the shape constraint
2830
for i in 1..=4 {
2931
solver.add_expr(!(num.eq(i).slice((..(h - 1), ..(w - 1))) & num.eq(i).slice((1.., 1..))));
3032
solver.add_expr(!(num.eq(i).slice((..(h - 1), 1..)) & num.eq(i).slice((1.., ..(w - 1)))));
@@ -41,7 +43,7 @@ pub fn solve_fillmat(
4143
}
4244
}
4345

44-
// No 4 intersections (technically redundant by theory but keeping it for optimization)
46+
// No 4 intersections
4547
for y in 1..h {
4648
for x in 1..w {
4749
let left = &is_border.horizontal.at((y - 1, x - 1));

0 commit comments

Comments
 (0)