mirror of
https://gitee.com/yyz_o/bk_bishe_pi.git
synced 2025-09-07 23:21:26 +00:00
第一次提交
This commit is contained in:
69
maze_code/maze_func_output.cpp
Normal file
69
maze_code/maze_func_output.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
#include<vector>
|
||||
#include"eyebot++.h"
|
||||
#include"maze_func.h"
|
||||
#include"maze_parameter.h"
|
||||
using namespace std;
|
||||
|
||||
|
||||
/*---打印数组检查错误---*/
|
||||
/*---打印数组mark,map,copy_map等二维数组所用的函数---*/
|
||||
void output_arr2D(int *arr)
|
||||
{
|
||||
int rows = sizeof(arr) / sizeof(arr[0]);
|
||||
int cols = sizeof(arr[0]) / sizeof(arr[0][0]);
|
||||
|
||||
for (int i = cols - 1; i >= 0; i--)
|
||||
{
|
||||
for (int j = 0; j < rows; j++)
|
||||
{
|
||||
cout << arr[j][i] << " ";
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
}
|
||||
|
||||
/*---打印数组wall---*/
|
||||
void output_arrwall(int *arr)
|
||||
{
|
||||
int rows = sizeof(arr) / sizeof(arr[0]);
|
||||
int cols = sizeof(arr[0]) / sizeof(arr[0][0]);
|
||||
|
||||
for (int i = cols - 1; i >= 0; i--)
|
||||
{
|
||||
for (int j = 0; j < rows; j++)
|
||||
{
|
||||
if (arr[j][i][1] == 1)
|
||||
{
|
||||
cout << "|" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << " " ;
|
||||
}
|
||||
|
||||
if (arr[j][i][0] == 1)
|
||||
{
|
||||
cout << "_" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << " " ;
|
||||
}
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
}
|
||||
|
||||
/*---打印数组path---*/
|
||||
void output_arrpath(int *arr)
|
||||
{
|
||||
int size = sizeof(arr) / sizeof(arr[0]);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
cout << arr[i] << " ";
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
Reference in New Issue
Block a user