-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWoS.cpp
58 lines (48 loc) · 1.3 KB
/
WoS.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
#include <iostream>
#include <stdlib.h>
#include "game.h"
#include "player.h"
using namespace std;
using namespace WoS;
int main()
{
bool active = true;
string str;
cout << "You have entered the World of Schuul \nYou have a lecture in 30 minutes, if you don't make it in time you will fail the course\nto your help you have the following commands:\ngo <direction>\nwait\nsearch\npick up <item>\ndrop <item>\nuse <item> on <target>\n\nType \"quit\" to leave the world of schuul" << endl;
cout << "Enter your name: " << endl;
getline(cin,str);
Game g(str);
g.printRoom(0,false) ;
while(active)
{
getline(cin,str);
if(str.compare("exit") == 0 ||str.compare("quit") == 0 )
{
cout << "Leaving the World of Schuul" << endl;
active = false;
}
if(g.gameGoal())
{
cout << "You have made it to the lecture room in time\n and won't fail the course" << endl;
active = false;
}
else if(g.gameLost())
{
cout << "You didn't make it to the lecture in time and will therefore fail the course" << endl;
active = false;
}
else
{
cout << endl;
g.runCommand(str);
for(int i=0;i<50;i++)
{
cout << "-";
if(i == 24)
cout << "Time left: " << g.timeLeft();
}
cout << "-" <<endl;
}
}
return 0;
}