Documentation ¶
Index ¶
- type Game2048
- func (g *Game2048) AddRandom()
- func (g *Game2048) GenerateImage(name string, srcDir string)
- func (g *Game2048) MoveDOWN()
- func (g *Game2048) MoveLEFT()
- func (g *Game2048) MoveRIGHT()
- func (g *Game2048) MoveUP()
- func (g *Game2048) Print()
- func (g *Game2048) ValidateDOWN() bool
- func (g *Game2048) ValidateLEFT() bool
- func (g *Game2048) ValidateRIGHT() bool
- func (g *Game2048) ValidateUP() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Game2048 ¶
Game2048 the main struct for the library
func NewGame2048 ¶
NewGame2048 is the constructor of the Game2048, returns a pointer to Game2048 instance
func (*Game2048) AddRandom ¶
func (g *Game2048) AddRandom()
AddRandom adds a 2 or 4 on a space in the matrix randomly
func (*Game2048) GenerateImage ¶
GenerateImage generates a image of the actual state
func (*Game2048) MoveRIGHT ¶
func (g *Game2048) MoveRIGHT()
MoveRIGHT moves right all possible cells
func (*Game2048) ValidateDOWN ¶
ValidateDOWN checks if can move down
func (*Game2048) ValidateLEFT ¶
ValidateLEFT checks if can move left
func (*Game2048) ValidateRIGHT ¶
ValidateRIGHT checks if can move right
Click to show internal directories.
Click to hide internal directories.