For a task I have been asked the following:
Write a program that evaluates a single poker hand. Display the hand and print out what type it is. The ranks of hands are listed below from highest ranking to lowest ranking.
Use a structure for the card, and an array of structures for the hand. You should write a method for each type of hand, returning true if the hand fits that criterion, and false if it doesn’t.
The structure you will use should look something like the following:
public struct card
{
public char suit; // 'C', 'D', 'H', 'S' - for clubs, diamonds, hearts, and spades
public int value; //2-14 – for 2-10,Jack, Queen, King, Ace
};
struct card hand[5];
External txt files have been assigned for us to use that appear like this :
C 13 H 13 D 13 C 10 H 10
I have managed to read the text files into my program, but I am unsure as what to do with this. The array of structures would be like:
(C 13)(H 13)(D 13)(C 10)(H 10)
Not quite sure how to transfer the line of text from the file into this type of format, any help is appreciated, cheers :)