-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (32 loc) · 789 Bytes
/
main.cpp
File metadata and controls
37 lines (32 loc) · 789 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
33
34
35
36
37
#include "fish.h"
int main() {
int sector;
int count = 0;
vector<int> pond = {1,1,1,2,0,0,0,0,0};
vecShuffle(pond);
cout << "---Fishing---" << endl;
while(true)
{
cout << "Enter the sector number (1-9):";
enterValue(sector,1,9);
count++;
try
{
castInPond(pond,sector);
cout << "You didn't catch anything! Try again!" << endl;
}
catch (const fishException& e)
{
cout << e.what() << endl;
cout << "Number of attempts - " << count << endl;
break;
}
catch (const bootException& e)
{
cout << e.what() << endl;
break;
}
}
cout << "---GAME OVER!---" << endl;
return 0;
}