-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwallfollow_operation.cpp
71 lines (45 loc) · 1.06 KB
/
wallfollow_operation.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <iostream>
#include <fstream>
#include "robot/robot_algorithm.h"
#include "robot/robot_algorithm_oldworking.cpp"
//#include "robot/robot_algorithm.cpp"
#include <string.h>
#include "robot/solver.h"
#include "robot/solver.cpp"
using namespace std;
int main()
{
bool isExitFound = false;
char garbage;
robot_algorithm Robot; //create an object called robot
//Robot.DrawMaze();
// TESTING MAZE DRAWER
do{
Robot.DrawMaze();
Robot.CurrentPosition();
cin >> garbage;
if ( !Robot.SensorRight() )
{
Robot.TurnRight(); //AFTER IT TURNS RIGHT, it needs to set a boolean -- otherwise in a blank spacve, it will spin
}
else if ( Robot.SensorFront() )
{
Robot.TurnLeft();
}
else
{
}
if (!Robot.SensorFront())
{
Robot.DriveForward();
//Robot.CurrentPosition();
}
isExitFound = Robot.isExitFound();
//test++;
}while(!isExitFound); //(!isExitFound);
//Robot.test();
Robot.DrawMaze();
cout << endl << "Exit has been found!! ";
Robot.CurrentPosition();
return (0);
}