

If the greedy snake does not eat food, we delete the last coordinate in the list and insert a new position in the head of the snake. But if we want the snake to jump around, we need to write a move function. We can make a round greedy snake just by drawing patterns on these positions. Each tuple in the list represents the coordinates of the greedy snake on the chessboard. The body of the greedy snake is made up of lists. Next, let’s introduce the key logic of snake-eating. The usage is described below along with the functions. This tutorial uses pyGame to implement the game interface, so here’s a little introduction to the installation of pygame. Among them, the gluttonous snake cannot touch the wall or bite itself. Users eat as much food as possible by manipulating snakes. Today let’s go into the world of snake-eaters and use Python to implement a simple version of the snake-eater game. Maybe we’ve played all kinds of snake-eating games, but we haven’t written our own snake-eating games by ourselves. When we were young, we were more or less addicted to an enduring game, snake-eating. For example, I learned advanced mathematics, should I consider how to use programming to achieve derivation or integral operation, if I can not think of how to do, should I baidu, how other people achieve numerical integration or symbolic integration? Every day we buy things by adding, subtracting and even multiplying and dividing, so can I write a simple calculator, if the command line is too ugly, can I quickly learn pyqt5 or other GUI to implement more sophisticated applications? Think about everything with programming thinking, it is very helpful for programmers to get started with programming. This is too inefficient, the correct way is to look around for problems, and then programming. So often I read grammar tutorials all day, and for months I only learned print (‘hello world’). As a python, Xiaobai always feels that he has to be 200% ready to start writing programs.
