By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,661 Members | 779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,661 IT Pros & Developers. It's quick & easy.

Need helps with my poker hands evaluation code

P: 1
Here is what I have so far
Expand|Select|Wrap|Line Numbers
  1.  Public Class PokerHands
  2.  
  3. Sub InputFormat() 'Function to remove space and change characters to UPPER CASE
  4.         InputDisplay.Text = InputDisplay.Text.Replace(" ", "").Replace(",","").ToUpper
  5.     End Sub
  6.  
  7.     Sub FourOfaKind() 'Four of a Kind
  8.  
  9.     End Sub
  10.  
  11.     Sub ThreeOfaKind() 'Three of a Kind
  12.  
  13.     End Sub
  14.  
  15.     Sub Pair() 'A pair
  16.  
  17.     End Sub
  18.  
  19.     Sub Flush() 'A flush
  20.  
  21.     End Sub
  22.  
  23.     Sub Straight() ' A straight, if ace is low
  24.  
  25.     End Sub
  26.  
  27.     Sub AceStraight() 'An ace-high straight; 10, J, Q, K, A
  28.  
  29.     End Sub
  30.  
  31.  
  32.     Private Sub InputDisplay_TextChanged(ByVal sender As Object, e As EventArgs) Handles InputDisplay.TextChanged
  33.  
  34.  
  35.  
  36.     End Sub
  37.  
  38.     Private Sub Button1_Click(ByValsender As Object, e As EventArgs) Handles Button1.Click
  39.         Dim hands(4, 13) As Integer 'Example: If (2,11) = 1 then is JD
  40.         Dim SuitsValue() As String = {"S", "D", "C", "H"}
  41.  
  42.         Dim FaceValue() As String = {"2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K", "A"}
  43.     End Sub
  44.  
  45.  
  46. End Class
  47.  
Hi here is what I have my code so far. My question is how to make the program reads the user input "InputDisplay" and then display the corresponding string from the array SuitsValue and FaceValue to the listbox "OutputDisplay". For example: if the user input "aH, AS, 2D, 3C, 4C" the program will return ace of hearts, ace of spades, two of diamonds, three of clubs, and four of clubs? Also how can the program will recognize that the first letter (substring (0,1) is the FaceValue and the second letter substring(1,1) is the SuitsValue? I understand I will need a loop function to determine all five. I am sorry if I am asking stupid questions here but I am really stuck!!!

Thank you very much!
Jul 14 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.