Documentation
¶
Index ¶
- Variables
- func AlignTiles(ts []Tile) ([][]*Tile, error)
- func AlignTilesNaiv(ts []Tile) ([][]Tile, error)
- func ArrangeEdge(dim int, tiles []Tile)
- func FindMonster(img string)
- func FindTilesWithNoMatches(tiles []Tile)
- func TileIDs(tiles []Tile) []int
- type LinkedTile
- type MatchPosition
- type RotateDir
- type Tile
- func (t Tile) Col(ci int) []int
- func (t Tile) FirstCol() []int
- func (t Tile) FirstRow() []int
- func (t Tile) FlippedColumns() Tile
- func (t Tile) FlippedRows() Tile
- func (t Tile) ID() int
- func (t Tile) LastCol() []int
- func (t Tile) LastRow() []int
- func (t Tile) Match(ot Tile, exclude []MatchPosition) []MatchPosition
- func (t Tile) MatchAt(pos MatchPosition, ot Tile) bool
- func (t *Tile) MatchBottom(ot Tile) bool
- func (t *Tile) MatchLeft(ot Tile) bool
- func (t *Tile) MatchRight(ot Tile) bool
- func (t *Tile) MatchTop(ot Tile) bool
- func (t Tile) Rotated(dir RotateDir, rcnt int) Tile
- func (t Tile) Row(ri int) []int
- func (t Tile) String() string
- func (t Tile) Transformed(trans Transform) Tile
- type Transform
Constants ¶
This section is empty.
Variables ¶
View Source
var Image = `` /* 9321-byte string literal not displayed */
View Source
var ImageTest = `` /* 609-byte string literal not displayed */
View Source
var Monster = `
Tile 666:
..................#.
#....##....##....###
.#..#..#..#..#..#...
`
Functions ¶
func AlignTiles ¶
func AlignTilesNaiv ¶
func ArrangeEdge ¶
func FindMonster ¶
func FindMonster(img string)
func FindTilesWithNoMatches ¶
func FindTilesWithNoMatches(tiles []Tile)
Types ¶
type LinkedTile ¶
type LinkedTile struct { Tile Tile Left, Top, Right, Bottom *LinkedTile }
func (*LinkedTile) TryLink ¶
func (lt *LinkedTile) TryLink(t Tile) (*LinkedTile, bool)
type MatchPosition ¶
type MatchPosition string
const ( MatchNone MatchPosition = "none" MatchLeft MatchPosition = "left" MatchTop MatchPosition = "top" MatchRight MatchPosition = "right" MatchBottom MatchPosition = "bottom" )
func AllValidMatchPositions ¶
func AllValidMatchPositions() []MatchPosition
type Tile ¶
type Tile struct {
// contains filtered or unexported fields
}
func FindEdgeTiles ¶
func (Tile) FlippedColumns ¶
func (Tile) FlippedRows ¶
func (Tile) Match ¶
func (t Tile) Match(ot Tile, exclude []MatchPosition) []MatchPosition
func (*Tile) MatchBottom ¶
func (*Tile) MatchRight ¶
func (Tile) Transformed ¶
type Transform ¶
type Transform string
const ( TransformNone Transform = "none" TransformRotate90 Transform = "rotate-90" TransformRotate180 Transform = "rotate-180" TransformRotate270 Transform = "rotate-270" TransformFlipRows Transform = "flip-rows" TransformFlipCols Transform = "flip-cols" TransformFlipRowsRotate90 Transform = "flip-rows-rotate-90" TransformFlipRowsRotate180 Transform = "flip-rows-rotate-180" TransformFlipRowsRotate270 Transform = "flip-rows-rotate-270" TransformFlipColsRotate90 Transform = "flip-cols-rotate-90" TransformFlipColsRotate180 Transform = "flip-cols-rotate-180" TransformFlipColsRotate270 Transform = "flip-cols-rotate-270" )
func AllTransforms ¶
func AllTransforms() []Transform
Click to show internal directories.
Click to hide internal directories.