function for moving the snake - one invocation per turn