// A Random Dice Roller
// Date 02:16 30/11/2016
// By Ben a.k.a DreamVB

#include <iostream>
#include <time.h>

using namespace std;
using std::cout;
using std::endl;

int main(int argc, char *argv[]){
	bool Running = true;
	string Sides[7];
	int Roll = 0;
	char c = '\0';
	
	//The dice sides.
	Sides[0] = " Ŀ\n         \n    0   \n        \n ";
	Sides[1] = " Ŀ\n    0    \n        \n    0   \n ";
	Sides[2] = " Ŀ\n   0     \n    0   \n     0  \n ";
	Sides[3] = " Ŀ\n   0 0   \n        \n   0 0  \n ";
	Sides[4] = " Ŀ\n   0 0   \n    0   \n   0 0  \n ";
	Sides[5] = " Ŀ\n   0 0   \n   0 0  \n   0 0  \n ";
	
	//Get random seed of time.
	srand(time(0));

	while (Running){
		system("cls");
		//Menu system
		cout << "------ The Dice -------" << endl;
		cout << " [A] About" << endl;
		cout << " [R] Roll the dice" << endl;
		cout << " [Q[ Quit" << endl;
		cout << "-----------------------" << endl;
		cout << " Enter choice : ";
		cin >> c;
		//Convert char to uppercase
		c = toupper(c);

		switch (c){
		case 'A':
			//Display about info
			system("cls");
			cout << "---- ABOUT ----" << endl << endl;
			cout << "Random dice by roller Version 1.0\n\tDeveloped by DreamVB"
				<< endl << endl;
			break;
		case 'R':
			//Return random number between 0 and 5
			Roll = rand() % 6;
			//Display th dice side.
			cout << Sides[Roll].c_str() << endl;
			break;
		case 'Q':
			//Quite
			cout << endl << " Thanks for trying the program." << endl;
			//Stop the loop
			Running = false;
			break;
		default:
			//Display error message.
			cout << " Invaild choice." << endl;
			cin.ignore();
			cin.clear();
			break;
		}
		system("pause");
	}

	return EXIT_SUCCESS;
}