classic game of snake written in JavaScript