Piece Definitions: 4x4 matrix - DerekJi/ngtetris GitHub Wiki

A 4x4 matrix in bits is used to define Tetris pieces. Every row, with 4 bits, could be represented by a hex value.

For example, 0 1 0 0 is 0x4.

And, T shape could be defined as

image

In this project, we also have a few extra rules:

  • Keep left: (except I shape)
  • Keep top: (except I shape)

Below are more definitions: image