Play Tetris from the comfort of your terminal!
Ok, I got you!
- Open your terminal and type:
ssh playtts.ccIf you get this message:
The authenticity of host 'playtts.cc (<some ip address>)' can't be established.
ED25519 key fingerprint is: SHA256:MBrRN7xVN6Q1Ihod2VK95nbcaXgmrYEyznK072Xn2GE
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?Type yes and press enter.
- Play!
- (optional) Make sure you're not connecting to a fake Terminal Tetris server:
cat ~/.ssh/known_hosts | grep playtts.ccyou should get:
playtts.cc ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHEKS48gvoxj3bLsO2wBTgCoUiIVEscR7xeh0D0CWznkThis project contains an implementation agnostic Tetris engine written in go. You'll find that I created a TUI with it but you might as well create any other kind of implementation.
Example usage:
import (
"context"
"fmt"
"github.com/alwedo/tetris"
)
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel() // you can cancel the game at any time
t := tetris.Start(ctx)
// asynchronously receive updates from the game
go func() {
for {
select {
case msg, ok := <-t.UpdateCh:
if !ok { // game over
return
}
// use the Tetris status
fmt.Println(msg)
case <-ctx.Done():
// use cancel func to end the game if needed
return
}
}
}()
// send commands to the game
t.Do(tetris.MoveRight()) // or any other action
}You'll find my implementation in the client folder. It's based on Bubble Tea and it's currently a WIP so please be gentle when judging the design :)
You'll find the latest version of it in the release section.
Prints current version.
tetris -versionSets player's name for Online mode.
tetris -name="YOUR_NAME"Sets the server address for Online mode.
tetris -address="YOUR_SERVER_ADDRESS"The Tetris server connects two players over a gRPC bi-directional streaming connection. Implementation is in the server folder and you'll also find the latest version of it in the release section.