-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Comment new Action/Strategy fields for later; plan future strategy ch…
…anges
- Loading branch information
Showing
2 changed files
with
48 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,85 @@ | ||
/// Identifies the logic used to solve cells and remove candidates. | ||
/// | ||
/// - Strategy stays a simple high-level enum with no values | ||
/// - Rule specifies subtype or rule with knowns/cells/houses (see comments below) | ||
/// - Strategy Intersection Removal has Line/Box Reduction and Pointing Pair/Triple | ||
/// - Deduction combines the Strategy and Clue with Effects (sets and erases) | ||
/// | ||
/// Add Class (groupings)? | ||
/// - Naked Candidates | ||
/// - Hidden Candidates | ||
/// - Intersection Removal | ||
/// - Fish | ||
/// - ...kinda breaks down after that | ||
/// | ||
/// What's the point? Want to be able to filter rules to apply (automatically), | ||
/// and then really only peers and singles? This is a tool for creating and solving | ||
/// puzzles automatically. The UI is just for fun and to learn Rust. | ||
/// | ||
/// Add Difficulty? sudokuwiki.org only has four: | ||
/// - Basic | ||
/// - Tough | ||
/// - Diabolical | ||
/// - Extreme | ||
/// | ||
/// What is the purpose of this project? | ||
/// - learn Rust | ||
/// - have fun | ||
/// - exercise my brain | ||
/// - Create a generalized solver using inference chains | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq)] | ||
pub enum Strategy { | ||
// these become the Clues; copy and generalize for Strategy | ||
/// When a cell becomes solved, the value may be removed as a candidate | ||
/// from every cell in the same row, column or box. | ||
Peer, | ||
Peer, // (Known, Cell) | ||
|
||
/// A candidate that may only appear in two cells in one segment of a block | ||
/// may be removed from the other two segments in the segment's row or column. | ||
/// | ||
/// This is one form of intersection removals. | ||
PointingPair, | ||
PointingPair, // (Known, block House, House, (Cell, Cell)) | ||
/// A candidate that may only appear in three cells one segment of a block | ||
/// may be removed from the other two segments in the segment's row or column. | ||
/// | ||
/// This is one form of intersection removals. | ||
PointingTriple, | ||
PointingTriple, // (Known, block House, House, (Cell, Cell, Cell)) | ||
/// A candidate that may only appear in one segment of a block | ||
/// may be removed from the other cells in the block. | ||
/// | ||
/// This is one form of intersection removals. | ||
BoxLineReduction, | ||
BoxLineReduction, // (Known, block House, House) | ||
|
||
/// A cell with one candidate remaining may be solved. | ||
NakedSingle, | ||
NakedSingle, // (Known, Cell) | ||
/// A candidate that may only appear in one cell in a house may be solved. | ||
HiddenSingle, | ||
HiddenSingle, // (Known, House, Cell) | ||
|
||
/// Two cells in a house and with the same two candidates remaining | ||
/// may remove those candidates from all other cells in that house. | ||
NakedPair, | ||
NakedPair, // (KnownSet, House, CoordSet) | ||
/// Two candidates remaining in two cells in a house | ||
/// may remove all other candidates in those cells. | ||
HiddenPair, | ||
HiddenPair, // (KnownSet, House, CoordSet) | ||
|
||
/// Three cells in a house and with the same three candidates remaining | ||
/// may remove those candidates from all other cells in that house. | ||
NakedTriple, | ||
NakedTriple, // (KnownSet, House, CoordSet) | ||
/// Three candidates remaining in three cells in a house | ||
/// may remove all other candidates in those cells. | ||
HiddenTriple, | ||
HiddenTriple, // (KnownSet, House, CoordSet) | ||
|
||
/// Four cells in a house and with the same four candidates remaining | ||
/// may remove those candidates from all other cells in that house. | ||
NakedQuad, | ||
NakedQuad, // (KnownSet, House, CoordSet) | ||
/// Four candidates remaining in four cells in a house | ||
/// may remove all other candidates in those cells. | ||
HiddenQuad, | ||
HiddenQuad, // (KnownSet, House, CoordSet) | ||
|
||
XWing, | ||
Swordfish, | ||
Jellyfish, | ||
XWing, // (Known, mains HouseSet, crosses HouseSet) | ||
Swordfish, // (Known, mains HouseSet, crosses HouseSet) | ||
Jellyfish, // (Known, mains HouseSet, crosses HouseSet) | ||
|
||
SinglesChain, | ||
YWing, | ||
SinglesChain, // (Known, Vec<Cell>) | ||
YWing, // (Known, pivot Cell, arms (Cell, Cell)) | ||
} |