C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-04-2009, 04:34 PM   #1
Registered User
 
Join Date: Nov 2009
Posts: 2
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...
cutechocolateka is offline   Reply With Quote
Old 11-04-2009, 04:38 PM   #2
Super Moderator
 
Join Date: Sep 2001
Posts: 4,680
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.
sean is offline   Reply With Quote
Old 11-04-2009, 04:56 PM   #3
Registered User
 
Join Date: Nov 2009
Posts: 2
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?
cutechocolateka is offline   Reply With Quote
Old 11-05-2009, 02:32 AM   #4
Confused
 
Magos's Avatar
 
Join Date: Sep 2001
Location: Sweden
Posts: 3,122
An integer counter? Increase by 1, and when it hits 4, stop?
__________________
MagosX.com

Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Magos is offline   Reply With Quote
Old 11-05-2009, 11:06 PM   #5
eh ya hoser, got a beer?
 
stumon's Avatar
 
Join Date: Feb 2003
Posts: 287
Turn that into code that will compile.

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

   while (totalNumber < 300)
   {
   for(int i = 0; i < 4; i++)
      {
         input = console.readline();

         if (input == 'd')
         {
            totalNumber += randomNumber;
         }
      }

      console.writeline("Your total points with 4 more cards is {0}", totalNumber);
   }

   console.writeline("You got to 300");
}
__________________
The keyboard is the standard device used to cause computer errors!
stumon is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump


All times are GMT -6. The time now is 03:40 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22