I have a Texas Holdem application I've been working on. I've reached the point where I'm looking at the first hand (similar to this 7Q239K6)... I'm trying to sort it to look like..... KQ97632. I've worked with bubble sort before, but I've slept since then. After two days of working with the following code, I NEED HELP !
CODE
For i = 1 To 7
hand(i) = Mid(Table_Surface.Text3(x + 10), i, 1)
Next
t = 1
swap = 1
Do Until t = 7
For y = 1 To 7
If hand(t) < hand(t + 1) Then
HC = hand(t + 1): LC = hand(t)
hand(t) = HC: hand(t + 1) = LC
t = t + 1
Else
t = t - 1
SortedHand = SortedHand + hand(t)
End If
Next
Loop
For i = 1 To 7
Texas_Holdem.Text3(x) = Texas_Holdem.Text3(x) & hand(i)
Next
I'm working with two forms..Table_Surface.Text3() and Texas_Holdem.Text3().
The first loop works fine and sets the hand up as dealt.
The next do/loop seems to be where the problem is.
The last loop will fill the textbox with sorted hand...........I HOPE.
This my first or second post, so I hope I have the Code area set up to display correctly
Any help will be much appreciated
Thanks
ca2nv