Snake game in a data: URI 
You should queue inputs. If you press left-down the snake should turn left and then go down on the next frame. That is, if you are attempting to recreate the classic Nokia experience, anyway.