Go to file
MichaelS11 07a3313362 logger: Llongfile -> Lshortfile 2020-09-11 03:33:02 -07:00
colorTest logger: Llongfile -> Lshortfile 2020-09-11 03:33:02 -07:00
screenshots Added edit mode 2019-01-09 18:30:45 -08:00
LICENSE Go Tetris 2017-03-27 13:07:29 -07:00
README.md Added edit mode 2019-01-09 18:30:45 -08:00
ai.go Converted to tcell for terminal 2019-12-01 13:03:27 -08:00
ai_test.go Added heightEnds to AI 2019-01-14 16:11:46 -08:00
board.go logger: Llongfile -> Lshortfile 2020-09-11 03:33:02 -07:00
boards.go Converted to tcell for terminal 2019-12-01 13:03:27 -08:00
boards_test.go Added boards, including a heart :) 2018-02-14 12:57:02 -08:00
edit.go logger: Llongfile -> Lshortfile 2020-09-11 03:33:02 -07:00
engine.go Converted to tcell for terminal 2019-12-01 13:03:27 -08:00
engineKeyInput.go Converted to tcell for terminal 2019-12-01 13:03:27 -08:00
globals.go Converted to tcell for terminal 2019-12-01 13:03:27 -08:00
mino.go Converted to tcell for terminal 2019-12-01 13:03:27 -08:00
mino_test.go Converted to tcell for terminal 2019-12-01 13:03:27 -08:00
minos.go Converted to tcell for terminal 2019-12-01 13:03:27 -08:00
ranking.go Added comments 2018-10-02 18:21:08 -07:00
tetris.go logger: Llongfile -> Lshortfile 2020-09-11 03:33:02 -07:00
tetris_test.go logger: Llongfile -> Lshortfile 2020-09-11 03:33:02 -07:00
view.go Converted to tcell for terminal 2019-12-01 13:03:27 -08:00

README.md

Go Tetris

Golang Tetris for console window with optional AI

Features include

  • AI (use i key to toggle)
  • Lock delay
  • Next piece
  • Ghost piece
  • Top scores
  • Board choices
  • Edit boards

Compile

go get github.com/MichaelS11/go-tetris
go install github.com/MichaelS11/go-tetris

Play

Then run the binary created, go-tetris or go-tetris.exe

Keys start screen

Key Action
previous board
next board
spacebar start game
ctrl e edit board
q quit

Keys during game

Key Action
left move
right move
soft drop
hard drop
spacebar hard drop
z left rotate
x right rotate
p pause
q quit
i toggle AI

Keys edit mode

Key Action
move cursor left
move cursor right
move cursor down
move cursor up
z rotate left
x rotate right
c cyan block - I
b blue block - J
w white block - L
e yellow block - O
g green block - S
a magenta block - T
r red block - Z
f free block
ctrl b change board size
ctrl s save board
ctrl n save board as new
ctrl k delete board
ctrl o empty board
ctrl q quit edit mode

Screenshots

alt text

alt text

alt text

alt text

To do

  • Improve AI speed (slow on large boards)