本文整理汇总了C++中Maze::getHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ Maze::getHeight方法的具体用法?C++ Maze::getHeight怎么用?C++ Maze::getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Maze
的用法示例。
在下文中一共展示了Maze::getHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rand
Particle::Particle(Maze const& maze, int seed)
{
srand(seed);
_x = rand() % (int)maze.getWidth();
_y = rand() % (int)maze.getHeight();
_theta = (float) (rand() % 31416)/10000;
}
示例2: main
int main(int argc,char *argv[]){
while ((argc<3) || (argc>4))
{
cout << "Run the program as ./graphTest -m maze-file.txt (-Astar)" << endl;
return 1;
}
Maze maze;
Graph graph;
bool aStar = false;
int i = 1;
while (i<argc)
{
if (strcmp(argv[i],"-m")==0){
if ((i+1)>=argc){
cout << "Run the program as ./graphTest -m maze-file.txt (-Astar)" << endl;
return 2;
}
if(!maze.readMaze(argv[i+1])){
cout << "File does not exist" << endl;
return 3;
}
graph.init(maze.getHeight() * maze.getWidth());
graph.constructMazeGraph(maze);
}
if(strcmp(argv[i],"-Astar")==0){
aStar= true;
}
i++;
}
if(aStar){
graph.aStar();
} else{
graph.dijkstra();
}
return 0;
}