Documentation ¶
Index ¶
- func ParseTiles(groups [][]string) (map[int]Tile, error)
- func Part1(p *Picture) int
- func Part2(p *Picture) (int, error)
- type BFSNode
- type Noncer
- type Picture
- func (p Picture) Clone() Picture
- func (p Picture) Fits(t Tile, pos advent2020.XY) bool
- func (p Picture) ImageString(includeBorders bool) string
- func (p Picture) InBounds(pos advent2020.XY) bool
- func (p Picture) NextEmptySquare() *advent2020.XY
- func (p Picture) Place(t Tile, tileID int, pos advent2020.XY) Picture
- func (p Picture) String() string
- func (p Picture) TileAt(pos advent2020.XY) Tile
- type Tile
- func (t Tile) BottomSideMatchesTopOf(neighbour Tile) bool
- func (t Tile) Flip() Tile
- func (t Tile) HaveMonsterAt(y, x int) bool
- func (t Tile) Permutations() []Tile
- func (t Tile) ReplaceMonsterAt(y, x int)
- func (t Tile) ReplaceSeaMonsters() bool
- func (t Tile) RightSideMatchesLeftOf(neighbour Tile) bool
- func (t Tile) RotateLeft() Tile
- func (t Tile) RotatePermutations() []Tile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BFSNode ¶
type BFSNode struct {
// contains filtered or unexported fields
}
type Picture ¶
type Picture struct {
// contains filtered or unexported fields
}
func NewPicture ¶
func (Picture) ImageString ¶
func (Picture) NextEmptySquare ¶
func (p Picture) NextEmptySquare() *advent2020.XY
We fill in the picture from left to right, top to bottom. Moving in this direction, NextEmptySquare returns the position of the next square to be filled, or nil if it is already full.
type Tile ¶
type Tile [][]byte
func (Tile) BottomSideMatchesTopOf ¶
func (Tile) HaveMonsterAt ¶
func (Tile) Permutations ¶
func (Tile) ReplaceMonsterAt ¶
func (Tile) ReplaceSeaMonsters ¶
func (Tile) RightSideMatchesLeftOf ¶
func (Tile) RotateLeft ¶
func (Tile) RotatePermutations ¶
Click to show internal directories.
Click to hide internal directories.