Here's a snake game I tried to speed-code with JS and HTML5 canvas the other day. github.com/xdesro/snake-game/
The code is super bad, but future commits will endeavor to improve it and fix existing bugs, like, such as, like:
Presently, the food can spawn inside your tail, so you have to wait until you no longer occupy that space to score another point.