Our system detected that your browser is blocking advertisements on our site. Please help support FoxesTalk by disabling any kind of ad blocker while browsing this site. Thank you.
Jump to content
Trumpet

c++

Recommended Posts

Posted

m_pHand1 is a pointer to a hand of cards. Hand* m_pHand1;

 

Then the getcardatposition() identifies individual cards within that hand 0-4.

Posted
int HandCheck(Card iHand[5])

{

 

//Royal Flush

//return 10;

 

//Straight Flush

//return 9;

 

//Four of a kind

//return 8;

 

//Full House

//return 7;

 

//Flush

//return 6;

 

if(iHand[0].GetSuit() == iHand[1].GetSuit() && iHand[2].GetSuit() == iHand[3].GetSuit() && iHand[3].GetSuit() == iHand[4].GetSuit())

{

cout << "Flush" <<endl;

return 6;

}

 

 

//Straight

//return 5;

 

//Three of a kind

//return 4;

 

//Two Pair

//return 3;

 

//Pair

//return 2;

 

//High Card

//return 1;

return 0;

}

Posted

Had a rethink. The m_pHand doesn't need to be passed to the function, the function just needs to be a member of the class cardgame. Slowly getting there!

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...