Snake Game simulation

In this exercise you will simulate a parallel version of the classic Snake game. In this version, a snake occupies a number of adjacent cells on a square cell grid. It moves through the grid by choosing a direction (up, down, left or right) and moving its head to that position. After the head cell moves, each cell in the body moves, with the first cell of the body moving to where the head was, the second cell moving to where the first was and so on. If the head tries to move to a cell that is currently occupied by another snake or itself, the snake dies and does not move any more. Please note that the snake does not move backwards, thus, at every turn it will only have three directions to chose from. The movement of a snake must appear atomic to other snakes.

Leave a Reply