control a snake to eat(in the terminal)