Hey guys, im having some problems with adding cards to my Blackjack program and after posting this in visualbasic.net section i was adviced to bring my problem here for help.
At the moment I have labels that act in the place of cards, randomly generating a number and assigning it to the label, but now I want to use pictures and assign the picture a value.
This is the code so far for the card labels:
--------------
Function AddCard()
Dim Value As Integer
Randomize()
Value = (10 * Rnd() + 1)
Return Value
End Function
PlayerCard1.Text = AddCard()
PlayerCard2.Text = AddCard()
PlayerTotal = Val(PlayerCard1.Text) + Val(PlayerCard2.Text)
LblPlayerTotal.Text = PlayerTotal
--------------
At the moment I have labels that act in the place of cards, randomly generating a number and assigning it to the label, but now I want to use pictures and assign the picture a value.
This is the code so far for the card labels:
--------------
Function AddCard()
Dim Value As Integer
Randomize()
Value = (10 * Rnd() + 1)
Return Value
End Function
PlayerCard1.Text = AddCard()
PlayerCard2.Text = AddCard()
PlayerTotal = Val(PlayerCard1.Text) + Val(PlayerCard2.Text)
LblPlayerTotal.Text = PlayerTotal
--------------