Data structure learning (C ++) - recursion [3] (1)

zhaozj2021-02-16  54

maze

Regarding the maze, there is a fascinating Greek myth, which is why now people mention this problem, always is very prosperous (for young people, it is estimated that RPG is playing more) We always proudly say that "Luo Shu". I don't review this myth, interested in entering "Greek mythology maze" on search engines, you can find a lot of introductions.

The myth of the maze tells the story of a hero to kill the cattle strange (playing "hero invincible", you must have to think that you want to make the cattle, you must build a maze, come from here), I When I saw this myth, I didn't know if I was interested in making the maze algorithm. I didn't know if I didn't know how to make it. I said this process: hero's help - paving on the road Every time the bubble opening is moving in the direction of the cable, if you encounter a dead end, return along the shop, paved the second line - walk into the depths of the maze, kill the cattle strange. However, myths legends, the hero sent to the deeper of the maze as a tribute and other children, and the hero killed the cattle and slammed the labyrinth. In fact, this launch group is just a "stack", and there is no modern person gives it a "magical role". I think the author is also a lot of RPG, I always think about how "the brave fighting the evil dragon", however, it is actually "victory big escape".

The maze problem is actually a psychological test. It reflects the tester to control the mental stability. After a time failure, whether it lost calm and finally in the maze, it is reflecting a poem, "I don't know the true face of Lushan, Only in this mountain. " In other words, we have studied the computer solution of the maze, and there is no significance. The maze is designed to be designed, not for the machine, which is called "fans", provided that people's memory accuracy is not high; Suppose people have accurate memories such as people, as long as he is not stupid, you can get out of the maze. It may now be used to use the research of smart robots to refute me. In fact, the smart robot is on a higher level of simulative thinking process, as long as it completely reproduces the people's way of finding, it can go out of the maze. However, it is meaningful to study the computer method of labyrinth generation, because people always have their own tendencies (many people in rpg have turned three days and three nights and don't know tired), huh, smile.

Anyway, I still study how the computer takes the labyrinth.

Maze store

According to the practice, use a two-dimensional array to represent the maze, 0 means the wall, 1 means the path, and our program will take the maze below.

转载请注明原文地址:https://www.9cbs.com/read-22978.html

New Post(0)