Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MichaelS11/go-tetris
Golang Tetris for console window with optional AI
https://github.com/MichaelS11/go-tetris
go golang golang-tetris tetris
Last synced: about 2 months ago
JSON representation
Golang Tetris for console window with optional AI
- Host: GitHub
- URL: https://github.com/MichaelS11/go-tetris
- Owner: MichaelS11
- License: other
- Archived: true
- Created: 2017-03-27T20:05:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-23T09:48:31.000Z (about 3 years ago)
- Last Synced: 2024-06-21T04:44:00.082Z (3 months ago)
- Topics: go, golang, golang-tetris, tetris
- Language: Go
- Homepage:
- Size: 196 KB
- Stars: 73
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://raw.githubusercontent.com/MichaelS11/tetris/master/screenshots/tetris.png "Go Tetris")
![alt text](https://raw.githubusercontent.com/MichaelS11/tetris/master/screenshots/heart.png "Golang Tetris Heart")
![alt text](https://raw.githubusercontent.com/MichaelS11/tetris/master/screenshots/editmode.png "Edit Mode Peace Symbol")
![alt text](https://raw.githubusercontent.com/MichaelS11/tetris/master/screenshots/highscores.png "Tetris High Scores")
## To do
* Improve AI speed (slow on large boards)