Click here to Skip to main content
14,931,965 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can we find WindowState changes ? Pin
User 665812-Sep-08 11:17
MemberUser 665812-Sep-08 11:17 
GeneralRe: How can we find WindowState changes ? Pin
Mohammad Dayyan12-Sep-08 11:20
MemberMohammad Dayyan12-Sep-08 11:20 
QuestionCancel event Pin
netJP12L12-Sep-08 9:38
MembernetJP12L12-Sep-08 9:38 
AnswerRe: Cancel event Pin
User 665812-Sep-08 10:26
MemberUser 665812-Sep-08 10:26 
QuestionBlackjack help needed Pin
Member 395831212-Sep-08 8:51
MemberMember 395831212-Sep-08 8:51 
AnswerRe: Blackjack help needed Pin
Guffa12-Sep-08 9:08
MemberGuffa12-Sep-08 9:08 
GeneralRe: Blackjack help needed Pin
Member 395831212-Sep-08 9:15
MemberMember 395831212-Sep-08 9:15 
AnswerRe: Blackjack help needed Pin
Robert.C.Cartaino12-Sep-08 9:31
MemberRobert.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
MemberMember 395831212-Sep-08 9:51 
QuestionError: 'Table' does not contain a definition for 'BorderStyle' Pin
A.Asif12-Sep-08 7:57
MemberA.Asif12-Sep-08 7:57 
AnswerRe: Error: 'Table' does not contain a definition for 'BorderStyle' Pin
Guffa12-Sep-08 8:56
MemberGuffa12-Sep-08 8:56 
GeneralRe: Error: 'Table' does not contain a definition for 'BorderStyle' Pin
A.Asif12-Sep-08 9:30
MemberA.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 
QuestionC# How to convert a string from English to Japanese ? Pin
SRogers8812-Sep-08 7:07
MemberSRogers8812-Sep-08 7:07 
AnswerRe: C# How to convert a string from English to Japanese ? Pin
Guffa12-Sep-08 9:00
MemberGuffa12-Sep-08 9:00 
GeneralRe: C# How to convert a string from English to Japanese ? Pin
SRogers8812-Sep-08 9:14
MemberSRogers8812-Sep-08 9:14 
GeneralRe: C# How to convert a string from English to Japanese ? Pin
Xargo12-Sep-08 9:41
MemberXargo12-Sep-08 9:41 
GeneralRe: C# How to convert a string from English to Japanese ? Pin
SRogers8812-Sep-08 9:57
MemberSRogers8812-Sep-08 9:57 
GeneralRe: C# How to convert a string from English to Japanese ? Pin
Dave Kreskowiak12-Sep-08 10:42
mveDave Kreskowiak12-Sep-08 10:42 
AnswerRe: C# How to convert a string from English to Japanese ? Pin
Michael Dunn12-Sep-08 11:35
sitebuilderMichael Dunn12-Sep-08 11:35 
QuestionChanging the ownership of files and folders Pin
lane0p212-Sep-08 6:40
Memberlane0p212-Sep-08 6:40 
AnswerRe: Changing the ownership of files and folders Pin
Mbah Dhaim12-Sep-08 7:18
MemberMbah Dhaim12-Sep-08 7:18 
GeneralRe: Changing the ownership of files and folders Pin
lane0p212-Sep-08 11:32
Memberlane0p212-Sep-08 11:32 
QuestionXML with Inheritance [modified] Pin
Techspoke112-Sep-08 6:35
MemberTechspoke112-Sep-08 6:35 
AnswerRe: XML with Inheritance Pin
Erik Westermann12-Sep-08 10:03
professionalErik Westermann12-Sep-08 10:03 

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.