Last minute update to this - bugfixed a scenario where the random placement of food meant that if it landed on the 'head' of the snake, it'd be not eaten. I think I've bugfixed it anyway!