Skip to content
Permalink
Browse files
random num generator + printout of what happens
  • Loading branch information
Nathan Brown committed Feb 14, 2020
1 parent 7de94b7 commit 22597bf98004f7fe04c4c2b1eb1813ee70a9b32f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
BIN +15.1 KB Rover/rover
Binary file not shown.
@@ -1,5 +1,7 @@
#include <iostream>
#include <cmath>
#include <thread>
#include <chrono>

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;
}

0 comments on commit 22597bf

Please sign in to comment.