# Bridge Card Game

• 02-09-2003
IneedHelp
Bridge Card Game
I can not get my program to work for my Computer Science class at all! I have never worked with some of this stuff before because last year all I was introduced to was apstring.cpp and all that garbage. I have never seen std:: and stuff like that. I'm using Borland 5.02 to try and compile the following problem. My professor has already given us a sort function and a working "Card" class. If anyone is interested in helping me please please please instant message me at ParabolaDelusion on AIM.

Here' the problem copied straight from the book::

** Write a program that sorts and evaluates Bridge hands **

The input is a stream of character pairs that represents playing cards. For example,
2C QD TC AD 6C 3D TD 3H 5H 7H AS JH KH
represents the 2 of clubs, queen of diamonds, 10 of clubs, ace of diamonds, and so on. Each pair consists of a rank followed by a suit, where a rank is A, 2,...., 9, T, J, Q, or K, and suit is C, D, H, or S. You can assume each input line has exactly 13 cards and is error-free. Input is terminated by an end-of-file.

For eah line of input, form a hand of 13 cards. Display each hand in a readable form arranged both by suits and by rank within suit (aces are high). Then evaluate the handby using the following standard bridge values:

Aces count 4
Kings count 3
Queens count 2
Jacks count 1
Voids (no cards in a suit) count 3
Singletons (one card in a suit) count 2
Doubletons (two cards in a suit) count 1
Long Suits with more than 5 cards in the suit count 1 for each card over 5 in number

For example, for the previous sample input line, the program should produce the output

**********************************************
CLUBS 10 6 2
DIAMONDS A Q 10 3
HEARTS K J 7 5 3

Points = 16
**********************************************

Because there are two aces, one king, one queen, one jack, one singleton, no doubletons, and no long suits. (The singleton ace of spades counts as both an ace and a singleton.)