Documentation
¶
Index ¶
- func EdgeDual(a int) int
- func ReadLine(ch chan readinp.Line[string]) (string, error)
- type Map
- type Tile
- func (t Tile) EdgeMatches(e, val int) bool
- func (t *Tile) Flip()
- func (t Tile) Get(y, x int) bool
- func (t Tile) GetNeighbor(e int) int
- func (t Tile) HasNeighbor(e int) bool
- func (t Tile) ID() int
- func (t *Tile) MatchEdge(e, val int)
- func (t Tile) NumNeighbors() int
- func (t Tile) ReadEdge(e int) int
- func (t *Tile) Rotate(n int)
- func (t *Tile) SetNeighborFromEdgeMap(edgeMap map[int][]int)
- func (t Tile) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map is the structure of a set of tiles.
type Tile ¶
type Tile struct {
// contains filtered or unexported fields
}
Tile is a tile from day 20 of advent of code 2020.
func ParseLines ¶
ParseLines parses a number of lines to produce a single tile.
func (Tile) EdgeMatches ¶
EdgeMatches determines whether the edge matches the given value.
func (Tile) Get ¶
Get tells whether the given pixel is set, based on the contents of the tile and its rotation state.
func (Tile) GetNeighbor ¶
GetNeighbor returns the neighbor number on the given edge, after rotation/flip (0 if none)
func (Tile) HasNeighbor ¶
HasNeighbor returns whether there is a
func (*Tile) MatchEdge ¶
MatchEdge flips and rotates the tile until the given value is on the given edge.
func (Tile) NumNeighbors ¶
NumNeighbors returns the number of matched neighbors.
func (Tile) ReadEdge ¶
ReadEdge reads the binary value of the bits on the given edge. edges are: 0(top), 1(left), 2(bottom), 3(right)
func (*Tile) SetNeighborFromEdgeMap ¶
SetNeighborFromEdgeMap sets the neighbors from a collected map of edge value to matching tiles.