Created
July 11, 2020 06:33
-
-
Save tinwritescode/7476fdfbab453d744f76a053a5e2c99e to your computer and use it in GitHub Desktop.
dice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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