randomCard = randomGenerator.Next(1, 5)
example:
click button "DEAL"
textbox 1 fills in with "3"
textbox 2 fills in with "1"
textbox 3 fills in with "2"
textbox 4 fills in with "4"
I want this is a while loop too I think...
---
Here is what I have/trying to do currently working with just "aces" card type and dealing 2 cards for player 1...
I have a dummy picture box which generates a card but I want that dummy card to pass off its image to "P1C1 = player 1 card 1" and then I want it too generate another random number again but it cannot be the came number as the card is already dealt down...this new number should be different and then deal to "P1C2 = player 1 card 2"
Private Sub GenerateRandomNumber() 'generates random numbers Dim count As Integer = 0 Dim cardUsed As Integer = 0 While cardUsed = 0 randomCard = randomGenerator.Next(1, 5) count = count + 1 cardUsed = cardUsed + 1 If randomCard = 1 And cardUsed = 1 Then xCard.Image = xAceClubs.Image ElseIf randomCard = 2 Then xCard.Image = xAceSpades.Image ElseIf randomCard = 3 Then xCard.Image = xAceHearts.Image ElseIf randomCard = 4 Then xCard.Image = xAceDiamonds.Image End If If count = 1 Then xP1C1.Image = xCard.Image End If If count = 2 Then xP1C2.Image = xCard.Image End If End While
This post has been edited by XMEGA: 17 November 2008 - 11:55 AM


Reply






MultiQuote






|