pygame is
Simple DirectMedia Layer is
Site Swing

AttoSnake - 509 bytes

Jordan Trudgett (tgfcoder)



It's still just as playable! The input is tidy, not 
delayed, and fun to play with and best of all, there are NO
glitches (that I'm aware of.) To quit, just chuck in a 
KeyboardInterrupt or crash into yourself. It WILL NOT quit 
neatly in IDLE, unfortunately. It was a tradeoff for less 
bytes. Enjoy! For other snakers: use & lt; and & rt; for 
angular brackets (no spaces after &) Use this to make your 
code HTML friendly!

Apologies: pygame thought some of the angular brackets were

FIXED NOW. The code you see below can be copied and pasted into your favourite editor and run as a python file as-is.

Thanks for playing!


  • Inverted colours to save one byte
  • Used some lambda functions for repeated functions
  • Deleted some variables
  • Shorted some variables
  • Changed the way directions are calculated for less bulk
  • Removed newly found redundancies


Home Page:


click to view original size


AttoSnake - 496 bytes -- Final? - Jul 31, 2008
AttoSnake - 509 bytes - Jul 30, 2008
AttoSnake - 660 bytes - Jul 29, 2008 account Comments

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

August 2, 2008 11:32am - Jordan Trudgett - nickname: (tgfcoder)
That's odd. Maybe the hack is incompatible with your system (Mac? different python? dunno.)

Thanks ffao.
July 31, 2008 1:15pm - Ian Mallett - nickname: (geometrian)
I have 1.8.1
July 31, 2008 10:27am - ffao - nickname: (ffao)
Neat (even though you still have some line breaks in there). If it weren't for you, NanoSnake would have never reached the 500 byte mark ;)
July 31, 2008 9:16am - Jordan Trudgett - nickname: (tgfcoder)
I'll just add the number of lines to the bytecount. 509+33=542
I might have to make some serious tradeoffs soon (I'm trying to keep this playable! XD)
July 31, 2008 9:08am - ffao - nickname: (ffao)
Definitely feels faster than mine, but there is something I find a little bit disturbing: my computer can only produce CRLF files, so you have been undercounting a lot. I see that your program is 542 B long here, which still makes the last NanoSnake version shorter (in fact, it's only a little shorter than the original NanoSnake)! As both geometrian and I count in CRLF, I think it would be better if you posted the next count in that unit.
July 31, 2008 12:59am - Jordan Trudgett - nickname: (tgfcoder)
Geometrian, what version of pygame do you have?
July 30, 2008 10:54pm - Jordan Trudgett - nickname: (tgfcoder)
wrong window -_-
July 30, 2008 10:53pm - Jordan Trudgett - nickname: (tgfcoder)
I noticed that a lot of your code is mine too. Nice :D
July 30, 2008 10:48pm - Jordan Trudgett - nickname: (tgfcoder)
Aw, ok. Plus your computer converted it to DOS format meaning an extra character per line (CRLF instead of LF)

I'll work on the colour argument.
July 30, 2008 2:52pm - Ian Mallett - nickname: (geometrian)
Cool, but says invalid color argument. Also, my computer says it is 700bytes exactly (currently my program is 703bytes).
July 29, 2008 11:30pm - Jordan Trudgett - nickname: (tgfcoder)
It can still be shortened further, perhaps a few more bytes, but don't bother optimising it; write your own! :D

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)