Documentation ¶
Index ¶
- func Blink(stones []string) []string
- func Display(reports []Report, verbose bool)
- func FindAllPaths(goalNode *Node, optimalScore int, costMap map[P]int) [][]P
- func GenerateStones(data string) int
- func GetDays() map[string][]string
- func GetInt(str string) int
- func GetInt64(str string) int64
- func GetKey(x int, y int) string
- func GetPlayerRune(c CellType) rune
- func GetSeq(a, b, c, d int) string
- func GetTileKey(x int, y int) string
- func Heuristic(a, b P) int
- func IsValid(grid [][]int, p P) bool
- func MD5(in string) string
- func MakeGrid(data []string) ([][]int, P, P)
- func NumCache(n string) int
- func PKey(x int, y int, d int) string
- func PrepareDataA(lines []string) ([]*OpTree, []*OpTree)
- func PrepareDataB(lines []string) ([]*OpTree, []*OpTree)
- func PrintDebug(title string, debug []string)
- func PrintError(err error)
- func ReadFile(path string) (string, error)
- func ReadLines(path string) ([]string, error)
- func Reverse(s string) (result string)
- func Run(days []string, verbose bool, test bool, runAll bool, input string)
- func RunAStarTest(data []string) int
- func Solve12(data []string, verbose bool, price2 bool) int
- func StrCache(i int) string
- func Stringify(path []OutNode) string
- func TestAlternates(data []string, pathKey string) int
- func UNUSED(x ...interface{})
- type Antenna
- type AntiNode
- type Arcade
- type ArcadeButton
- type ArcadePrize
- type Bathroom
- type Block
- type BlockStore
- type Bounds
- type Box
- type Cell
- type CellType
- type Coords
- type Direction
- type Failure
- type Game
- type GameState
- type Garden
- type Island
- type KeyPad
- type LL
- type LanternStones
- type Lexer
- type Line
- type Lines
- type Map2D
- type Net
- type NetSet
- func (n *NetSet) Add(val string)
- func (n *NetSet) Contains(val string) bool
- func (n *NetSet) Intersection(other *NetSet) *NetSet
- func (n *NetSet) List() []string
- func (n *NetSet) Remove(val string)
- func (n *NetSet) Size() int
- func (n *NetSet) String() string
- func (n *NetSet) Union(other *NetSet) *NetSet
- type Node
- type Op
- type OpTree
- type OptionFunc
- type OutNode
- type P
- type Page
- type PathCell
- type Plant
- type Player
- func (p *Player) CanMove(g *Game) bool
- func (p *Player) EndTrapTest(g *Game)
- func (p *Player) GetRune() rune
- func (p *Player) Leave(g *Game) bool
- func (p *Player) Looping(g *Game) bool
- func (p *Player) Move(g *Game)
- func (p *Player) Obstructed(g *Game) bool
- func (p *Player) ObstructionRight(g *Game) bool
- func (p *Player) SetDirection(r rune) Direction
- func (p *Player) TrapSuccess(g *Game)
- func (p *Player) TrapUpdate(g *Game)
- func (p *Player) Turn(g *Game)
- func (p *Player) Update(g *Game)
- func (p *Player) Win(g *Game)
- type Plot
- func (p *Plot) BoundType(sx int, sy int) string
- func (p *Plot) CollectNeighbors(pl *Plant, g *Garden)
- func (p *Plot) CreatePerim(g *Garden)
- func (p *Plot) GenerateBed(x int, y int, g *Garden)
- func (p *Plot) InnerPerim() int
- func (p *Plot) OuterPerim() int
- func (p *Plot) RenderPlant(plant *Plant, c map[string]string)
- func (p *Plot) Sides() int
- func (p *Plot) StoreBounds(pl *Plant)
- type PriQueue
- type Processor
- type Report
- func BlankDay(day string, verbose bool, test bool, input string) Report
- func Day10a(verbose bool, test bool, input string) Report
- func Day10b(verbose bool, test bool, input string) Report
- func Day11(day string, blink int, verbose bool, test bool, input string) Report
- func Day11a(verbose bool, test bool, input string) Report
- func Day11b(verbose bool, test bool, input string) Report
- func Day11c(verbose bool, test bool, input string) Report
- func Day12a(verbose bool, test bool, input string) Report
- func Day12b(verbose bool, test bool, input string) Report
- func Day13a(verbose bool, test bool, input string) Report
- func Day13b(verbose bool, test bool, input string) Report
- func Day14a(verbose bool, test bool, input string) Report
- func Day15a(verbose bool, test bool, input string) Report
- func Day15b(verbose bool, test bool, input string) Report
- func Day16a(verbose bool, test bool, input string) Report
- func Day16b(verbose bool, test bool, input string) Report
- func Day17a(verbose bool, test bool, input string) Report
- func Day17b(verbose bool, test bool, input string) Report
- func Day18a(verbose bool, test bool, input string) Report
- func Day18b(verbose bool, test bool, input string) Report
- func Day19a(verbose bool, test bool, input string) Report
- func Day19b(verbose bool, test bool, input string) Report
- func Day1a(verbose bool, test bool, input string) Report
- func Day1b(verbose bool, test bool, input string) Report
- func Day20a(verbose bool, test bool, input string) Report
- func Day20b(verbose bool, test bool, input string) Report
- func Day21a(verbose bool, test bool, input string) Report
- func Day21b(verbose bool, test bool, input string) Report
- func Day22a(verbose bool, test bool, input string) Report
- func Day22b(verbose bool, test bool, input string) Report
- func Day23a(verbose bool, test bool, input string) Report
- func Day23b(verbose bool, test bool, input string) Report
- func Day2a(verbose bool, test bool, input string) Report
- func Day2b(verbose bool, test bool, input string) Report
- func Day3a(verbose bool, test bool, input string) Report
- func Day3b(verbose bool, test bool, input string) Report
- func Day4a(verbose bool, test bool, input string) Report
- func Day4b(verbose bool, test bool, input string) Report
- func Day5a(verbose bool, test bool, input string) Report
- func Day5b(verbose bool, test bool, input string) Report
- func Day6a(verbose bool, test bool, input string) Report
- func Day6b(verbose bool, test bool, input string) Report
- func Day7a(verbose bool, test bool, input string) Report
- func Day7b(verbose bool, test bool, input string) Report
- func Day8a(verbose bool, test bool, input string) Report
- func Day8b(verbose bool, test bool, input string) Report
- func Day9a(verbose bool, test bool, input string) Report
- func Day9b(verbose bool, test bool, input string) Report
- type Robot
- type RoutePath
- type RuleSet
- type SCell
- type SRobot
- type SeqDelta
- type Sokoban
- func (s *Sokoban) CanMoveY(blockCell *SCell, dir [2]int) bool
- func (s *Sokoban) Current() []*SCell
- func (s *Sokoban) GetNext(x int, y int, dir [2]int) *SCell
- func (s *Sokoban) Load(data []string)
- func (s *Sokoban) Move(dir [2]int)
- func (s *Sokoban) MoveBlockY(blockCell *SCell, dir [2]int) bool
- func (s *Sokoban) MoveBlocks(blockCell *SCell, dir [2]int) bool
- func (s *Sokoban) Render()
- func (s *Sokoban) Tick() bool
- type ThreeBit
- type Tile
- type TileType
- type Token
- type TokenType
- type Trail
- type TrailHead
- type Update
- type Velocity
- type Wall
- type World
- type WorldD
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateStones ¶
func GetPlayerRune ¶
func GetTileKey ¶
func PrepareDataA ¶
func PrepareDataB ¶
func PrintDebug ¶
func PrintError ¶
func PrintError(err error)
func RunAStarTest ¶
func TestAlternates ¶
Types ¶
type Arcade ¶
type Arcade struct {
// contains filtered or unexported fields
}
func CreateArcade ¶
func (*Arcade) FindIntersection ¶
func (a *Arcade) FindIntersection(verbose bool) (*ArcadeButton, bool)
FindIntersection finds the intersection point of two vectors or returns false if they do not intersect
type ArcadeButton ¶
type ArcadeButton struct {
// contains filtered or unexported fields
}
func MakeButton ¶
func MakeButton(line string) *ArcadeButton
type ArcadePrize ¶
type ArcadePrize struct {
// contains filtered or unexported fields
}
func MakePrize ¶
func MakePrize(line string, add int64) *ArcadePrize
type Bathroom ¶
type Bathroom struct {
// contains filtered or unexported fields
}
func (*Bathroom) UpdateBack ¶
func (b *Bathroom) UpdateBack()
func (*Bathroom) WaitForTick ¶
func (b *Bathroom) WaitForTick()
type BlockStore ¶
type BlockStore struct {
// contains filtered or unexported fields
}
func ReadDisk ¶
func ReadDisk(data string) *BlockStore
func (*BlockStore) CheckSum ¶
func (b *BlockStore) CheckSum(report *Report) int
func (*BlockStore) Compress ¶
func (b *BlockStore) Compress(verbose bool)
func (*BlockStore) Compress2 ¶
func (b *BlockStore) Compress2(verbose bool)
type CellType ¶
type CellType string
const ( OPEN CellType = "OPEN" TOP_BOT CellType = "TOP_BOT" WALL CellType = "WALL" CORNER CellType = "CORNER" PLAYER_U CellType = "PLAYER_U" PLAYER_D CellType = "PLAYER_D" PLAYER_L CellType = "PLAYER_L" PLAYER_R CellType = "PLAYER_R" OBSTRUCTION CellType = "OBSTRUCTION" TEST_TRAP CellType = "TEST_TRAP" FOUND_TRAP CellType = "FOUND_TRAP" EXIT CellType = "EXIT" ERROR CellType = "ERROR" UNKNOWN CellType = "UNKNOWN" )
func GetCellType ¶
func GetPlayerCellType ¶
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func (*Game) SkipDuplicates ¶
func (*Game) TrapUpdate ¶
func (g *Game) TrapUpdate()
type Garden ¶
type Garden struct {
// contains filtered or unexported fields
}
func CreateGarden ¶
func (*Garden) CreatePlots ¶
func (g *Garden) CreatePlots()
type Island ¶
type Island struct {
// contains filtered or unexported fields
}
func GenerateIsland ¶
func (*Island) GeneratePaths ¶
func (i *Island) GeneratePaths()
func (*Island) ScoreTrails ¶
type LanternStones ¶
type LanternStones struct {
// contains filtered or unexported fields
}
type NetSet ¶
type NetSet struct {
// contains filtered or unexported fields
}
func (*NetSet) Intersection ¶
type OpTree ¶
type OpTree struct { Parent *OpTree Expected int Multiply *OpTree MultiplyValid bool Concat *OpTree ConcatValid bool Add *OpTree AddValid bool Value int Valid bool }
func MakeOpTree ¶
type OptionFunc ¶
type OptionFunc struct {
MaxDepth int
}
type PathCell ¶
type PathCell struct {
// contains filtered or unexported fields
}
func (*PathCell) GetNeighbors ¶
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
func (*Player) EndTrapTest ¶
func (*Player) Obstructed ¶
func (*Player) ObstructionRight ¶
func (*Player) SetDirection ¶
func (*Player) TrapSuccess ¶
func (*Player) TrapUpdate ¶
type Plot ¶
type Plot struct {
// contains filtered or unexported fields
}
func (*Plot) CollectNeighbors ¶
func (*Plot) CreatePerim ¶
func (*Plot) InnerPerim ¶
func (*Plot) OuterPerim ¶
func (*Plot) StoreBounds ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor() *Processor
func (*Processor) CreateRules ¶
func (*Processor) CreateUpdates ¶
type Report ¶
type Report struct {
// contains filtered or unexported fields
}
type RuleSet ¶
type RuleSet struct {
// contains filtered or unexported fields
}
func NewRuleSet ¶
func NewRuleSet() *RuleSet
type Sokoban ¶
type Sokoban struct {
// contains filtered or unexported fields
}
func (*Sokoban) GetNext ¶
func (s *Sokoban) CastToEmpty(xL int, xR, y int, dir [2]int) *SCell { cells := s.Current() nxL := dir[0] + xL nxR := dir[0] + xR if nxL < 0 || ny < 0 || ny >= s.height || nxR > s.width*s.cellw { return &SCell{invalid: true} } cellL := cells[nxL+(ny*s.cellw*s.width)] cellR := cells[nxR+(ny*s.cellw*s.width)] }
type ThreeBit ¶
type ThreeBit struct {
// contains filtered or unexported fields
}
func (*ThreeBit) ReadProgram ¶
type TrailHead ¶
type TrailHead struct {
// contains filtered or unexported fields
}
func (*TrailHead) BuildTrails ¶
type Update ¶
type Update struct {
// contains filtered or unexported fields
}
type WorldD ¶
type WorldD struct {
// contains filtered or unexported fields
}
func (*WorldD) GenerateAntennaNetwork ¶
func (*WorldD) GenerateAntiNodes ¶
func (*WorldD) GenerateNetwork ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.