Code Monkey home page Code Monkey logo

go-tetris's Introduction

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)

go-tetris's People

Contributors

cooperli avatar michaels11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.