File tree Expand file tree Collapse file tree
cspuz_rs_puzzles/src/puzzles Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,21 +17,6 @@ pub fn solve_milktea(clues: &[Vec<i32>]) -> Option<graph::BoolGridEdgesIrrefutab
1717 let is_center = & solver. bool_var_2d ( ( h, w) ) ;
1818 for y in 0 ..h {
1919 for x in 0 ..w {
20- let mut adj = vec ! [ ] ;
21-
22- if y > 0 {
23- adj. push ( is_line. vertical . at ( ( y - 1 , x) ) ) ;
24- }
25- if x > 0 {
26- adj. push ( is_line. horizontal . at ( ( y, x - 1 ) ) ) ;
27- }
28- if y < h - 1 {
29- adj. push ( is_line. vertical . at ( ( y, x) ) ) ;
30- }
31- if x < w - 1 {
32- adj. push ( is_line. horizontal . at ( ( y, x) ) ) ;
33- }
34-
3520 let n = & solver. int_var ( 0 , 3 ) ;
3621 solver. add_expr ( is_line. vertex_neighbors ( ( y, x) ) . count_true ( ) . eq ( n) ) ;
3722
Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ pub fn solve_norinori(
1616 let rooms = graph:: borders_to_rooms ( borders) ;
1717
1818 for room in & rooms {
19- let cells = room. iter ( ) . map ( |& p| is_black. at ( p) ) . collect :: < Vec < _ > > ( ) ;
20- solver. add_expr ( count_true ( cells) . eq ( 2 ) ) ;
19+ solver. add_expr ( is_black. select ( room) . count_true ( ) . eq ( 2 ) ) ;
2120 }
2221 for y in 0 ..h {
2322 for x in 0 ..w {
You can’t perform that action at this time.
0 commit comments