Welcome to Dream.In.Code
Getting C++ Help is Easy!

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




deck of cards shuffle randomly and pull new one off top

 
Reply to this topicStart new topic

deck of cards shuffle randomly and pull new one off top, Crazy eights

ree9196
2 Apr, 2008 - 07:53 PM
Post #1

New D.I.C Head
*

Joined: 2 Apr, 2008
Posts: 1

cpp

void shuffle()
{
for (counter = 0; counter < 120; counter++)
{
randNum1 = (rand() % 50);
randNum2 = (rand() % 50);
Temp[0].value = 0;
Temp[0].type = "";

cout << "Random Generated Number Is: " << randNum1 << " " <<
randNum2 << endl;

Temp[0] = Deck[randNum1];
Deck[randNum2] = Deck[randNum1];
Deck[randNum1] = Temp[0];
}

for (counter = 0; counter < 52; counter++)
{

cout << "Point Value: " << Deck[counter].value << "\t\t Type: "
<< Deck[counter].type << "\t\tElement location: " << counter
<< endl;

//for (long int i = 0; i <= 90000001; i++)
//;
}
};

*edit: Please use code tags in the future, thanks! code.gif

This post has been edited by Martyr2: 2 Apr, 2008 - 09:41 PM
User is offlineProfile CardPM
+Quote Post

MikeRaines
RE: Deck Of Cards Shuffle Randomly And Pull New One Off Top
2 Apr, 2008 - 08:05 PM
Post #2

D.I.C Head
**

Joined: 30 Oct, 2007
Posts: 76



Thanked: 1 times
My Contributions
Hi,

Is there a problem with the code or question you would like help with?

Mike
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Deck Of Cards Shuffle Randomly And Pull New One Off Top
2 Apr, 2008 - 09:30 PM
Post #3

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,465



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
code.gif

Plus, I don't see a main loop.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/3/08 12:04AM

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