2009-06-02

tetris

The game of Tetris has turned 25 24. I don't care very much about computer games, but I've nevertheless spent quite a bit of time playing Tetris - its brilliance is in its simplicity.

Obviously, emacs comes with a Tetris-clone; just type M-x tetris RET and there you go! There is very little useful things to customize about the game, except maybe you'd like to keep your ~/ clean and set:

(setq tetris-score-file 
  "~/.emacs.d/tetris-scores")

I'd also like to point to the lisp source code, which is only 658 lines long - almost CodeGolf-worthy. It's an interesting read if you are that kind of person. To see the source code, access the help for M-x tetris, i.e., press C-h f tetris and Enter (as discussed in Helpful Emacs). You'll get a help buffer then, which includes a link to tetris.el, the source code; obviously, you need to have the sources installed. In Ubuntu/Debian, you can install the source code through the emacs22-el or emacs-snapshot-el packages, depending on the version of emacs you're using.

Thanks to emacs, you can actually read the source code in one buffer, while playing tetris in the other one!

11 comments:

Marten said...

In what way is a game from 1985 twentyfive years old?

djcb said...

@Marten: excellent point.

It's 25 because...
* It's entering it's 25th year
* In some Asian countries use base-1 for people's age

:-) Anyway, I should have double-checked.
Fixed now.

ashawley said...

Red Hat believes the game is trademarked and strips it from binaries, including Fedora. =(

netcasper said...

To see the source code,

(require 'find-func)
(find-function-setup-keys)

Then, C-x F tetris

djcb said...

@netcasper: that's clever, thanks. i was looking for that.

Kenneth Lareau said...

Regarding the age: if the Wikipedia URL link you have is to be believed, the game was released on June 6th, 1984... which means it will be 25 in one day. So you were correct the first time. :)

djcb said...

@Kenneth Lareau:

It seems someone updated the Wikipedia page one day after I posted it...

http://en.wikipedia.org/w/index.php?title=Tetris&diff=294212574&oldid=294143306

I *think* indeed that 25 was right after all.

Kenneth Lareau said...

That could be annoying... also note on http://www.tetris.com/ (the official Tetris site) that there's a featured link on the left about the 25th anniversary, along with http://tech.yahoo.com/news/ap/20090602/ap_on_hi_te/us_tec_tetris_turns25 (just one of various articles on the topic).

Anonymous said...

I wish Redhat/Fedora would just rename it "blocks" or something and include it, if they are worried about trademarks.

maurizio said...

seeing the source code is simpler than what already suggested: M-x find-library tetris

Nancy Harris said...

Alexey Leonidovich Pajitnov created and developed the Tetris game. Tetris turns 25, Google makes its logo unintelligible Jun 06 09. Tetris is my most favorite game till date.