please help me my program is done all i need is to make random numbers, but for some reason i keep on getting the same number over and over heres the code for a part of this program
Code:
#include <iostream>
#include <iomanip>
#include <ctime>
using namespace std;
int main(void)
{
double dPot=100.0; //Starting Pot Size
double dBet=0.0; //Bet that user inputs
int iHand=0; //Addidtion of users cards
char cAns; //answer either y/n
srand((unsigned)time(NULL));
unsigned int uiHand=0,uiCurrentCard=0,uiDealer=16;
uiCurrentCard= rand()%10;
//users card
cout <<"\t\t\t\tWelcome to 21!\n\n\n";//title
//getting users Bet
do{
cout<<"You have " <<dPot<< " dollars to bet with\n\n";
cout<<"How much would you like to bet? ";
cin>>dBet;
//make sure its a vaild bet and pass all tests
while((dBet<=0)||(dBet>dPot)||(cin.fail()))
{
cin.clear();
cin.ignore(cin.rdbuf()->in_avail(),'\n');
cout<<"Sorry that was an invaild bet.\n";
cout<<"How much would you like to bet? ";
cin>>dBet;
}
//give Player first Card Ask him if he wants another
so when i cout uiCurrentCard i always get the same number thro the program why is that?