Tetris in 73 Lines - 1
Tetris written in 73 lines. Left, right, up rotates, down pushes down, space drops. Game over to quit. :P And yes, the code is obfuscated on purpose. :P Enjoy decoding it =)
removed comments, extra space (indentation spacing and also
"x = 5", "6, 7, 8, 9" spaces for example) and put anything possible onto one line, separated by semi-colons.
The code itself is 2.6K and is 73 lines (probably can still be shortened.)
See if you can work out what each part does! (The list
manipulations would be the trickiest, I think.)
I was inspired by a similar tetris game written in 256
bytes... it probably does less than mine, but I thought it
was still damn impressive. :P
For a less sadistic approach to Python, see my
- Left: move block left
- Right: move block right
- Up: rotate block
- Down: push block down space drops. Game over to quit. :P
- Home Page
Tetris in 73 Lines 1.00 — 30 Jun, 2008
Tetris in 73 Lines 1 — 10 Mar, 2013
Pygame.org account Comments
Mak D'Uniq 2012-04-22 11:53:52
where can i download it? source link is not working
codequickly 2012-04-23 03:15:07
Yep, source code link is not working.
Soccermanhorse 2012-04-29 15:18:15
The source link needs to get fixed !
conorgleeson 2012-09-30 14:34:39
Source Link: http://inventwithpython.com/te...
tgfcoder 2013-03-10 06:36:04
Source URI has been updated. Thanks isacliaen7 for pointing this out to me personally :)
Nonya Binnis 2014-04-24 23:10:47
Of course it's on 73 lines if you scrunch a bunch of statements on to one line like that... You might as well write the whole thing on one line and say it's Tetris in one line of code.
Noname 2015-05-24 21:44:32
Is there any documentation for your code, I really can't understand anything :D
Robert Moore 2015-07-24 17:26:36
It freezes my computer until I finish the game!
bhottu 2015-09-07 03:19:58
nice post, try this source code http://blog.bhottu.com/2015/09...
18thcaliber 2015-10-02 08:43:52
yeah i can't use it