r/tinycode • mod • Jul 20 '12

[Python] Simple platformer in 847 bytes

https://gist.github.com/3152857
16 Upvotes

22 comments sorted by

View all comments

2

u/Rotten194 mod Jul 20 '12 edited Jul 21 '12

You need pygame installed for this to work, by the way.

Edit: With some changes suggested by lw9k and a few other things, the file in now 833 bytes.

6

u/T3ppic Jul 20 '12

Some would say that means its not in 847 bytes.

4

u/Rotten194 mod Jul 20 '12

Well then everything python is really 2993560 bytes + the size of the program. Hell, the Linux kernel source is 500M so unless you use 16-bit real-mode assembly your code isn't tiny.

7

u/T3ppic Jul 20 '12

There are things defined as default and things that aren't. Hence import.

0

u/Rotten194 mod Jul 20 '12

So if I modified python to import pygame by default and then reposted this as "[ModifiedPython] Simple platformer in 847 bytes" it would be fine? That doesn't make sense.

1

u/Megabobster Jul 21 '12

I'm fairly new to Python, but can't you import just what you want from libraries?

2

u/asphyxiate Jul 21 '12

Pygame is an external library that doesn't come with the default installation of Python, which is frowned upon here.

1

u/Megabobster Jul 21 '12

I can tell.