Repository navigation
Expand file tree
/
Copy pathLost Fortune.cpp
More file actions
52 lines (39 loc) · 1.51 KB
/
Copy pathLost Fortune.cpp
File metadata and controls
52 lines (39 loc) · 1.51 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
46
47
48
49
50
51
52
//LOST FORTUNE
//A PERSONALIZED ADVENTURE
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
using std::string;
int main()
{
const int GOLD_PIECES = 900; //const - unchangeable
int adventurers, killed, survivors;
string leader;
//we get the information here
cout << "Welcome to the lost fortune\n\n";
cout << "Please enter the following for your personalize adventure\n";
cout << "Enter a number: ";
cin >> adventurers;
cout << "Enter a number, smaller than the first: ";
cin >> killed;
survivors = adventurers - killed;
cout << "Enter your name: ";
cin >> leader;
//story
cout << "\nA brave group of " << adventurers << " set out on a quest ";
cout << "- in search of the lost treasure of the Ancient Dwarves. ";
cout << "The group was led by that legendary rogue, " << leader << ".\n";
cout << "Along the way, a band of marauding ogres ambushed the party. ";
cout << "All fought bravely under the command of " << leader;
cout << ", and the ogres were defeated, but at a cost. ";
cout << "Of the adventurers, " << killed << " were vanquished, ";
cout << "leaving just " << survivors << " in the group.\n";
cout << "\nThe party was about to give up all hope. ";
cout << "But while laying the deceased to rest, ";
cout << "they stumbled upon the buried fortune. ";
cout << "So the adventurers split " << GOLD_PIECES << " gold pieces. ";
cout << leader << " held on to the extra " << (GOLD_PIECES / survivors);
cout << " pieces to keep things fair on course.\n";
return 0;
}