Highest Card Wins

Hey guys, I am working on an assignment that is using structures.
Basically all I need to do is assign one card to the "player" and one card to the "computer". Then check to see which card value is greater and that be the winner.
I also need to use random number generator to get the card number and suit for both computer and user. If they have the same card they need to both draw another. Also I should add a loop to allow them to play again.
I can get most of this down, just need help. My instructor isn't that helpful, nor is available for questions "Great class...."

Here is what I got to work with.
I figured I could use srand/rand to get random card # and suit.

[code]
#include <iostream>
using namespace std;
const int clubs = 0; //suits
const int diamonds = 1;
const int hearts = 2;
const int spades = 3;
const int jack = 11; //face cards
const int queen = 12;
const int king = 13;
const int ace = 14;
////////////////////////////////////////////////////////////////
struct card
{
int number; //2 to 10, jack, queen, king, ace
int suit; //clubs, diamonds, hearts, spades
};
////////////////////////////////////////////////////////////////
int main()
{
card temp, chosen, prize; //define cards
int position;
card card1 = { 7, clubs }; //initialize card1
cout << "Card 1 is the 7 of clubs\n";
card card2 = { jack, hearts }; //initialize card2
cout << "Card 2 is the jack of hearts\n";
card card3 = { ace, spades }; //initialize card3
cout << "Card 3 is the ace of spades\n";
prize = card3; //copy this card, to remember it
cout << "I
Oh and by the way, I am not asking anyone to do this for me. Just when I post a code segment and have a question I was just wondering if you could point me in the right direction.
Topic archived. No new replies allowed.