-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·45 lines (39 loc) · 1.23 KB
/
main.cpp
File metadata and controls
executable file
·45 lines (39 loc) · 1.23 KB
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
/*
Eugene Li
CS9163
*/
#include "Sandbox.h"
using namespace std;
int main(int argc, char* argv[])
{
Sandbox sandbox = Sandbox();
if(argc == 2)
{
sandbox.openAndRun(argv[1]);
}
else
{
cout << "==========================================================================\n";
cout << " Welcome to Box of Sand for Running of Programs and Such (BSRPS). \n Read the attached documentation for a list of commands. \n";
cout << "==========================================================================\n";
while(!sandbox.isClosed())
{
if(sandbox.hasError())
sandbox.displayErrorMessage();
if(sandbox.getMode() == "interactive")
{
cout << "> ";
string command;
getline(cin, command);
sandbox.processInstruction(command);
}
else if(sandbox.getMode() == "run_program")
{
string program;
cout << "Enter the filename of your program: ";
getline(cin, program);
sandbox.openAndRun(program);
}
}
}
}