Live data from Hacker News

Show HN: Tinytetris – 80 x 23 Terminal Tetris

github.com

51–54 of 54 posts

Re: Show HN: Tinytetris – 80 x 23 Terminal Tetris

#51
post #28

To quickly build and run from your terminal: git clone https://github.com/taylorconor/tinytetris && cd tinytetris gcc tinytetris.cpp -lcurses -o tetris && ./tetris

Or straight from curl:

    curl https://raw.githubusercontent.com/taylorconor/tinytetris/master/tinytetris.cpp | gcc -x c++ - -lcurses -o tinytetris

Re: Show HN: Tinytetris – 80 x 23 Terminal Tetris

#53
post #50

Earlier quoted context omitted.

There was also a suite of Windows games I played back in ~2003 that occupied maybe a 32x64 window each, and one of them was mini Tetris. As I recall, the developer was Israeli. Anyway it was awesome for playing casually in stealth mode; there were no window decorations and the games were well made. I think one of the other games was pool. I haven't been able to find them since.

Have you tried asking in the subreddit "tip of my tongue" [0]? I have been amazed at what they can figure out about obscure stuff with very abstract clues. [0] https://www.reddit.com/r/tipofmytongue/

Good idea! Thank you for the suggestion.

Edit: Actually just found the old site thanks to Google Groups :-)

http://web.archive.org/web/20030501044223/http://www.tinywin...

Re: Show HN: Tinytetris – 80 x 23 Terminal Tetris

#54
post #38

Earlier quoted context omitted.

As you can see from the program and screenshot right in front of you, xe did not. It's one of only two printw()s in the code, and the screenshot shows the result quite clearly.

You are correct; the code to print the blocks is on lines 35-37 of tinytetris-commented.c. But the large comment at the top of the tinytetris.c file is made of the block drawing characters :) The attron sets terminal attributes which presumably cause it to flip the " " into a solid block. I haven't decoded what exactly the number it's feeding in represents, but 262176 is 0b1000000000000100000, and the attributes are…

the attron() used is attron(A_REVERSE | COLOR_PAIR(n)). The OR operator is used to combine attributes in curses.
Post reply on HN