Here's the code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int Random( int, int );
int main()
{
//---- Initialization-------------------------------------------------
int low;
int high;
int chips = 1000;
int hold = 0;
bool quit = false;
//----End Init--------------------------------------------------------
// Start Game---------------------------------------------------------
while( !quit ){
//----Menu--------------------------------------------------------
while( hold <= 0 )
{
cout << "Player's chips: $" << chips << endl;
cout << "1) Play slot. 2) Exit." << endl;
cin >> hold;
if ( hold == 1 )
break;
if ( hold == 2 )
quit = true;
else
cout << "Please select a valid option" << endl;
}
//----End Menu----------------------------------------------------
}
cin.get();
cin.get();
return 0;
//---End Game---------------------------------------------------------
}
int Random( int low, int high )
{
srand(time(0));
int a = (rand() + low) % high;
return a;
}
Edited by afmack, 23 June 2012 - 03:31 AM.






