pygame is
spacer
spacer
 
 
pygame.org is
spacer
spacer
spacer
Tetris in 73 Lines

Tetris in 73 Lines - 1

Jordan Trudgett (tgfcoder)

Tags:

puzzle simple tetris tgfcoder colorful short

Description

Tetris written in 73 lines. Was originally 150+, then
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
masterpiece-in-progess, Ardentryst.

www.pygame.org/project/596/

Controls

  • Left: move block left
  • Right: move block right
  • Up: rotate block
  • Down: push block down space drops. Game over to quit. :P

Changes

Updated the Source URI.

Links

Home Page: jordantrudgett.com/
Source: jordantrudgett.com/stuff/tetris_73.zip

Screenshot

spacer
click to view original size

Releases

Tetris in 73 Lines - 1 - Mar 10, 2013
Tetris in 73 Lines - 1.00 - Jun 30, 2008

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

March 17, 2013 1:40pm - Jason - nickname: (jasonspine) - 5/5
www.pygame.org/project-BCTetris-1485-.html# - beat this :D
July 2, 2008 10:47pm - Vitor Bosshard - nickname: (algorias)
Me know, me know, was just very fun making of fact that you use translator! Bilingual joke it was, as too is this.
July 2, 2008 9:36pm - Jordan Trudgett - nickname: (tgfcoder)
I meant that I don't speak Spanish. :P
July 2, 2008 7:09pm - Vitor Bosshard - nickname: (algorias)
What do you mean you have a bad tongue? Está podrida o algo? ;)
July 1, 2008 3:57pm - Jordan Trudgett - nickname: (tgfcoder)
@juanchi: Estoy utilizando un traductor para hablar español porque hablo inglés así que lo siento para la mala lengua;

Tenga por favor una mirada en mi juego, el Ardentryst (www.pygame.org/project/596/), quizá que apelará más a usted. :)
July 1, 2008 3:55pm - Jordan Trudgett - nickname: (tgfcoder)
*compressed meaning removing extra spaces, comments, shortening variables names, reusing variables names, etc.

Wouldn't it be fun to try and understand it? For example, which line rotates blocks? :D

If you want to an example of my normal code-writing style, look at the game Ardentryst www.pygame.org/project/596/
July 1, 2008 3:50pm - Jordan Trudgett - nickname: (tgfcoder)
"And yes, the code is obfuscated on purpose."

Please read the description.

I wrote it normally first, then compressed it to make it as small as possible.
That was the entire point.
July 1, 2008 12:55pm - Anonymous - nickname: (pywiz32)
WOW... Unreadble because of really bad variable names, no commenting, and implicit use of varibles. How this even runs is a mystery to me.
July 1, 2008 12:46pm - Anonymous - nickname: (pywiz32)
Great game. Add in being able to press escape to quit. Too bad you made it horrible code. I never even knew you could put the entire initialazation methode on one line. I'll see if I can decode it.
July 1, 2008 9:00am - pymike - nickname: (pymike)
LOL the code is a mess but the game plays pretty good :-D

I found one of those bugs you mentioned.. if you press left or right when next to a block you "catch" on it. Maybe add one more line to fix it? ;-D

BTW I got the code down to 70 lines of code :-D
July 1, 2008 8:56am - juan bruno abbona soffita - nickname: (juanchi)
esta bueno pero la mayoria de los chicos de hoy buscan los juegos de animes(dragon ball z,naruto, inuaya,etc)
July 1, 2008 3:04am - Jordan Trudgett - nickname: (tgfcoder)
Haha, there are a few bugs and stuff. It wasn't made to be a good example of code-writing, but moreso code-destroying. If you would like me to write this with good structure, comments, etc., I may consider it. Depends how much you want it :P
July 1, 2008 2:49am - Michael Arevalo - nickname: (sandhandle) - 4/5
DUDE, I've been searching for a nice Tetris clone to learn by reading the source code. This runs exactly like I want it to...but Wow, just WOW.

such a shame, it runs perfectly ;_;
4 out of 5 for untraceable code
spotlight
spacer
SGC - 0.2.1

spacer
Albow - 2.2
 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
May 7, 2015
spacer
Project Interstellar - 0.3.2.7 fix

spacer
A* pathfinding - 1.0

May 6, 2015
spacer
gsdl2 - Gumm's SDL2 - 0.0.0

May 3, 2015
spacer
Steamer Duck - 1.0

May 2, 2015
spacer
Juggleball - Free and open source

spacer
London's Burning! - Free and open source

May 1, 2015
spacer
MCF - 3.3

Apr 30, 2015
spacer
Pygame SGE - 0.18.1

Apr 27, 2015
spacer
SLC Shmup' - 1.1.1

Apr 26, 2015
spacer
Glittering Light - 2015-04-25

Apr 25, 2015
spacer
Nemoe - v0.1.0

Apr 13, 2015
spacer
Interphase - 0.87

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.