The game Snake in 90 lines of JavaScript


After watching Coding an HTML5 Game in 5 min 30 sec in which Chris DeLeon programs a Pong clone in Notepad, I was inspired to write a game myself. I opted to clone Snake and took a minimal approach. My goal was to do it with as little code as possible while still keeping the code very readable.

Obviously this is highly subjective, but I think I found a balance where there is hardly any extraneous code, but anyone with a small amount of JavaScript experience could read thought the code and understand everything.

Play the game a try here

You can contribute to the code on GitHub