Had a few nights free recently so was inspired to create a simple game for the unexpanded Commodore VIC – 20 using BASIC v2.0. For those who have programmed the VIC 20 in BASIC realise that you only have 3.5KB of memory in this configuration.
SNAKE in Commodore BASIC
The inspiration for Snake came from watching ‘The Coding Train‘ on Youtube where a Snake game was created for the Apple II in BASIC. The reason for targeting the VIC was that memory limitation increased the challenge and the ability for using colour, sound and a joystick or keyboard for a controller which were key to the VIC – 20 success.
SNAKE grows when eating the pi symbol (RAT)
Like traditional versions of SNAKE you start with a snake of one segment and eat time you eat some food in this case the pi symbol (which looks like a RAT) your snake increases in size by one more segment.
You snake can grow to 20 segments (memory limits) but be careful as if you eat yourself then the game will end. Also if you go off the size of the screen either top or bottom you may die… To add some challenge going off the sides might wrap the screen or if may kill your snake so be careful and only try it if you feel very lucky 🙂
Track high score
You can view the VIC 20 source code and download for Snake here.