tinytetris - 80x23 terminal tetris

tinytetris

80x23 terminal tetris!

tinytetris gif

tinytetris.cpp

This is the 80x23 version. You control it with a (left), d (right), w (rotate), s (drop), and q (quit). It depends on curses.h (so you'll need to compile with -lcurses, and install curses if you don't already have it) and requires C++11.

tinytetris-commented.cpp

This one is almost identical to tinytetris.cpp, but not minified, and with some comments to make it easier to read (but it's still tricky to read in certain parts).

Similar Resources

a simple to use linux terminal

a simple to use linux terminal

Feb 17, 2022

Collection of human friendly terminal interface for git.

Collection of human friendly terminal interface for git.

A collection of human friendly terminal user interface for git.

Nov 25, 2022

Simple benchmark for terminal output

TermBench This is a simple timing utility you can use to see how slow your terminal program is at parsing escape-sequence-coded color output. It can b

Oct 19, 2022

Contour - A modern C++ Terminal Emulator

 Contour - A modern C++ Terminal Emulator

contour is a modern terminal emulator, for everyday use. It is aiming for power users with a modern feature mindset.

Nov 24, 2022

A C, C++ and Rust library to draw graphics with pixels in the terminal

A C, C++ and Rust library to draw graphics with pixels in the terminal

A library to draw graphics with pixels in the terminal Who needs a GUI when you have a terminal ? Building To generate libpluto.a, run: $ make To ins

Nov 7, 2022

📺🗿 Terminal graphics for the 21st century.

📺🗿 Terminal graphics for the 21st century.

📺🗿 Chafa is a command-line utility that converts all kinds of images, including animated GIFs, into sixel or ANSI/Unicode character output that can be displayed in a terminal.

Nov 29, 2022

Simple Unix Terminal Football Manager-like game.

Superleage 2020/2021 It is a "work in progress" simple game based on some mechanics of Football Manager. The game is in a very early stage of Developm

Oct 14, 2021

timg - Terminal Image and Video Viewer

 timg - Terminal Image and Video Viewer

timg - Terminal Image and Video Viewer

Nov 29, 2022

Tiny Mobile Terminal Device Kit.

Tiny Mobile Terminal Device Kit.

Tiny Mobile Terminal Device Kit.

Dec 1, 2022
Comments
  • make error

    make error

    [email protected]:~/hellogithub/tinytetris$ make g++ tinytetris.cpp -lcurses -o tinytetris tinytetris.cpp: In function ‘I F()’: tinytetris.cpp:10:73: error: ISO C++ forbids declaration of ‘z’ with no type [-fpermissive] +y][N(r,(i*2)+2)+x]=v;}I F(){for(I c=0;c<20;c++){move(1+c,1);for(auto &z:a[c]){ ^ tinytetris.cpp:10:75: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11 +y][N(r,(i*2)+2)+x]=v;}I F(){for(I c=0;c<20;c++){move(1+c,1);for(auto &z:a[c]){ ^ tinytetris.cpp: In function ‘I R()’: tinytetris.cpp:14:12: error: ISO C++ forbids declaration of ‘z’ with no type [-fpermissive] ;for(auto &z:a[q])c*=z;if(!c)continue;for(I c=q-1;c>0;c--)memcpy(&a[c+1][0],&a[ ^ tinytetris.cpp:14:14: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11 ;for(auto &z:a[q])c*=z;if(!c)continue;for(I c=q-1;c>0;c--)memcpy(&a[c+1][0],&a[ ^ : recipe for target 'tinytetris' failed make: *** [tinytetris] Error 1

  • Correct block layout comment

    Correct block layout comment

    It's a really minor thing, and I'm not even 100% sure it's correct.. but as I tried to reverse-engineer your code, this small detail really tripped me up. Does it make sense?

  • what's the meaning of

    what's the meaning of "262176" ?

    I read the code in "frame()" function and find that " attron(262176 | board[i][j] << 8)", I know what attron means, but I don't understand 262176, what's the meaning?

  • Add CMakeLists.txt

    Add CMakeLists.txt

    It's good if there's a CMakeLists.txt。I write one that works for me. In this case, you need to create build and src folder, and put the code that needs compilation in src:

    cmake_minimum_required (VERSION 3.0)
    
    
    project(terris_demo)
    
    
    find_package(Curses REQUIRED)
    include_directories(${CURSES_INCLUDE_DIR})
    
    aux_source_directory(src terris_src)
    
    add_executable(${PROJECT_NAME} ${terris_src})
    target_link_libraries(${PROJECT_NAME} ${CURSES_LIBRARIES})
    
Related tags
Spitfire is a basic terminal language that can exicute code via the terminal.

Spitfire is a basic terminal language that can exicute code via the terminal. It is easy to learn and runs fast, considering that its just a 300 line c++ file.

Nov 18, 2021
Small header only C++ library for writing multiplatform terminal applications

Terminal Terminal is small header only library for writing terminal applications. It works on Linux, macOS and Windows (in the native cmd.exe console)

Dec 1, 2022
:computer: C++ Functional Terminal User Interface. :heart:
:computer: C++ Functional Terminal User Interface. :heart:

FTXUI Functional Terminal (X) User interface A simple C++ library for terminal based user interface. Demo: Feature Functional style. Inspired by [1] a

Nov 30, 2022
A little UNIX-inspired terminal application for the Numworks Calculator (not using escher).
A little UNIX-inspired terminal application for the Numworks Calculator (not using escher).

L.E. Terminal (let for short) is a little UNIX-inspired terminal for the Numworks Calculator.

Aug 31, 2022
Draw sequence diagram in text from terminal.

sequence-diagram-cli Draw seqence diagram from terminal.

Nov 26, 2022
Terminal calculator made for programmers working with multiple number representations, sizes, and overall close to the bits
Terminal calculator made for programmers working with multiple number representations, sizes, and overall close to the bits

Programmer calculator The programmer calculator is a simple terminal tool designed to give maximum efficiency and flexibility to the programmer workin

Nov 22, 2022
X terminal emulator rendering through OpenGL ES Compute Shaders

Zutty is a terminal emulator for the X Window System, functionally similar to several other X terminal emulators such as xterm, rxvt and countless others

Dec 3, 2022
The new Windows Terminal and the original Windows console host, all in the same place!

The new Windows Terminal and the original Windows console host, all in the same place!

Nov 28, 2022
n³ The unorthodox terminal file manager
n³ The unorthodox terminal file manager

n³ The unorthodox terminal file manager

Nov 30, 2022
Graphs the activity of a chia harvester in a linux terminal.
Graphs the activity of a chia harvester in a linux terminal.

Chia Harvest Graph Monitor for Chia Harvesting Introduction The chiaharvestgraph tool will graph Chia Harvesting activity in a linux terminal. Use a 2

Nov 10, 2022