我遇到了以下迷宫定义代码:
typedef struct mazeNode {
int hasCheese;
int tag;
struct mazeNode *left;
struct mazeNode *right;
} maze_t;
maze_t maze = {
.tag = 1,
.left = &(maze_t) {
.left = &(maze_t) {
.left = &(maze_t) {},
.right = &(maze_t) {}
},
.right = &(maze_t) {
.right = &(maze_t) {}
}
},
.right = &(maze_t) {
.tag = 8,
.left = &(maze_t) {},
.right = &(maze_t) {
.tag = 10,
.left = &(maze_t) {
.tag = 11,
.left = &(maze_t) {
.hasCheese = 1,
.tag = 12
}
},
.right = &(maze_t) {}
}
}
};
从链接的博客文章中,我了解到他们正在尝试用图中的奶酪定义二叉树。
但是,我似乎无法从 C 代码应该做的事情中脱颖而出。如果有人可以向我解释,那就太好了。