Click here to Skip to main content
15,915,324 members
Home / Discussions / C#
   

C#

 
QuestionCpu temperature Pin
methhoo12-Sep-08 14:49
methhoo12-Sep-08 14:49 
AnswerRe: Cpu temperature Pin
Mark Salsbery12-Sep-08 15:25
Mark Salsbery12-Sep-08 15:25 
QuestionConvering treeView.Nodes to contextMenuStrip.Items? Pin
Mohammad Dayyan12-Sep-08 13:13
Mohammad Dayyan12-Sep-08 13:13 
QuestionGetting HTML source of a frame using the WebBrowser windows form object Pin
Jay Gatsby12-Sep-08 12:19
Jay Gatsby12-Sep-08 12:19 
QuestionI need Help passing data back and forth between Windows forms Pin
chobo212-Sep-08 12:08
chobo212-Sep-08 12:08 
AnswerRe: I need Help passing data back and forth between Windows forms Pin
Jay Gatsby12-Sep-08 12:40
Jay Gatsby12-Sep-08 12:40 
GeneralRe: I need Help passing data back and forth between Windows forms Pin
nelsonpaixao12-Sep-08 15:02
nelsonpaixao12-Sep-08 15:02 
AnswerRe: I need Help passing data back and forth between Windows forms Pin
DaveyM6913-Sep-08 2:30
professionalDaveyM6913-Sep-08 2:30 
QuestionDataGridViewComboBoxColumn is not showing DisplayMember on moving to other column Pin
nishantkainth12-Sep-08 10:51
nishantkainth12-Sep-08 10:51 
QuestionHow can we find WindowState changes ? Pin
Mohammad Dayyan12-Sep-08 10:16
Mohammad Dayyan12-Sep-08 10:16 
AnswerRe: How can we find WindowState changes ? Pin
User 665812-Sep-08 10:30
User 665812-Sep-08 10:30 
GeneralRe: How can we find WindowState changes ? Pin
Mohammad Dayyan12-Sep-08 10:53
Mohammad Dayyan12-Sep-08 10:53 
GeneralRe: How can we find WindowState changes ? Pin
User 665812-Sep-08 11:17
User 665812-Sep-08 11:17 
GeneralRe: How can we find WindowState changes ? Pin
Mohammad Dayyan12-Sep-08 11:20
Mohammad Dayyan12-Sep-08 11:20 
QuestionCancel event Pin
netJP12L12-Sep-08 9:38
netJP12L12-Sep-08 9:38 
AnswerRe: Cancel event Pin
User 665812-Sep-08 10:26
User 665812-Sep-08 10:26 
QuestionBlackjack help needed Pin
Member 395831212-Sep-08 8:51
Member 395831212-Sep-08 8:51 
AnswerRe: Blackjack help needed Pin
Guffa12-Sep-08 9:08
Guffa12-Sep-08 9:08 
GeneralRe: Blackjack help needed Pin
Member 395831212-Sep-08 9:15
Member 395831212-Sep-08 9:15 
AnswerRe: Blackjack help needed Pin
Robert.C.Cartaino12-Sep-08 9:31
Robert.C.Cartaino12-Sep-08 9:31 
Member 3958312 wrote:
please help me with this thank you


This is just wrong all over.

First off, selecting a random rank (string[] card) and a random suit (string[] cardSuits) to create a card is a bad idea. What if you pick the same card twice in one hand? How will you remove cards from a "deck" as they are dealt. You better rethink your object design.

Second, your cardvalues array is wrong. For example, let's say your random number for the card rank is "0" (which, by the way, you don't save anywhere). You have string card[0] == "Two " but int cardvalues[0] = 1. That's wrong.

I'm not saying this is the best design, but start with something like:
cardID = random.Next(0,52);  // pick a card
cardSuit = cardID / 13;      // calculate card rank (hearts=0, spades=1, etc)
cardRank = cardID % 13;      // calculate card suit (two=0, three=1, four=2, etc)
blackjackValue = cardValues[cardRank];   // but fix the array first { 2,3,4,5,6,7,8,9,10,10,10, (11 or 1)}

GeneralRe: Blackjack help needed Pin
Member 395831212-Sep-08 9:51
Member 395831212-Sep-08 9:51 
QuestionError: 'Table' does not contain a definition for 'BorderStyle' Pin
A.Asif12-Sep-08 7:57
A.Asif12-Sep-08 7:57 
AnswerRe: Error: 'Table' does not contain a definition for 'BorderStyle' Pin
Guffa12-Sep-08 8:56
Guffa12-Sep-08 8:56 
GeneralRe: Error: 'Table' does not contain a definition for 'BorderStyle' Pin
A.Asif12-Sep-08 9:30
A.Asif12-Sep-08 9:30 
GeneralRe: Error: 'Table' does not contain a definition for 'BorderStyle' Pin
Dave Kreskowiak12-Sep-08 10:50
mveDave Kreskowiak12-Sep-08 10:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.