Documentation
¶
Index ¶
- Variables
- func EncodedSize(n, m int) int
- type FillPattern
- type Nonogram
- func (n *Nonogram) Clear(i, j int)
- func (n *Nonogram) Fill(i, j int)
- func (n *Nonogram) FillPatterns() (FillPattern, FillPattern)
- func (n *Nonogram) Get(i, j int) bool
- func (n *Nonogram) PrettyString() string
- func (n *Nonogram) PrettyStringCaged(cage int) string
- func (n *Nonogram) String() string
- func (n *Nonogram) StringCaged(cage int) string
- type Solver
- func (s *Solver) PrettyString() string
- func (s *Solver) PrettyStringCaged(cage int) string
- func (s *Solver) SavePNG(name string, scale int) error
- func (s *Solver) Solve(rows FillPattern, columns FillPattern) error
- func (s *Solver) String() string
- func (s *Solver) StringCaged(cage int) string
- func (s *Solver) ToNonogram() *Nonogram
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCanNotSolve = errors.New("can not solve this puzzle completely")
View Source
var ErrContradiction = errors.New("found contradiction")
View Source
var ErrInvalidGrid = errors.New("grid has less/more data than needed")
View Source
var ErrInvalidSize = errors.New("nonogram has invalid size")
View Source
var ErrNilPattern = errors.New("called solve with nil pattern")
Functions ¶
func EncodedSize ¶
Types ¶
type FillPattern ¶
type FillPattern [][]int
FillPattern is a numbers written at the edge of puzzle. These numbers show the len of unbroken lines of filled-in squares there are in any given row or column. There are at least one blank square between filled-in lines.
22
09922440
┌────────┐
0│........│
4│.####...│
6│.######.│
6│.######.│
2 2│.##..##.│
2 2│.##..##.│
4│.####...│
2│.##.....│
2│.##.....│
2│.##.....│
0│........│
└────────┘
type Nonogram ¶
type Nonogram struct {
// contains filtered or unexported fields
}
func (*Nonogram) FillPatterns ¶
func (n *Nonogram) FillPatterns() (FillPattern, FillPattern)
return rows and columns FillPattern respectively
func (*Nonogram) PrettyString ¶
func (*Nonogram) PrettyStringCaged ¶
func (*Nonogram) StringCaged ¶
type Solver ¶
type Solver struct {
// contains filtered or unexported fields
}
func (*Solver) PrettyString ¶
func (*Solver) PrettyStringCaged ¶
func (*Solver) SavePNG ¶
When solver saves png, it paints cells in black if it's Filled, in white if it's Blank and in red if it's Unknown
func (*Solver) Solve ¶
func (s *Solver) Solve(rows FillPattern, columns FillPattern) error
func (*Solver) StringCaged ¶
func (*Solver) ToNonogram ¶
Click to show internal directories.
Click to hide internal directories.