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