|
The output was supposed to be
How Many cardds do you want? 3 You: 8 5 1 Computer: 8 3 3 I have 14 and you have 14 so we draw. Would you liek to play again? (Y/)? Y
How Many cardds do you want? 2 You: 7 2 Computer: 8 7 4 I have 19 and you have 9 so I win. Would you liek to play again? (Y/)? Y
How Many cardds do you want? 3 You: 8 7 4 Computer: 2 1 7 I have 10 and you have 19 so you win Would you liek to play again? (Y/)? N
Computer wins:= 1 Your wins= 1 Draws= 1
My problem is I cant get the computer to display the random numbers that the user wants for example if the user enterse 3 cards and I cant get the computer to display 3 numbers
Im new at this so please help!
#include<iostream.h> #include<lvp\random.h> #include<lvp\string.h>
int main ()
{
// lets the computer and user get random numbers//
const int numValue=0; randomize()
int compwin=0; int userwin=0; int cardnum int sum1; int sum2; char play; cardnum==numvalue cout<<"How many cards do yuo want?"; cin>>answer cout<<"You:<<(answer) randomize";// this is where I hve a problem cut<<computer:<<cout.width( 3 *// I cant get this to display three consistently thought out the game for the computer becuase the computer is supposed to have three numbers through out the game!
. . . .
thats all
I can do the rest but only problem is with the loop and displaying random numbers
|