How do I add another Function and make this game loop I want to use a while loop //Nicholas Crowe
// Die Roller
// Demonstrates generating random numbers
#include <iostream>
#include <cstdlib>
#include <ctime>
usingnamespace std;
int main()
{
using std::cout;
using std::cin;
char n;
cout << " Welcome to Die Roller\n";
cout << " Press Enter to roll again or press q then enter to exit\n";
srand(time(0)); // seed random number generator based on current time
int randomNumber; // generate random number
int die;
//right here
while(n != 'q')
{
randomNumber = rand();
die = (randomNumber%6+1); // get a number between 1 and 6
cout << "You rolled a " << die << endl;
n = getchar();
}
getchar();
return 0;
}