Documentation ¶
Index ¶
- type AutoPlayer
- type Canvas
- func (c *Canvas) At(p point.Point2D) int
- func (c *Canvas) Count() int
- func (c *Canvas) CountColor(color int) int
- func (c *Canvas) Draw(drawFn func(int, int, int))
- func (c *Canvas) Height() int
- func (c *Canvas) Paint(p point.Point2D, color int)
- func (c *Canvas) PrintTo(w io.Writer)
- func (c *Canvas) Width() int
- type Game
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoPlayer ¶
type AutoPlayer struct {
// contains filtered or unexported fields
}
AutoPlayer will automatically move the joystick perfectly.
func NewAutoPlayer ¶
func NewAutoPlayer(g *Game) *AutoPlayer
NewAutoPlayer creates a new autoplayer.
func (*AutoPlayer) HandleInput ¶
func (ap *AutoPlayer) HandleInput() int
HandleInput gives the correct way to move the joystick based on the current game state. Use this with SetInputFunc on the game's VM.
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
Canvas is an infinitely paintable 2D surface.
func (*Canvas) CountColor ¶
CountColor returns the number of points painted with the given color.
func (*Canvas) Draw ¶
Draw calls the provided drawFn for every square on the canvas, regardless of whether it has been painted to.
func (*Canvas) Paint ¶
Paint paints a point with a color, extending the bounds of the canvas if needed.
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
Game plays a game controlled by an Intcode program
Click to show internal directories.
Click to hide internal directories.