Documentation ¶
Index ¶
- Constants
- func CartesianProduct(movesA [][]SnakeMove, movesB []SnakeMove) [][]SnakeMove
- type BitBoard
- func (bb *BitBoard) AdvanceTurn(moves []SnakeMove)
- func (bb *BitBoard) Clone() *BitBoard
- func (bb *BitBoard) GetCartesianProductOfMoves() [][]SnakeMove
- func (bb *BitBoard) GetLastSnakeMoveFromExternal(snake api.Battlesnake) Dir
- func (bb *BitBoard) GetMoves(snakeId string) []SnakeMove
- func (bb *BitBoard) GetOpponents() []*snake
- func (bb *BitBoard) GetSnake(id string) *snake
- func (bb *BitBoard) GetZobristKey(zh ZobristTable) Key
- func (bb *BitBoard) InitializeZobristTable() ZobristTable
- func (bb *BitBoard) IsEqual(board *BitBoard) bool
- func (bb *BitBoard) IsGameOver() bool
- func (bb *BitBoard) IsIndexFood(i int) bool
- func (bb *BitBoard) IsIndexHazard(i int) bool
- func (bb *BitBoard) IsIndexOccupied(i int) bool
- func (bb *BitBoard) Print()
- func (bb *BitBoard) RandomPlayout(length int, rand *rand.Rand)
- func (bb *BitBoard) SpawnFood()
- func (bb *BitBoard) SpawnHazardsRoyale()
- func (bb *BitBoard) Update(new *BitBoard)
- type Dir
- type Key
- type SnakeMove
- type ZobristTable
Constants ¶
View Source
const ( Left Dir = "left" Right = "right" Up = "up" Down = "down" )
Variables ¶
This section is empty.
Functions ¶
func CartesianProduct ¶
Types ¶
type BitBoard ¶
type BitBoard struct { // I need to makes Snakes a map so that I can remove snakes when they die. // Currently, removing a snake from the array could cause the ids of other snakes to change, since it's an array. // By converting to a map, I can just use the ID from the API // This way, when a snake dies and the API does not send that snake in the request, the state will match up with what I have in my tree since it is also being removed Snakes map[string]*snake // contains filtered or unexported fields }
func CreateBitBoard ¶
func (*BitBoard) AdvanceTurn ¶
func (*BitBoard) GetCartesianProductOfMoves ¶
func (*BitBoard) GetLastSnakeMoveFromExternal ¶
func (bb *BitBoard) GetLastSnakeMoveFromExternal(snake api.Battlesnake) Dir
func (*BitBoard) GetOpponents ¶
func (bb *BitBoard) GetOpponents() []*snake
func (*BitBoard) GetZobristKey ¶
func (bb *BitBoard) GetZobristKey(zh ZobristTable) Key
func (*BitBoard) InitializeZobristTable ¶
func (bb *BitBoard) InitializeZobristTable() ZobristTable
func (*BitBoard) IsGameOver ¶
func (*BitBoard) IsIndexFood ¶
func (*BitBoard) IsIndexHazard ¶
func (*BitBoard) IsIndexOccupied ¶
func (*BitBoard) SpawnHazardsRoyale ¶
func (bb *BitBoard) SpawnHazardsRoyale()
type ZobristTable ¶
type ZobristTable [][]Key
Click to show internal directories.
Click to hide internal directories.