Month: January 2009

Multiplayer Snake

Posted by on January 5, 2009

Well, here we have yet another challenge… Though this one does not involve any prizes, as I want my students at the NCSS camp to actually do their projects and not spend all their time on my competition.

So, what is has to be done here? Well it is quite simple really… Design a bot to play snake for you. I am forcing people who submit to write their solution in python (though there is no real need, other than I am teaching python at the moment). The input/output of the program is quite simple… The output consists of one of the following four letters: ‘U’, ‘D’, ‘L’, ‘R’ (corresponding to Up, Down, Left and Right).

The input consists of the following:
width height snake_id
board layout

An example is:
7 7 A
..*....
..A....
..a....
..a....
.......
.......
..Bbbb.

Where * is an apple, . is an empty cell, the uppercase letters are the head’s of the snakes, with the lowercase being the body.

Code for the engine is located in my repository under the snake project. Submissions should be made to my email address, or in person.

The initial competition will have bots go up against each other, with no time limit given per move. The later rounds will ensure that all bots get equal cpu time (by running the faster bots more often).