-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (48 loc) · 1.19 KB
/
main.cpp
File metadata and controls
53 lines (48 loc) · 1.19 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
53
#include <iostream>
#include <conio.h>
#include <string>
#include <fstream>
using namespace std;
int l, b; //Live rounds, blank rounds
ifstream f("options.txt");
int input_rounds() {
cout<<"Enter the number of live rounds: ";
cin>>l;
cout<<"Enter the number of blank rounds: ";
cin>>b;
if (l && b) return 1;
else return 0;
}
int main() {
system("color a");
cout<<"----- BuckshotCounter -----"<<endl<<endl;
char s[100];
char choice;
if (input_rounds()) {
do {
system("cls");
cout<<"The shotgun currently has: "<<l<<" live rounds and "<<b<<" blank rounds."<<endl<<endl;
while (f.getline(s, 100)) {
cout<<s<<endl;
}
cout<<endl;
cout<<"Choose your option: ";
cin>>choice;
switch (choice) {
case 'L':
case 'l':
l--;
break;
case 'B':
case 'b':
b--;
break;
case 'E':
case 'e':
return 0;
}
}
while(choice != 'E');
}
return 0;
}