
Show HN: Tinytetris – 80 x 23 Terminal Tetris - taylorconor
https://github.com/taylorconor/tinytetris
======
bitwize
Friendly reminder: Tetris is one of the most valuable, and vigorously
defended, game IPs in the world. Such aspects of the game as the dimensions of
the playfield and the shapes of the tetrominoes are protected by copyrights
and trademarks belonging to Tetris Holdings LLC -- and Tetris Holdings is
Oracle-tier litigious. Yes, this has stood up in court. Hope you like
unfriendly C&Ds from powerful attorneys.

~~~
cdubzzz
Have they ever actually ended up in court? I was on the receiving end of one
of these letters many years back for a clone I was involved with, but we just
kept distributing it for a long time and they just sent basically the same
letter a few years later. The primary developer eventually stopped the project
only because he moved on to other things.

I feel like back then we didn’t find any cases backing up TTC’s claims, but I
haven’t kept up over the years.

~~~
bitwize
Look up _Tetris Holdings, LLC v. Xio Interactive, Inc._ The court found 100%
in favor of Tetris Holdings, in particular noting the shape of the
tetrominoes, the way the tetrominoes spun and fell, and the dimensions of the
game board as protectable elements under U.S. copyright law. Since this ruling
was handed down, Tetris has applied for and received U.S. trademarks on the
tetromino pieces.

The upshot of this is that it is illegal to develop a clone of Tetris. It
doesn't matter whether you call it Tetris or not, or whether you use "ripped"
or copied assets or not -- the _very fact that you have copied Tetris_ means
you are infringing. It may be illegal to develop a video game that uses
tetrominoes _at all_ since the tetromino pieces are protected trademarks of
The Tetris Company.

~~~
defertoreptar
Copyright does not protect game mechanics and rules. In _Tetris v. Xio_ , they
successfully argued that the game infringed on trade dress.

They claimed that the pieces looked like ones in other games, which in my view
is impossible not to infringe on since there have been hundreds of Tetris
games with every type of piece design possible.

They claimed that they used tetrominos, and the playfield was twice as high as
it was wide, and so on. What Xio failed to point out was that all of these are
functional aspects of the game, which means it is not protected by trade
dress. Even the original creator, Alexey Pajitnov, has said that he originally
tried pentomonoes, but that was too difficult, so he used tetrominos instead.
That's functional, not trade dress.

Do you have a source for Tetris's trademarking tetrominos? Perhaps you're
referring to their "tetrimino" label, which their own term for what the non-
branded world refers to as "tetrominos."

~~~
bitwize
Xio did, in fact, attempt to point out that the shapes of the tetrominos are
functional elements and not subject to trade dress. The judge disagreed.

The judge also said that while copyright does not protect the abstract concept
of a falling block game, he _specifically_ cited the shapes of the blocks and
the playfield size as copyrightable.

It's settled U.S. case law. If you develop a clone of Tetris, you are
infringing on The Tetris Company's copyrights and trademarks and may be
subject to civil and criminal penalties under U.S. law.

IF YOU DON'T WANT TO BE SUED, DON'T EVER WRITE A TETRIS CLONE. PERIOD.

~~~
defertoreptar
In the ruling, the judge states, "The style, design, shape, and movement of
the pieces are expression; they are not part of the ideas, rules, or functions
of the game nor are they essential or inseparable from the ideas, rules, or
functions of the game."

Clearly the judge disagreed that these elements weren't protectable, but do
you agree? I'm say that _I don 't agree with the judge._ Changing the the kind
of polyominoes will make the game easier or harder (imagine how easy it would
be with dominoes). Changing the playfield dimensions also changes the
difficulty: a lower ceiling as well as a narrower well makes it much more
difficult to survive.

~~~
bitwize
Well if you're sitting on a pile of startup exit cash and can hire a Boies-
tier attorney, go ahead and write that Tetris clone. You'll get your day in
court to test those theories of yours, soon enough, and you can appeal it all
the way to the Supremes if you wish.

As things stand, though, the law of the land as established in federal courts
says those elements are copyrightable, and under copyright. So it doesn't
matter a fig what you or I think of the judge's ruling -- the law is clear.

~~~
defertoreptar
If you are new to programming, I would actually recommend making a Tetris
clone. It's a great learning experience. Obviously if you're worried about
receiving a cease and desist, then don't put it on sale on the app store.

------
legohead
There used to be a playable Tetris in the favicon, which I found from HN[1],
but it looks like the website[2] is dead now :(

[1]
[https://news.ycombinator.com/item?id=3873623](https://news.ycombinator.com/item?id=3873623)

[2] [http://favris.info/](http://favris.info/)

~~~
themodelplumber
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.

~~~
slazaro
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/](https://www.reddit.com/r/tipofmytongue/)

~~~
themodelplumber
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...](http://web.archive.org/web/20030501044223/http://www.tinywindowsgames.com/)

------
amasad
Cool! I made a demo playable in the browser:
[https://repl.it/@amasad/tinytetris](https://repl.it/@amasad/tinytetris)

Or run it directly here:
[https://tinytetris.amasad.repl.run/](https://tinytetris.amasad.repl.run/)

~~~
OrgNet
> Or run it directly here:
> [https://tinytetris.amasad.repl.run/](https://tinytetris.amasad.repl.run/)

I needed to allow requests to five 3rd party domains for this tiny Tetris to
load (uMatrix)

~~~
amasad
Absolute madness.

~~~
OrgNet
right... it is pretty bad for something that is supposed to be minimalistic

~~~
amasad
Abhorrent.

~~~
OrgNet
not the end of the world, just something to think about

------
twic
I didn't think i'd ever read a Tetris implementation more incomprehensible
than sedtris [1], but here we are.

[1] [https://github.com/uuner/sedtris](https://github.com/uuner/sedtris)

~~~
ksaj
Here it is in a rather ambitious toy assembler language created specifically
to play tetris using Conway's Game of Life rules. Trying to grok it will melt
your brain on multiple levels.

[http://play.starmaninnovations.com/qftasm/#jllHdnBGSP](http://play.starmaninnovations.com/qftasm/#jllHdnBGSP)

------
alpn
To quickly build and run from your terminal:

    
    
       git clone https://github.com/taylorconor/tinytetris && cd tinytetris
       gcc tinytetris.cpp -lcurses -o tetris && ./tetris

~~~
coolreader18
Or straight from curl:

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

------
kd5bjo
Very nice; writing minified code is a challenge I've never been particularly
good at.

As it happens, though, I had a university assignment due today to write a
WebGL falling-triomino game:

    
    
      Start game: space
      Rotate: a/z s/x d/c
      Move: arrows
      Drop: space
    

[http://2-71828.com/T%C3%B6lvugraf%C3%ADk/Verkefni03/tris.htm...](http://2-71828.com/T%C3%B6lvugraf%C3%ADk/Verkefni03/tris.html)

------
baddox
You could probably go even smaller by using higher resolution characters, like
Braille, but without the per-block colors.

~~~
mkl
One time in high school I made a Tetris clone (in one lunch hour!) with single
pixels as the squares, and used the VGA video memory itself as the data
structure for the current board state. It was in 320x200 resolution, so the
pixels were pretty big (the game area itself was only a small rectangle of
them). My version didn't detect when the pieces reached the top or keep score
or anything, just the basic playable mechanics.

------
classichasclass
With ncurses it runs out of the box on my POWER6 AIX machine, so A for
portability. I'd give you an A+ if I had xlc installed locally, but I cheated
a little and used gcc. (For ncurses, I used the perzl pre-built library.)

------
abhinai
Fascinating! Are there any easy to follow tutorial on how to manipulate _pixel
blocks_ (I wonder what the right term is) inside terminals?

~~~
the_pwner224
If you're referring to the game pieces, the creater probably just used these
Unicode characters:
[https://en.wikipedia.org/wiki/Block_Elements](https://en.wikipedia.org/wiki/Block_Elements)

~~~
JdeBP
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.

~~~
the_pwner224
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
defined around line 1100 of curses.h on my system (/A_NORMAL will find it).

~~~
TomJansen
the attron() used is attron(A_REVERSE | COLOR_PAIR(n)). The OR operator is
used to combine attributes in curses.

------
blondin
amazing op! tetris is one of those game on my need to implement list and never
actually finished an implementation :)

~~~
zrobotics
Don't let yourself get hung up on doing anything fancy, it's just fun to do.
Seriously, just implementing tetris in processing is a fun way to spend an
hour, and a great way to remind yourself of why programming is fun. It doesn't
involve anything crazy as far as algorithms, but is a fun challenge to do.
It's definitely worth it to implement a version, it is just fun to do.

~~~
taylorconor
+1! And there are plenty of helpful tutorials around if you get a bit stuck!

------
svnpenn
It's a quine

~~~
benj111
Is it? I see no mechanism for outputting anything other that the game board.

And theres no mention on the site.

~~~
taylorconor
It's not a quine :)

~~~
benj111
How has the parent not been downvoted to oblivion then?

Edit: I see you're the author, I'll take your word for it :) Nice work btw.

------
mhiming
Here’s a 509 byte JavaScript Tetris [https://github.com/veu/mini-
tetris](https://github.com/veu/mini-tetris)

------
sys_64738
On my Mac I can just type:

'emacs -f tetris'

~~~
zapzupnz
Yes, but that's rather besides the point. It's not the fact that it's Tetris
in a terminal; it's also the fact that it's minified code. Look at the GIF on
the Github page; that's the code of the game.

