Skip to content

Instantly share code, notes, and snippets.

@tinwritescode
Created July 11, 2020 06:33
Show Gist options
  • Save tinwritescode/7476fdfbab453d744f76a053a5e2c99e to your computer and use it in GitHub Desktop.
Save tinwritescode/7476fdfbab453d744f76a053a5e2c99e to your computer and use it in GitHub Desktop.
dice
#include <iostream>
#include "Dice.h"
#include "../Random/Random.cpp"
using namespace std;
int main()
{
Dice dice;
char option;
while (true)
{
cout << "Roll the dice? (Y/n)" << endl;
cin.get(option);
if (tolower(option) != 'n')
{
system("cls||clear"); // Clearing screen
cout
<< "You got " << dice.Roll() << endl
<< "-----------------------------" << endl;
cout
<< "Number of roll:\t\t" << dice.GetRollTime() << endl
<< "Roll average:\t\t" << dice.GetRollAverage() << endl;
dice.ShowStatistic();
cout << "-----------------------------" << endl;
}
else
{
cout << "Goodbye!" << endl;
break;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment