创建迷宫
typedef struct
{
int x, y; //Node position - little waste of memory, but it allows faster generation
void *parent; //Pointer to parent node
char c; //Character to be displayed
char dirs; //Directions that still haven't been explored
} Node;
C++ typedef struct 用法总结(浓缩就是精华)
在这里我们定义了一个全新的数据类型Node,节点含有位置,指针,表示字符,方向信息。在之后的编程中,我们可以用Node来定义变量的类型。
Node *nodes; //Nodes array
int width, height; //Maze dimensions<