Documentation
¶
Index ¶
- type BoxRule
- type Cell
- type ColumnRule
- type Corner
- type DiagonalRule
- type RowRule
- type Rule
- type Sudoku
- func (s *Sudoku) AddRule(rule Rule)
- func (s *Sudoku) CheckRules() (bool, error)
- func (s *Sudoku) GetBoxNotation(row, col int) (map[int]bool, error)
- func (s *Sudoku) GetCellNotation(row, col int) (map[int]bool, error)
- func (s *Sudoku) GetGiven(row, col int) (bool, error)
- func (s *Sudoku) GetValue(row, col int) (int, error)
- func (s *Sudoku) IsFull() (bool, error)
- func (s *Sudoku) SetGiven(row, col, value int) error
- func (s *Sudoku) SetSudoku(grid [9][9]int) error
- func (s *Sudoku) SetValue(row, col, value int) error
- func (s *Sudoku) ToggleBoxNotation(row, col, value int) error
- func (s *Sudoku) ToggleCellNotation(row, col, value int) error
- type SumRule
- type ThermoRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoxRule ¶
type BoxRule struct {
// contains filtered or unexported fields
}
type ColumnRule ¶
type ColumnRule struct {
// contains filtered or unexported fields
}
func NewColumnRule ¶
func NewColumnRule(col int) (*ColumnRule, error)
NewColumnRule : Create a new ColumnRule
func (*ColumnRule) Check ¶
func (r *ColumnRule) Check(sudoku *Sudoku) (bool, error)
Check : Check if column n rule is broken
func (*ColumnRule) GetColumn ¶
func (c *ColumnRule) GetColumn() int
type DiagonalRule ¶
type DiagonalRule struct {
// contains filtered or unexported fields
}
func NewDiagonalRule ¶
func NewDiagonalRule(startingCorner Corner) (*DiagonalRule, error)
NewDiagonalRule : Create a new DiagonalRule
func (*DiagonalRule) Check ¶
func (r *DiagonalRule) Check(sudoku *Sudoku) (bool, error)
Check : Check if column n rule is broken
func (*DiagonalRule) GetStartingCorner ¶
func (d *DiagonalRule) GetStartingCorner() Corner
type RowRule ¶
type RowRule struct {
// contains filtered or unexported fields
}
type Sudoku ¶
type Sudoku struct {
// contains filtered or unexported fields
}
func (*Sudoku) CheckRules ¶
CheckRules : Check all rules
func (*Sudoku) GetBoxNotation ¶
GetBoxNotation : Get the box notations for the specified cell
func (*Sudoku) GetCellNotation ¶
GetCellNotation : Get the cell notations for the specified cell
func (*Sudoku) SetValue ¶
SetValue : Sets the value of the cell in the specified row and column to the specified value
func (*Sudoku) ToggleBoxNotation ¶
ToggleBoxNotation : Toggle the box notation for the specified cell for value
func (*Sudoku) ToggleCellNotation ¶
ToggleCellNotation : Toggle the cell notation for the specified cell for value
type SumRule ¶
type SumRule struct {
// contains filtered or unexported fields
}
func NewSumRule ¶
func NewSumRule(sum int, cells []Cell, digitsCanRepeat bool, backgroundColor color.Color) (*SumRule, error)
NewSumRule : Create a new SumRule
func (*SumRule) GetBackgroundColor ¶
func (*SumRule) GetDigitsCanRepeat ¶
type ThermoRule ¶
type ThermoRule struct {
// contains filtered or unexported fields
}
func NewThermoRule ¶
func NewThermoRule(cells []Cell, increasing, strict bool, backgroundColor color.Color, thermoColor color.Color) (*ThermoRule, error)
NewThermoRule : Create a new ThermoRule
func (*ThermoRule) GetBackgroundColor ¶
func (t *ThermoRule) GetBackgroundColor() color.Color
func (*ThermoRule) GetCells ¶
func (t *ThermoRule) GetCells() []Cell
func (*ThermoRule) GetIncreasing ¶
func (t *ThermoRule) GetIncreasing() bool
func (*ThermoRule) GetStrict ¶
func (t *ThermoRule) GetStrict() bool
func (*ThermoRule) GetThermoColor ¶
func (t *ThermoRule) GetThermoColor() color.Color