Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,268 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,465 people online right now. Registration is fast and FREE... Join Now!




BlackJack Project

 
Reply to this topicStart new topic

BlackJack Project, Functions,Random,Loops

deafrulers
7 Nov, 2006 - 12:52 PM
Post #1

New D.I.C Head
*

Joined: 7 Nov, 2006
Posts: 1


My Contributions


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


User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/4/08 07:41PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month