Skip to content

Commit 2cc3755

Browse files
committed
Add CellSet::share_any_house()
1 parent 0ae84ec commit 2cc3755

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/layout/cells/cell_set.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ impl CellSet {
279279
*self = self.inverted()
280280
}
281281

282+
/// Returns true if all cells in this set are all in any single house.
283+
pub fn share_any_house(&self) -> bool {
284+
self.share_row() || self.share_column() || self.share_block()
285+
}
286+
282287
/// Returns true if all cells in this set are in the same row.
283288
pub fn share_row(&self) -> bool {
284289
self.share_house(Shape::Row)

src/solve/algorithms/wxyz_wings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn find_wxyz_wings(board: &Board, single: bool) -> Option<Effects> {
115115
return false;
116116
}
117117
// ignore naked quads
118-
if wing.share_row() || wing.share_column() || wing.share_block() {
118+
if wing.share_any_house() {
119119
return false;
120120
}
121121
// ignore naked pairs

0 commit comments

Comments
 (0)