Game of snake implemented in javascript - for fun