forked from nwhansen/Grid-Rover-GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexec.cpp
More file actions
33 lines (31 loc) · 690 Bytes
/
exec.cpp
File metadata and controls
33 lines (31 loc) · 690 Bytes
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
#include <string>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
//Lets do this
string c;
char dir;
while (true) {
//Wait for permission.
cin >> c;
if(rand() % 100 == 0){
cout << "selfdestruct" << endl;
}
switch (rand() % 4) {
case 0:
dir = 'n';
break;
case 1:
dir = 's';
break;
case 2:
dir = 'e';
break;
case 3:
dir = 'w';
break;
}
cout << "move " << dir << endl;
}
return (EXIT_SUCCESS);
}