Tetris in 50/28 lines of PYTHON code

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
11,029
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 3, 2010

Proof of concept!.
Only Standard modules: curses and random / Python 2.6.5 / Linux text-mode

Normal version: 50 lines
Squeezed code: 28 lines

Source:
50 lines: http://paste.pocoo.org/show/222650/
28 lines: http://paste.pocoo.org/show/222651/

Download: http://tetris-2850l.googlecode.com/files/tetris2850l.tar.bz2
My blog: http://defaultset.blogspot.com

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (K0x21)

  • Hi, where can I download that music? Thx

  • @PitrDQ Probably nowhere. I make music for all my videos by myself. As you can hear, it's just random pseudo-melodic stuff.

Top Comments

  • @K0x21 upload the music^^ I like it too^^

see all

All Comments (20)

Sign In or Sign Up now to post a comment!
  • great song ;)

  • @brassmonkey9871 You have to remember that Python is a high level interpreted language and as such things are a lot easier then it would be in, lets say C or C++.

    Also, the second script shown is not acceptable code, line lengths are usually kept below 80 characters and this guy has stuck heaps of commands on a single line by using the semi colon. If he wanted he could have put the entire program on a single line. Not to mention the terrible naming conventions...

  • @K0x21 You can download it from this video. I recommend Free Studio. But there are loads of other programs (some online) for downloading YouTube videos and extracting audio from YouTube videos.

  • IDLE internal error in runcode()

    Traceback (most recent call last): File "C:\Python27\lib\idlelib\rpc.p­y", line 235, in asyncqueue self.putmessage((seq, request)) File "C:\Python27\lib\idlelib\rpc.p­y", line 334, in putmessage raise IOError, "socket no longer exists"

    IOError: socket no longer exists

    Plz, some1 help :S im new to this and idk if im doing something wrong

  • holy fuck only 52 lines of code makes tertis?

  • No 1x4 Tetrimino?

  • What version of Eclipse is this? Also could you put in a download link =)

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more