Skip to main content

Snake in 35 lines - 1.0

Snake in 35 lines.


Samuel Backman
(pyscripter)
A snake game in 35 lines of code. I wrote it only to check how many lines i needed to write a snake game.

Changes

Links

Home Page
http://pyscripter94.googlepages.com/snake.py
Source
http://pyscripter94.googlepages.com/snake.py

Releases

Snake in 35 lines 1.0 — 25 Jul, 2008

Pygame.org account Comments

  • Jay Thomas 2013-11-23 11:38

    Not read the entire thing, but already noticed that line 8 doesn't really count as 1 line as you've got multiple statements on it.

  • lolster 2013-12-08 05:33

    how do i play it??

  • Temesgen Abera 2015-03-14 14:22

    It is so amusing

  • Geek On Java 2015-07-30 11:51

    Make Snake Game In Swing | Geek On Java - Hub for Java and Android

    http://geekonjava.blogspot.com...

  • olykos 2016-01-01 10:27

    Ugh horrible coding practice. You're combining so many statements on one line and then think it counts as "one line". What's the point of this, it's not readable or elegant, it's a mess.

    Joe Shmoe 2020-06-08 02:19

    Yeah, looking through the whole thing, it looks like this is actually 61 lines. Still pretty impressive though
  • brad 2016-09-22 08:38

    helloooooooo

  • brad 2016-09-22 08:38

    haaaaahhahaahahahahahahhahhahahhahahahha

  • Casimir Gaul-Berrard 2017-01-02 16:10

    Clearly, almost half of the lines are composed of multiple statements, separated by ';'. In theory, this could be done in just 1 line (maybe 7-8 due to the functions and while statement).

  • Gavin_J 2018-03-02 07:04

    The code is unreadable. Besides. There is a obvious mistake: applepos=(random.randint(0,590),random.randint(0,590)) Common sense: the apple can't land on the snake.
  • santiago 2018-12-03 21:44

    can you make a button that restarts the game when you have died