2025.5.15第二次提交,按照实际场景初步修改代码。

This commit is contained in:
Ñõԭ×Ó
2025-05-15 17:15:15 +08:00
parent 6879dec68c
commit 9cd5540936
3 changed files with 74 additions and 26 deletions

View File

@@ -5,8 +5,11 @@ using namespace std;
/*---定义全局常量---*/
const int DIST_cell = 300 ;
const int DIST_wall = 100 ;
// const int DIST_cell = 300 ;
// const int DIST_wall = 100 ;
const int DIST_cell = 300;
const int DIST_wall_f = 68;
// const int DIST_wall_rl = 88;
/*---全局各种变量与常量定义完成---*/
@@ -25,7 +28,7 @@ int main()
//判断旋转方向
if (Lwall)
{
VWTurn(+90,45); //向左旋转
VWTurn(+90,10); //向左旋转
VWWait();
}
else if (Fwall)
@@ -34,12 +37,12 @@ int main()
}
else if (Rwall)
{
VWTurn(-90,45); //向右旋转
VWTurn(-90,10); //向右旋转
VWWait();
}
else
{
VWTurn(180,45);
VWTurn(180,10);
VWWait();
}
//直走