Snake in javascript (#noLib)