diff --git a/Rover/rover b/Rover/rover new file mode 100755 index 0000000..54605a4 Binary files /dev/null and b/Rover/rover differ diff --git a/Rover/rover.cpp b/Rover/rover.cpp index d2f780a..dcc35d1 100644 --- a/Rover/rover.cpp +++ b/Rover/rover.cpp @@ -1,5 +1,7 @@ +#include #include #include +#include void report_to_earth(std::string fault){ std::cout << "reported to fault to earth" << std::endl; @@ -12,17 +14,28 @@ int determine_scenario(short num){ } int main(){ - short randNum = rand() % 100 + 1; - + short randNum; int scenario; do{ - scenario = determine_scenario(randNum) + randNum = rand() % 100 + 1; + std::cout << "Rand num = " << randNum << std::endl; + scenario = determine_scenario(randNum); if (scenario == 3){ //if wheel failure report_to_earth("Wheel Failure"); } - }while(); + if (scenario == 2){ + std::cout << "Wheel loose" << std::endl; + } + if (scenario == 1){ + std::cout << "wheel stuck" << std::endl; + } + else{ + std::cout << "No problem" << std::endl; + } + std::this_thread::sleep_for(std::chrono::seconds(1)); + }while(true); return 0; }