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


Personal Picks For Holiday Gifts
29/11/2024

It's Black Friday, the traditional day to indulge in online shopping. Not every item that is included in my selection of gifts is subject to a promotional offer, but where they aren't you might be poi [ ... ]



Hour Of Code 2024 Is About To Kick Off
04/12/2024

This year the event that aims to provide a coding experience for all school students and anyone else who wants to join in runs between December 9th and 15th and includes new activities. Let's find out [ ... ]


More News
 

 

Last Updated ( Saturday, 13 April 2013 )