main.cpp
// Nathan Eloe
// main.cpp
// Allows patrons to play Moe's crazy darts game
#include "crazyDarts.h"
#include <iostream>
#include <string>
using namespace std;
const string SOUNDS[] = {"ding ding ding!",
"buuuuurrrrrpppp!",
"Hey Hey!",
"HmmmmmmmmmmmmM!",
"DOH!"};
const int NUM_SOUNDS = 5;
const int NUM_THROWS = 10;
const int MAX_BEERS = 12;
const int MIN_BEERS = 2;
int main()
{
unsigned int beers;
float scores[NUM_THROWS];
char cont;
cout << "Welcome to Moe's dart game. You'll shoot your eye out!" << endl;
do
{
cout << "\nHow many beers have you had? ";
cin >> beers;
cout << endl;
if (beers < MIN_BEERS)
displayScore(score(beers));
else if (beers <= MAX_BEERS)
{
play(scores, NUM_THROWS, SOUNDS, NUM_SOUNDS, beers);
cout << "Regular: ";
displayScore(score(scores, NUM_THROWS, beers));
cout << "Handicapped: ";
displayScore(score(scores, NUM_THROWS));
}
else
{
play(scores, NUM_THROWS);
displayScore(score(scores, NUM_THROWS));
}
cout << "\nPlay again? ";
cont = getYorN();
} while (cont == 'y');
cout << "Get outta here, ya bum!" << endl;
return 0;
}