Thursday, July 24, 2008

SedTris - a Tetris game written in sed.

I've seen irc clients written in sed and I've seen a lot of sed magic in my time, but this is just ridiculous...

A Tetris game written in sed.

http://uuner.doslash.org/forfun/sedtris.sed

7 comments:

Aram Havarneanu said...

Not as ridiculous as GPL cola (OpenCola).

Anonymous said...

and how do you play this thing?


$ sed sedtris.sed
sed: -e expression #1, char 11: unterminated `s' command

cmihai said...

Works fine for me :-). You're doing it wrong.

% chmod + x sedtris.sed
% ./sedtris.sed
Enter
Enter..
And see the instructions on screen :-)

Uuner said...

You can try to use this shell script to stop pressing Enter and enjoy the game.

cmihai said...

Nice :-)

Vamsi said...

:[

$ ./sedtris.sh
sed: command garbled: s/[^~]*~$/&&&/

what could be the problem....

cmihai said...

That's a GNU sed script, it will not work with AIX sed or Solaris sed (UNIX sed), it needs gsed.
On AIX for example:

./sedtris.sed
sed: 0602-404 Function s/[^~]*~$/&&&/ cannot be parsed.

Replaced the first line with:
#!/opt/freeware/bin/sed -nf
(this is GNU sed)

And it works.