Snake clone written in JavaScript