# how to do the card count and how to make the computer add the cards number?

• 11-04-2009
cutechocolateka
how to do the card count and how to make the computer add the cards number?
The player have to type D 4 times to choose 4 card (card number1-13).. I don't know how to make the computer count the card and make the computer add the card number to the total pts.. please help...
• 11-04-2009
sean
That's an extremely vague question. You need to provide more details about what you're trying to do, what you don't understand, and what your question is.
• 11-04-2009
cutechocolateka
The players have to draw 4 cards.... (press d 4 times)
And the cardnumber of each 4 cards is the player turn pts.. (add all the cards number) to get 300 pts to win..
how to make the computer add the number of these 4 cards?
when player press d it just continued giveing the random numbers and its never stop how to make it stop when it get 4 cards?
• 11-05-2009
Magos
An integer counter? Increase by 1, and when it hits 4, stop?
• 11-05-2009
stumon
Turn that into code that will compile.

Code:

public Method()
{
counter = 0;
totalNumber = 0;

while (totalNumber < 300)
{
for(int i = 0; i < 4; i++)
{