Help Using Records

Help.
I am trying to write a poker program using records. I need to use a record to store the hands, suit, and card number and read from an external file. I also need to evaluate the two hands, give its value, then determine the winner. Any help would be awesome.

Comments

  • : Help.
    : I am trying to write a poker program using records. I need to use a record to store the hands, suit, and card number and read from an external file. I also need to evaluate the two hands, give its value, then determine the winner. Any help would be awesome.
    :

    Ah, yes. College course, right? I remember having to do that too.

    First thing. Make a record for a single card, suit type, card values, etc, such as :
    [code]
    CONST
    Values : Array[1..13] Of String[2] =
    ('A','2','3','4','5','6','7','8','9','10','J','Q','K');

    TYPE
    Suits = (Hearts,Diamonds,Spades,Clubs);
    Card = record
    Number : Byte;
    Suit : Suits;
    End;
    [/code]

    Then make an array of however many cards you want (52 would be nice). You may want to add Jokers in too. Anyways, here's a start.

    Phat Nat

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion