Coin flip in visual basic

  • Thread starter Thread starter redraider29003
  • Start date Start date
R

redraider29003

Guest
Hello,

I'm having trouble this coin flip generator. The objective is when a user clicks the "flip coin" button, it stimulates a coin flipping 1000 times and you're supposed to stimulate how many heads and tails you got.

Private Sub btnCoin_Click(sender As Object, e As EventArgs) Handles btnCoin.Click
Dim heads As Integer
Dim tails As Integer
Dim sum As Integer

heads = rndNumber.Next(0, 1000)
tails = rndNumber.Next(0, 1000)
sum = 1000

lblHeads.Text = heads
lblTails.Text = tails

If heads + tails = sum Then
lblHeads.Text = heads.ToString
lblTails.Text = tails.ToString
End If


This is what I have, but it's just printing randoming numbers and not summing up to 1000.


Thanks

Continue reading...
 
Back
Top