Constructed using initial value to fill Group with Can check if Group contains a value Can insert values

Hierarchy

  • Group

Constructors

  • Creates Group object given value to initial candidates to

    Parameters

    • initialValue: boolean

      candidate initial value

    Returns Group

  • Creates Group object given value to initial candidates to

    Parameters

    • initialValue: boolean

      candidate initial value

    • row: number

      row to corresponding cell

    • column: number

      column to corresponding cell

    Returns Group

  • Creates Group object given value to initial candidates to

    Parameters

    • initialValue: boolean

      candidate initial value

    • row: number

      row to corresponding cell

    • column: number

      column to corresponding cell

    • length: number

      candidate array length, defaults to ROW_LENGTH

    Returns Group

Properties

candidates: boolean[]
column: number
row: number
size: number
subsets: Map<number, Group[][]> = ...

Methods

  • Creates a clone of this object and returns it

    Returns

    clone of this Group

    Returns Group

  • Checks if Group contains candidate

    Returns

    true if candidate at given index is in this Group

    Parameters

    • candidateIndex: number

      zero based index of candidate

    Returns boolean

  • Checks if Group contains candidate

    Returns

    true if candidate is in this Group

    Parameters

    • candidate: string

      candidate

    Returns boolean

  • Returns true if this Groups candidates are the same as those in the given Group

    Returns

    true if this Group has same note values as obj

    Parameters

    • obj: Group

      Group being compared against

    Returns boolean

  • Get column

    Returns

    column

    Returns number

  • Get row

    Returns

    row

    Returns number

  • Returns the number of candidates in this Group

    Returns

    size

    Returns number

  • Adds candidate to Group

    Returns

    true if candidate was inserted, false if candidate was already in Group

    Parameters

    • candidate: string

      candidate

    Returns boolean

  • Adds candidate to Group

    Returns

    true if candidate was inserted, false if candidate was already in Group

    Parameters

    • candidateIndex: number

      zero based index of candidate

    Returns boolean

  • Given a Group of candidates inserts them into this Group

    Returns

    true if at least one of the candidates was inserted, false if all of them were already in Group

    Parameters

    • candidates: Group

      Group containing candidates to insert into this Group

    Returns boolean

  • Given a Group obj returns a Group containing every candidate in both this Group and obj

    Returns

    Group containing the intersection of this Group and obj

    Parameters

    • obj: Group

      Group being intersected with

    Returns Group

  • Returns first candidate not less than given candidate, i.e. smallest candidate >= given candidate

    Returns

    first candidate not less than given candidate or -1 if no such candidate exists

    Parameters

    • candidate: string

      candidate

    Returns string

  • Parameters

    • candidate: number

    Returns number

  • Remove candidate from Group

    Returns

    true if candidate was removed, false if candidate wasn't in Group to begin with

    Parameters

    • candidate: string

      candidate

    Returns boolean

  • Remove candidate from Group

    Returns

    true if candidate was removed, false if candidate wasn't in Group to begin with

    Parameters

    • candidateIndex: number

      zero based index of candidate

    Returns boolean

  • Given a Group of candidates removes them from this Group

    Returns

    true if at least one of the candidates was removed, false if none of them were in Group to begin with

    Parameters

    • candidates: Group

      Group containing candidates to remove from this Group

    Returns boolean

  • Adds every possible subset to subsets

    Parameters

    • index: number

      index of candidate being decided upon addition to subsets

    • inSubset: Group

      stores candidates in current subset being computed

    • size: number

      number of elements to choose from in subset

    Returns void

  • Given a size returns array containing all subsets with that many candidates

    Returns

    array containg Groups with every possible subset of given size

    Parameters

    • select: number

      number of elements in desired subsets

    • size: number = SudokuEnum.ROW_LENGTH

      number of elements to choose from in subset, defaults to ROW_LENGTH

    Returns Group[]

  • Initializes subsets to have subarrays for each subset size 1-9 storing all subsets with that size

    Parameters

    • size: number

      number of elements to choose from in subset

    Returns void

  • Given an array of groups returns a Group that represents their union (contains every candidate any of them contains)

    Returns

    Group containing the union of the given groups (contains every candidate that any of them contain)

    Parameters

    • groups: Group[]

      Groups being unioned

    Returns Group

Generated using TypeDoc