Show HN: A Terminal Tetris Game
github.com
Show HN: A Terminal Tetris Game
1–10 of 22 posts
Re: Show HN: A Terminal Tetris Game
#2``` [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 1], [0, 0, 1, 1]] ```
Notice how the 1s form a square?
As I'm still learning Rust, any suggestions regarding the architecture, overall design of the game, more idiomatic code, etc., are very welcome.
If you want to play or just see how it turned out, check out:
Re: Show HN: A Terminal Tetris Game
#3Re: Show HN: A Terminal Tetris Game
#4Re: Show HN: A Terminal Tetris Game
#5I guess rogue, adom, nethack would be popular answers; probably the entire infocom catalog?
They're not really my cup of tea, the game I've enjoyed the most is probably asciiportal.
Re: Show HN: A Terminal Tetris Game
#6 thread 'main' panicked at 'index out of bounds: the len is 10 but the index is 18446744073709551615', src/core.rs:182:24Re: Show HN: A Terminal Tetris Game
#7Re: Show HN: A Terminal Tetris Game
#8Re: Show HN: A Terminal Tetris Game
#9Does it run on an Elektronika? https://youtu.be/O0gAgQQHFcQ
The drop-and-slide of a square around 1:26 leaves behind some filled cells! I wonder if that's a bug or was it a part of the original gameplay.
Re: Show HN: A Terminal Tetris Game
#10I wanted to share my attempt at implementing the classic tetris game. It works in the terminal and uses the ncurses-rs bindings for the UI part. For me, the coolest part about it is that the tetrominos and their rotations are encoded as 16-bit unsigned integers. For example, to represent a square, we want 51! Why 51? Because 51 decimal is `0b0000000000110011`. We can make 4x4 Vec from that, and we get: ``` [[0, 0, 0,…