/*****************************************************************************************
* File: roll.cpp
* Directory: F:\cs1302\CPP-Projects\Roll
* Written by Michael Main (January 8, 2026)
*
* A program to give the result of a roll of a die with n sides,
* where n is an input value from the keyboard.
*/

// Directives:
#include <cstdlib>    // for EXIT_SUCCESS and the rand function
#include <iostream>   // for cout and cin
#include <winbgim.h>  // for only the simple delay function
using namespace std;

//----------------------------------------------------------------------------------------
int main( )
{
    int n; // sides on a die
    
    cout << "Please type the number of sides on a die: ";
    cin >> n;
    cout << "I shall now roll a die with " << n << " sides." << endl;

    cout << "The die says ";

    cout << ". ";
    delay(1000);
    
    cout << ". ";
    delay(1000);
    
    cout << ". ";
    delay(1000);

    srand(time(NULL)); // Use the number of seconds since the start of 1970.
    cout << (rand( ) % n) + 1 << endl;
    
    return EXIT_SUCCESS;
}
    

