Constructed using 2d array of cells Returns: Whether or object constitutes specific strategies Cause (cells that "cause" the strategy to be applicable) What candidates can be placed as result of strategy What candidates can be removed from cells notes as result of strategy What strategy type this is (correlates to StrategyEnum)

Hierarchy

  • Strategy

Constructors

Properties

board: Cell[][]
cause: Cell[]
cellBoard: CellBoard
drillHint: Hint
emptyCells: Cell[][]
groups: number[][]
identified: boolean
notes: Group[]
solution: string[][]
strategyType: number
values: Cell[]

Methods

  • Gets cells that "cause" strategy to be applicable

    Returns

    cells

    Throws

    CustomError Thrown if strategy hasn't been identified

    Returns Cell[]

  • Gets groups that "cause" strategy to be applicable

    Returns

    2d array containing arrays with number representing GroupEnum and index or groups that cause strategy e.g. 0, 1 for 2nd row

    Throws

    CustomError Thrown if strategy hasn't been identified

    Returns number[][]

  • Gets notes that can be removed

    Returns

    Cells containing notes that can be removed

    Throws

    CustomError Thrown if strategy hasn't been identified

    Returns Group[]

  • Gets strategyType

    Returns

    strategyType

    Returns number

  • Gets values that can be placed

    Returns

    Cells containing values that can be placed

    Throws

    CustomError Thrown if strategy hasn't been identified

    Returns Cell[]

  • Checks if strategy is amend notes and if so adds notes to remove from a cell (every note not removed should be added)

    Returns

    true if strategy is amend notes

    Parameters

    • r: number

      corresponds to an array in empty cells

    • c: number

      corresponds to an index in an array in emptyCells

    Returns boolean

  • Checks if strategy is a hidden set of given tuple and if so adds notes to remove

    Returns

    true if strategy is a hidden tuple

    Parameters

    • tuple: TupleEnum

      e.g. could be single or pair for hidden single or hidden pair respectively

    • group: GroupEnum

      group type being check for a obvious set e.g. row

    • i: number

      index of group being checked e.g. 3 for 4th group e.g. 4th row

    • cells: Cell[]

      array of cells in the given row, column, or box

    • inHiddenSet: Group

      stores indexes of the cells that make up the hidden set

    • checkOnly: boolean = false

      exits early after determining if obvious set is found with no state changes, default to false

    Returns boolean

  • Returns true if strategy is a hidden set strategy

    Returns

    true if strategy type is a hidden set strategy

    Parameters

    Returns boolean

  • Checks if strategy is a obvious set of given tuple and if so adds values to be placed and notes to remove

    Returns

    true if strategy is a obvious tuple

    Parameters

    • tuple: TupleEnum

      e.g. could be single or pair for obvious single or obvious pair respectively

    • group: GroupEnum

      group type being check for a obvious set e.g. row

    • i: number

      index of group being checked e.g. 3 for 4th group e.g. 4th row

    • cells: Cell[]

      array of cells in the given row, column, or box

    • inObviousSet: Group

      stores indexes of the cells that make up the obvious set

    • checkOnly: boolean = false

      exits early after determining if obvious set is found with no state changes, default to false

    Returns boolean

  • Returns true if strategy is a obvious set strategy

    Returns

    true if strategy type is a obvious set strategy

    Parameters

    Returns boolean

  • Given a box checks for a pointing set

    Returns

    set tuple e.g. pair if its pointing pair or triplet if its pointing triplet, null if no pointing set found

    Parameters

    • box: number

      index of box being checked

    Returns TupleEnum

  • Checks if strategy is simplify notes and if so adds notes to remove from a cell

    Returns

    true if strategy is simplify notes

    Parameters

    • i: number

      corresponds to an array in empty cells

    • j: number

      corresponds to an index in an array in emptyCells

    Returns boolean

  • Checks if strategy is a given strategy type and if so sets values to place, notes to remove

    Returns

    true if strategy is strategyType

    Parameters

    • strategyType: StrategyEnum

      strategy type that is being checked for

    • drill: boolean = false

      true if checking if strategy if valid for drill which requires there to be exactly one instance of given strategy

    Returns boolean

  • Resets Strategy object fields to initial state

    Returns void

  • Checks if strategy is a given strategy type and if so sets values to place, notes to remove

    Returns

    true if strategy is strategyType

    Parameters

    • strategyType: StrategyEnum

      strategy type that is being checked for

    • drill: boolean = false

    Returns boolean

  • Verified that a strategy has been identified, otherwise throws an error

    Throws

    CustomError Thrown if strategy hasn't been identified

    Returns void

  • Returns algorithm which includes all of the strategies in order of least to most complex

    Returns

    default algorithm

    Returns StrategyEnum[]

Generated using TypeDoc