Documentation
¶
Index ¶
- Constants
- Variables
- type CreateCommandRequest
- type GenericSlice
- func (slice GenericSlice[T]) All(predicate func(T) bool) bool
- func (slice GenericSlice[T]) Any(predicate func(T) bool) bool
- func (slice GenericSlice[T]) EqualContent(comparisionTarget GenericSlice[T]) bool
- func (slice GenericSlice[T]) FirstOrDefault(defaultValue T, predicate func(T) bool) T
- func (slice GenericSlice[T]) Intersect(comparisionTarget GenericSlice[T]) GenericSlice[T]
- func (slice GenericSlice[T]) Where(predicate func(T) bool) GenericSlice[T]
- type PromptSelectOption
- type Settings
- type SolveCommandRequest
- type SubSudoku
- type Sudoku
- type SudokuBox
- type SudokuBoxDTO
- type SudokuCell
- type SudokuCellDTO
- type SudokuConfigRequest
- type SudokuDTO
- type SudokuLayout
- type SudokuLayoutDTO
- type SudokuLine
- type SudokuResultType
- type SudokuValueGuess
Constants ¶
View Source
const SudokuLineTypeColumn = "column"
View Source
const SudokuLineTypeRow = "row"
Variables ¶
View Source
var TerminalStyles = styles{ DefaultStyle: lipgloss.NewStyle().Foreground(lipgloss.Color("#eeeeee")), PrimaryStyle: lipgloss.NewStyle().Foreground(lipgloss.Color("#7777ff")).Bold(true), SuccessStyle: lipgloss.NewStyle().Foreground(lipgloss.Color("#33ff33")), ErrorStyle: lipgloss.NewStyle().Foreground(lipgloss.Color("#ff3333")), BorderStyle: lipgloss.NewStyle().Foreground(lipgloss.Color("#444444")), DebugStyle: lipgloss.NewStyle().Foreground(lipgloss.Color("#ffd700")), }
Functions ¶
This section is empty.
Types ¶
type CreateCommandRequest ¶
type CreateCommandRequest struct {
SudokuConfigRequest
}
type GenericSlice ¶
type GenericSlice[T comparable] []T
func (GenericSlice[T]) All ¶
func (slice GenericSlice[T]) All(predicate func(T) bool) bool
func (GenericSlice[T]) Any ¶
func (slice GenericSlice[T]) Any(predicate func(T) bool) bool
func (GenericSlice[T]) EqualContent ¶
func (slice GenericSlice[T]) EqualContent(comparisionTarget GenericSlice[T]) bool
func (GenericSlice[T]) FirstOrDefault ¶
func (slice GenericSlice[T]) FirstOrDefault(defaultValue T, predicate func(T) bool) T
func (GenericSlice[T]) Intersect ¶
func (slice GenericSlice[T]) Intersect(comparisionTarget GenericSlice[T]) GenericSlice[T]
func (GenericSlice[T]) Where ¶
func (slice GenericSlice[T]) Where(predicate func(T) bool) GenericSlice[T]
type PromptSelectOption ¶
type PromptSelectOption struct {
Label string
Value interface{}
}
type Settings ¶
type Settings struct {
MinimumLayoutSizeInclusive int8
MaximumLayoutSizeInclusive int8
DefaultLayoutSize int8
MinimumBoxSizeInclusive int8
MaximumBoxSizeInclusive int8
DefaultBoxSize int8
SudokuPrintoutValuePaddingLength int8
UseDebugPrints bool
SilentConsolePrints bool
SudokuBinaryEncoderVersion uint16
}
type SolveCommandRequest ¶
type SolveCommandRequest struct {
SudokuConfigRequest
InputJsonFile *string
OutputFile *string
}
type SubSudoku ¶
type SubSudoku struct {
Id guid.UUID
Boxes GenericSlice[*SudokuBox]
TopLeftBoxRowIndex int8
TopLeftBoxColumnIndex int8
ChildLines GenericSlice[*SudokuLine]
}
type Sudoku ¶
type Sudoku struct {
BoxSize int8
Layout SudokuLayout
Boxes GenericSlice[*SudokuBox]
SubSudokus GenericSlice[*SubSudoku]
Result SudokuResultType
}
func (*Sudoku) ToSudokuDto ¶
ToSudoku converts internal sudoku object to DTO object. Suitable for serialization to json
type SudokuBox ¶
type SudokuBox struct {
Id guid.UUID
Disabled bool
IndexRow int8
IndexColumn int8
Cells GenericSlice[*SudokuCell]
ViolatesRule bool
}
type SudokuBoxDTO ¶
type SudokuBoxDTO struct {
Disabled bool `json:"disabled"`
IndexRow int8 `json:"indexRow"`
IndexColumn int8 `json:"indexColumn"`
Cells GenericSlice[*SudokuCellDTO] `json:"cells"`
}
type SudokuCell ¶
type SudokuCell struct {
Id guid.UUID
Value *int
IsInputValue bool
PotentialValues *GenericSlice[int]
IndexRowInBox int8
IndexColumnInBox int8
Box *SudokuBox
MemberOfLines GenericSlice[*SudokuLine]
}
func (*SudokuCell) HasViolationError ¶
func (cell *SudokuCell) HasViolationError() bool
type SudokuCellDTO ¶
type SudokuConfigRequest ¶
type SudokuConfigRequest struct {
BoxSize *int8
LayoutWidth *int8
LayoutHeight *int8
Overwrite bool
}
func (*SudokuConfigRequest) AsConfigRequest ¶
func (r *SudokuConfigRequest) AsConfigRequest() *SudokuConfigRequest
type SudokuDTO ¶
type SudokuDTO struct {
BoxSize int8 `json:"boxSize"`
Layout SudokuLayoutDTO `json:"layout"`
Boxes GenericSlice[*SudokuBoxDTO] `json:"boxes"`
}
type SudokuLayout ¶
type SudokuLayoutDTO ¶
type SudokuLine ¶
type SudokuLine struct {
Cells GenericSlice[*SudokuCell]
LineType string
ViolatesRule bool
SubsudokuId guid.UUID
}
type SudokuResultType ¶
type SudokuResultType int8
const ( Unspecified SudokuResultType = 0 SuccessfullSolution SudokuResultType = 1 Failure SudokuResultType = 2 InvalidGuess SudokuResultType = 3 UnsolvableSudoku SudokuResultType = 4 )
type SudokuValueGuess ¶
Click to show internal directories.
Click to hide internal directories.