Documentation ¶
Index ¶
- Variables
- type Block
- type Blocks
- type Command
- type Draw
- type Tetris
- func (t *Tetris) Continue()
- func (t *Tetris) DownMove()
- func (t *Tetris) Drop()
- func (t *Tetris) Get(x, y int) string
- func (t *Tetris) IsGameOver() bool
- func (t *Tetris) IsPause() bool
- func (t *Tetris) LeftMove()
- func (t *Tetris) LeftRotate()
- func (t *Tetris) On(x, y int) int
- func (t *Tetris) Pause()
- func (t *Tetris) RightMove()
- func (t *Tetris) RightRotate()
- func (t *Tetris) Run(ctx context.Context, cch <-chan Command) (err error)
- func (t *Tetris) Set(x, y int, currentColor string)
Constants ¶
This section is empty.
Variables ¶
View Source
var BlocksPool = [...]Blocks{ { Blocks: []Block{ 0b_0000_1111_0000_0000, 0b_0010_0010_0010_0010, 0b_0000_0000_1111_0000, 0b_0100_0100_0100_0100, }, Color: ctc.BackgroundBright.String() + blockRune + ctc.Reset.String(), Predict: ctc.ForegroundBright.String() + predictRune + ctc.Reset.String(), }, { Blocks: []Block{ 0b_0000_1100_0110_0000, 0b_0000_0010_0110_0100, 0b_0000_0000_1100_0110, 0b_0000_0100_1100_1000, }, Color: ctc.BackgroundRed.String() + blockRune + ctc.Reset.String(), Predict: ctc.ForegroundRed.String() + predictRune + ctc.Reset.String(), }, { Blocks: []Block{ 0b_0000_0110_1100_0000, 0b_0000_0100_0110_0010, 0b_0000_0000_0110_1100, 0b_0000_1000_1100_0100, }, Color: ctc.BackgroundGreen.String() + blockRune + ctc.Reset.String(), Predict: ctc.ForegroundGreen.String() + predictRune + ctc.Reset.String(), }, { Blocks: []Block{ 0b_0000_1000_1110_0000, 0b_0000_0110_0100_0100, 0b_0000_0000_1110_0010, 0b_0000_0100_0100_1100, }, Color: ctc.BackgroundBlue.String() + blockRune + ctc.Reset.String(), Predict: ctc.ForegroundBlue.String() + predictRune + ctc.Reset.String(), }, { Blocks: []Block{ 0b_0000_0010_1110_0000, 0b_0000_0100_0100_0110, 0b_0000_0000_1110_1000, 0b_0000_1100_0100_0100, }, Color: ctc.BackgroundCyan.String() + blockRune + ctc.Reset.String(), Predict: ctc.ForegroundCyan.String() + predictRune + ctc.Reset.String(), }, { Blocks: []Block{ 0b_0000_0100_1110_0000, 0b_0000_0100_0110_0100, 0b_0000_0000_1110_0100, 0b_0000_0100_1100_0100, }, Color: ctc.BackgroundMagenta.String() + blockRune + ctc.Reset.String(), Predict: ctc.ForegroundMagenta.String() + predictRune + ctc.Reset.String(), }, { Blocks: []Block{ 0b_0000_0110_0110_0000, }, Color: ctc.BackgroundYellow.String() + blockRune + ctc.Reset.String(), Predict: ctc.ForegroundYellow.String() + predictRune + ctc.Reset.String(), }, }
Functions ¶
This section is empty.
Types ¶
type Tetris ¶
type Tetris struct {
// contains filtered or unexported fields
}
func (*Tetris) IsGameOver ¶
func (*Tetris) LeftRotate ¶
func (t *Tetris) LeftRotate()
func (*Tetris) RightRotate ¶
func (t *Tetris) RightRotate()
Click to show internal directories.
Click to hide internal directories.