#include <iostream> // basic i/o
#include <cstdlib> // rand() and srand()
#include <ctime> // system time

using namespace std;

int main(){

	unsigned int die1, die2;
	char choice;
	bool done = false;

	// get system time
	unsigned seed = time(0);
	//seed the random number generator
	srand(seed);

	while(!done){
		cout << "Rolling two die:" << endl;
		die1 = (rand() % 6) + 1;
		cout << die1 << ", ";
		die2 = (rand() % 6) + 1;
		cout << die2 << endl;
		cout << "Total: " << die1 + die2 << endl;

		// prompt to roll again
		cout << "Roll again?(y/n): ";
		cin >> choice;
		if(choice == 'n' or choice == 'N'){
			done = true;
		}
		cout << endl;
	}

	return 0;
}