Post: Any card, pick any card!
02-20-2012, 12:32 AM #1
|C++|
< ^ > < ^ >
(adsbygoogle = window.adsbygoogle || []).push({}); This is a card dealing program i just wrote its pretty cool.
    #include <cstdlib>
#include <iostream>
#include <ctime>
#include <cmath>
using namespace std;

char*suits[]={"Hearts","Diamonds","Spades","Clubs"};
char*ranks[]={"Ace","Two","Three","FOUR","Five","six","seven","Eight","Nine","Ten","jack","queen","king"};

void draw_cards();
int random(int n);

int main(int argc, char *argv[])
{
srand(time(NULL));

int n;
int i;

while(1)
{
cout<<"If you wish to quit at any time hit '0'";
cout<<"\nEnter the number of cards you wish to draw:";
cin>>n;

if(n==0)
break;

for(i=0;i<n;i++){
draw_cards();
}
}

return 0;
}

void draw_cards()
{
int r=random(13);
int s=random(4);
cout<<ranks[r]<<" of "<<suits[s]<<", ";

}

int random(int n)
{
return rand()%n;
}
(adsbygoogle = window.adsbygoogle || []).push({});
02-24-2012, 12:21 AM #2
Convex
Ain't No Telling
Wtf? Where do I put it? How do I use it? If your going to spend the time to make a program, then at least provide some detail. I'm not trying to flame either.
Originally posted by SLiiTH3R View Post
This is a card dealing program i just wrote its pretty cool.
    #include <cstdlib>
#include <iostream>
#include <ctime>
#include <cmath>
using namespace std;

char*suits[]={"Hearts","Diamonds","Spades","Clubs"};
char*ranks[]={"Ace","Two","Three","FOUR","Five","six","seven","Eight","Nine","Ten","jack","queen","king"};

void draw_cards();
int random(int n);

int main(int argc, char *argv[])
{
srand(time(NULL));

int n;
int i;

while(1)
{
cout<<"If you wish to quit at any time hit '0'";
cout<<"\nEnter the number of cards you wish to draw:";
cin>>n;

if(n==0)
break;

for(i=0;i<n;i++){
draw_cards();
}
}

return 0;
}

void draw_cards()
{
int r=random(13);
int s=random(4);
cout<<ranks[r]<<" of "<<suits[s]<<", ";

}

int random(int n)
{
return rand()%n;
}


Forgot to quote

The following user groaned Convex for this awful post:

Epic?
02-24-2012, 02:58 AM #3
|C++|
< ^ > < ^ >
Originally posted by Convex10 View Post
Wtf? Where do I put it? How do I use it? If your going to spend the time to make a program, then at least provide some detail. I'm not trying to flame either.


Forgot to quote


Haha you're obviously a noob, why are you even here, anyone with any sort of computer programming experience knows that you just simply copy and paste the code in your compiler or ide, whatever you use. Things like code blocks, visual c++, dev-c++ etc.
sorry if i offended you but don't knock on people who know what they are doing. And its not anything special that's why i didn't provide an actual link to download, its just for anyone who would like to take a quick look.

The following user thanked |C++| for this useful post:

Pichu

The following 2 users groaned at |C++| for this awful post:

Convex, ILuZzONz
02-24-2012, 07:10 PM #4
Convex
Ain't No Telling
Originally posted by SLiiTH3R View Post
Haha you're obviously a noob, why are you even here, anyone with any sort of computer programming experience knows that you just simply copy and paste the code in your compiler or ide, whatever you use. Things like code blocks, visual c++, dev-c++ etc.
sorry if i offended you but don't knock on people who know what they are doing. And its not anything special that's why i didn't provide an actual link to download, its just for anyone who would like to take a quick look.


Yes I am a noob at Computer Programming or whatever. That's why I wanted you to provide some more information. Maybe it will attract more viewers? Cause looks like this thread is dead. I was just trying to help you out. You spend time to make this shit right? Maybe you should provide some more information. I wasn't trying to be mean. So i'm sorry if I "offended" you.

The following user groaned Convex for this awful post:

Epic?
02-24-2012, 07:21 PM #5
|C++|
< ^ > < ^ >
Originally posted by Convex10 View Post
Yes I am a noob at Computer Programming or whatever. That's why I wanted you to provide some more information. Maybe it will attract more viewers? Cause looks like this thread is dead. I was just trying to help you out. You spend time to make this shit right? Maybe you should provide some more information. I wasn't trying to be mean. So i'm sorry if I "offended" you.


o sorry, okay so what you do si, choose a programming language to learn (preferably c++ ) go buy(i mean pirate) a c++ book, like sams teach yourself c++ in 24 days, or any other c++ book like c++ without fear and when you read it it will not only teach you the language but it will also teach you how to download an ide. or you could just watch a tutorial YouTube, there's plenty there. They even teach you how to get an ide. or you could just download dev c++ or Microsoft visual c++ express(free)
fyi, its not this thread thats dead its the whole section, look at the dates on the latest threads.

The following 2 users say thank you to |C++| for this useful post:

Convex, Pichu
03-11-2012, 06:36 PM #6
Pichu
RIP PICHU.
Originally posted by SLiiTH3R View Post
o sorry, okay so what you do si, choose a programming language to learn (preferably c++ ) go buy(i mean pirate) a c++ book, like sams teach yourself c++ in 24 days, or any other c++ book like c++ without fear and when you read it it will not only teach you the language but it will also teach you how to download an ide. or you could just watch a tutorial YouTube, there's plenty there. They even teach you how to get an ide. or you could just download dev c++ or Microsoft visual c++ express(free)
fyi, its not this thread thats dead its the whole section, look at the dates on the latest threads.


Seriously, this section has died again. It seems like that every couple of months, it gains a lot of attention and then suddenly, it just dies. :/
03-12-2012, 07:36 PM #7
|C++|
< ^ > < ^ >
Originally posted by Sublimity View Post
Seriously, this section has died again. It seems like that every couple of months, it gains a lot of attention and then suddenly, it just dies. :/


i know bro and i tried to post about 3 things and i noticed no replies, i just stopped posting here after that. its pretty annoying
03-12-2012, 08:49 PM #8
Epic?
Awe-Inspiring
Originally posted by Sublimity View Post
Seriously, this section has died again. It seems like that every couple of months, it gains a lot of attention and then suddenly, it just dies. :/


I know what you mean, the popularity of this section is very dynamic, sometimes it seems like there's new posts every hour, and sometimes it goes weeks without posts (and I think the recent domain issues that NGU experienced didn't help much).

Anyways, as long as people post in the computer sections, I'll be lurking with a reply. :p

The following user thanked Epic? for this useful post:

Pichu
03-12-2012, 11:47 PM #9
Pichu
RIP PICHU.
Originally posted by Epic
I know what you mean, the popularity of this section is very dynamic, sometimes it seems like there's new posts every hour, and sometimes it goes weeks without posts (and I think the recent domain issues that NGU experienced didn't help much).

Anyways, as long as people post in the computer sections, I'll be lurking with a reply. :p


Aha, I'm lurking regardless, I like looking at the older stuff, even the stuff I can't comment on. It's sad, it seems like we were getting ready to hit another spike in activity here and then the domain issue hit... forum still seems very empty, all of it. Hopefully people start being more active.

Oh well. Whenever I get the time and make a new application or learn something new and build, I still will be releasing here. Smile

My computer has reached the point where I can hardly even run debugs, excited though because within the next couple of months, I will be getting a laptop, I can then start putting to good use what I know and get into some game development. Plus, I definitely will be getting the ultimate version of Visual Studios with the new laptop so I am not limited on what I can use... Express... Y U LIMIT ME? ... Y U NO LET ME OBFUSCATE MY CODE WITHOUT USING OUTSIDE SOURCE!!! Aha.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo