Documentation ΒΆ
Index ΒΆ
Constants ΒΆ
This section is empty.
Variables ΒΆ
View Source
var ( // All TileSets bundled with the package. BundledTileSets = []TileSet{SSHTiles, GalaxyTiles} // Classic OpenSSH randomart tileset, using basic ASCII. SSHTiles = TileSet{ ID: "openssh", Runes: []rune{' ', '.', 'o', '+', '=', '*', 'B', 'O', 'X', '@', '%', '&', '#', '/', '^'}, Start: 'S', End: 'E', } // A spacey emoji based tileset. GalaxyTiles = TileSet{ ID: "galaxy", Runes: []rune{'π', 'π', 'π', 'π', 'π', 'πͺ', 'π', 'π', 'π'}, Start: 'π', End: 'π', } )
Functions ΒΆ
Types ΒΆ
type Board ΒΆ
type Board struct {
// contains filtered or unexported fields
}
func NewBoard ΒΆ
NewBoard initializes a Board of dimensions x, y with a starting position of the center point.
x 0βn, y 0βn.
func (*Board) Write ΒΆ
Write writes len(p) bytes to the underlying Board. The provided fingerprint will be used to explore the board using the drunken bishop algorithm.
Implements the io.Writer interface. The returned number of bytes will always equal len(fingerprint), and the error will always be nil
type TileSet ΒΆ
type TileSet struct { ID string // unique name Runes []rune Start rune // special rune for the starting position (optional) End rune // special rune for the ending position (optional) // If PreventRuneOverflow is true, the last value of Runes will be used for // any TileSet.Index(n) where n >= len(Runes). Otherwise, the default // behavior will be used which is to wrap around. PreventRuneOverflow bool }
Click to show internal directories.
Click to hide internal directories.