board

package
v0.0.0-...-929537b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2017 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	X = 4
	Y = 4
)

Board size

View Source
const (
	LEFT  = iota
	UP    = iota
	RIGHT = iota
	DOWN  = iota
)

Direction

Variables

View Source
var (
	DIRECTIONS = map[int]int{
		LEFT:  -1,
		UP:    -1,
		RIGHT: 1,
		DOWN:  1,
	}
)

Functions

This section is empty.

Types

type Board

type Board struct {
	Cells [][]int
	// contains filtered or unexported fields
}

func New

func New() Board

func (*Board) AddTile

func (b *Board) AddTile()

func (*Board) IsFull

func (b *Board) IsFull() bool

func (*Board) Move

func (b *Board) Move(d Direction)

Move board in a given direction

func (*Board) Playable

func (b *Board) Playable() bool

func (*Board) Values

func (b *Board) Values() []int

type Direction

type Direction int32

Direction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL