The Perfect Snake
Written by Mike James   
Saturday, 13 April 2013

Snake is still a well known game because of its suitability for  mobile phones - but did you know it was possible to win? We have a video for you that shows a perfect game of snake and it is fascinating and mesmerizing as a display of strategy.

The gif below was  posted to a Russian website, by a user with the name Dozen. It isn't clear how the gif came to be made or why, but it has been featured on Reddit and The Huffington Post and, while going "viral" might be too strong a term, it does seem to be gained a lot of popularity.

In case you have missed out on the delights of Snake all you have to do is steer the snake around the screen so that it eats the pellets. The problem is that each pellet makes the snake longer and it gets increasing difficult to avoid running into your own tail. 

Even though I have written Snake more than once, it had never occurred to be that there might be a "solution" in the sense of a movement strategy that allows the maximum number of pellets to be eaten and the snake to grow to the full size of the screen. This animated gif proves that there is. The game took 13 minutes 17 seconds in real time and is speeded up to about 2 minutes in the gif. The snake eats 100 pellets and reaches a length of 801 blocks which fills the screen and ends the game. 

When you watch the play notice some of the techniques used to avoid the tail - I personally love the wiggle that packs the tail into a shorter length so that the head can have some space to move. There are some amazing moves to reach the pellet towards the end of the game that have to be defined as strategic - no simple greedy algorithm is at work here!

  

snakegameanimate

 

 According to a number of comments the final screen reads:

“And now we’ll show you a cartoon. Connection to server … No connection. Thanks. Everybody’s free to go.”

which it is speculated is a reference to an urban myth that a well known game would show you a cartoon if you scored 1000. 

So I suppose the challenge is now to improve Snake so that it is more difficult to win but still winnable. Or you could choose the other side of the coin and write an AI bot to play any randomized snake game perfectly. 

 

snakeanimationicon

 

More Information

Original message board post

Hufffington post

Related Articles

Windows Phone 7 - Snakes on a Phone Part 1       

Snake - using the GDI+

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Banner


Google Updates Responsible AI Toolkit
01/11/2024

Google has announced updates to the Responsible Generative AI Toolkit to enable it to be used with any LLM model. The Responsible GenAI Toolkit provides resources to design, build, and evaluate open A [ ... ]



Google Intensive AI Course - Free On Kaggle
05/11/2024

Google is offering a 5-Day Gen AI Intensive Course designed to equip data scientists with the knowledge and skills to tackle generative AI projects with confidence. It runs on the Kaggle platform from [ ... ]


More News
 

 

Last Updated ( Saturday, 13 April 2013 )