Took some time to learn how to program snake. While a simple game, the actual programming is interesting. Positional information of the snake is stored in a list. I originally assumed we would need to calculate the movement of every part. However, you really only need to do this with the head of the snake as that determines the overall direction. Then you just update the list with the positional data of the item in front of it. A much more elegant solution and quite clever.
One aspect I didn't get to was swapping out the solid cubes for images that showed the snakes body twisting and bending. To get the correct image based on the snakes movement, you can look at the differences between positions of the snakes body, determine a vector, and then update it with the correct image based on it direction. Also - very smart and interesting to learn!
Snake is not an original program, but I learned more about how to think about the underlying data in the system and use it in different ways. Curious to see what I can learn next!
The program for snake is below if you want to try it out for yourself or take a look.