Most content of this article is machine-translated from README_CN.md using DeepSeek. :)
This project is a Tetris library implemented in Go, and also a playable Tetris game that runs in browsers (based on Wasm) or terminals.
Visit Tetris to start playing right away.
Install and run Tetris via one of the following methods:
Download Prebuilt Binary:
Download the executable binary from Releases, unzip it, and place the tetris file in any directory in your $PATH.
Then execute:
tetrisUse Docker:
docker run --rm --name tetris -it ghcr.io/yhlooo/tetris:latestBuild from Source:
# Download and build the source
go install github.com/yhlooo/go-tetris/cmd/tetris@latest
# Run
$(go env GOPATH)/bin/tetrisTerminal UI:
go run ./cmd/tetrisWeb UI:
GOOS=js GOARCH=wasm go build -o web/app.wasm ./cmd/tetris-wasm && go run ./cmd/tetris-wasmThen open http://localhost:8000 in your browser.
This project is not just a playable Tetris game, but also an easy-to-integrate Tetris library. You can use it to build your own Tetris game. Refer to the Tetris interface for API details.
Note: This package is still in its very early stage, and the interfaces may have BREAKING CHANGES.
- Randomizer
- 7-Bag
- Customizable
- Rotation System
- Super Rotation System (SRS)
- Customizable
- Scoring System
- Follow the Tetris Guidelines
- Soft Drop
- Hard Drop
- T-Spin
- T-Spin Single
- T-Spin Double
- T-Spin Triple
- Single Line Clear
- Double Line Clear
- Triple Line Clear
- Tetris
- Back-to-Back
- Customizable
- Follow the Tetris Guidelines
- Hold
- Piece preview
- Ghost piece
- Lock Down Delay
- Tetris Wiki: Provides detailed explanations of Tetris mechanics.
- rivo/tview: Provides powerful terminal-based UI components.
- maxence-charriere/go-app: Provides Web UI implementation via Wasm.

