News for hackers. Stuff that matters.
Re:Sedtris: Tetris in sed by benatkin on Sunday April 10, 2011 @04:53PM (#2430385)
I downloaded and played it. It didn't disappoint!

I was left wondering whether the game speeds up, though, and if so, how it works. Anyone know?

Re:Sedtris: Tetris in sed by ars on Sunday April 10, 2011 @05:03PM (#2430408)
It doesn't speed up. The sed program will wait forever for input, so it has no set speed.

The helper bash script gives it input once a second.

It uses the "read" command to check for input from you, and it will wait 1 second. If it gets no input it sends the sed program an enter.

Unfortunately "read" can not have timeouts less than a second (it doesn't support fractions of a second).

If you want, you could replace "read" with a different program that accepts shorter timeouts. And presumably you could have the bash script slowly decrease the timeout.