This is a rust port of tinytetris - the most starred c++ tetris repository on github. I like the tiny part in this project - tiny mostly refers to the source code which can be minified down to almost nothing.
This rust version is similar in source code size (unminified) - but I hope is more readable.
The UI (ncurses) is mostly the same - I have moved the controls to the arrow keys.
Internally the tetrominos are packed differently - fits neatly into 7 u64s, where the original used 28 i32s.
Questions
-
Functions width() and height() calculate tetromino width and height on the fly - can it be expressed shorter?
-
Is there an automatic minifier that works on rust code?
This is mostly a gimmick - but it is interesting that the c++ sources can be minimized as much as they can.