https://github.com/alwedo/tetris
Play Tetris from the comfort of your terminal!
https://github.com/alwedo/tetris
go golang grpc grpc-go terminal terminal-based terminal-game tetris tetris-game tetris-go
Last synced: 3 months ago
JSON representation
Play Tetris from the comfort of your terminal!
- Host: GitHub
- URL: https://github.com/alwedo/tetris
- Owner: alwedo
- Created: 2025-05-02T11:47:20.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-12-06T17:08:27.000Z (4 months ago)
- Last Synced: 2025-12-16T04:37:50.196Z (4 months ago)
- Topics: go, golang, grpc, grpc-go, terminal, terminal-based, terminal-game, tetris, tetris-game, tetris-go
- Language: Go
- Homepage:
- Size: 281 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Terminal Tetris
  
Play Tetris from the comfort of your terminal!

⚠️ this assumes you know how to use the terminal! If you don't you can find out how [here](https://www.google.com/search?q=how+to+use+the+terminal).
## Install
For Apple computers with ARM chips you can use the provided installer. For any other OS you'll have to compile the binary yourself.
### ARM (Apple Silicon)
Open the terminal and run:
```bash
curl -sSL https://raw.githubusercontent.com/alwedo/tetris/main/bin/install.sh | bash
```
- You'll be required to enter your admin password.
- You might be required to allow the program to run in the _System Settings - Privavacy & Security_ tab.
### Compiling the binary yourself
1. [Install Go](https://go.dev/doc/install)
2. Clone the repo `git clone git@github.com:alwedo/tetris.git`
3. CD into the repo `cd tetris`
4. Run the program `make run-tetris`
## Multiplyer
Yes, Terminal Tetris allows you to battle your way out against another person! Every time you complete a line, the opponent's speed will increase by one level, creating a fast-paced multiplayer experience.
Tetris server is a minimalistic server implementation that uses gRPC bidirectional streaming to allow clients to play tetris against each other.
### Connect to my own server (while it last)
```bash
tetris -address="52.50.114.171" -name="your_name"
```
### Create your own server
You can either run the server in your local host:
```bash
make run-server
```
Or you can run it inside of a container:
```bash
make docker-build
```
The server will listen to TCP connections over the port *9000*. How to expose the port for others to join you locally is beyond the scope of this document. However you can look at tools like [ngrok](https://ngrok.com/).
## Options
Disables Ghost piece.
```bash
tetris -noghost
```
Enables debug logs into `~/.tetrisLog`.
```bash
tetris -debug
```
Prints current version.
```bash
tetris -version
```
Sets player's name for Online mode.
```bash
tetris -name="YOUR_NAME"
```
Sets the server address for Online mode.
```bash
tetris -address="YOUR_SERVER_ADDRESS"
```