OK.below is my code involving random numbers. now i need to get teh scoring system to work.
these are teh criteria:
Each hand has card points calculated
according to
o J (Jack) has 1 point
o Q (Queen) has 2 points
o K (King) has 3 points
o A (Ace) has 4 points
so this means wen a jack or queen or king or ace appears, it calculates it i.e. if a jack then score is 1 and a queen appears tehn scores are 1 + 2 = 3. therefore score is 3 and so on.
the thing is i dont kno how to code it so tat wen a J or Q or K or A appears it calculates accordingly.
CODE
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
const int card = 13;
const int suit = 4;
const int player = 4;
char *cards[] = {"2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"};
char *suits[] = {"S", "C", "D", "H"};
int i, num, num1, players, numofplayers, points;
int total = 0;
srand(time(NULL));
cout << "Note: S is Spades, C is Clubs, H is Hearts and D is Diamonds\n\n";
cout << "Player 1\n";
for (int i = 0; i < 13; i++)
{
num = rand() % 13;
num1 = rand() % 4;
cout << cards[num] << " of " << "[" << suits[num1] << "]" << ", ";
}
cout << "\nTotal Points: ";
cout << "\n-------------------------------------------";
This post has been edited by noob2007: 14 May, 2007 - 04:17 AM