Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. Public Class Form1
  2.  
  3. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  4. Dim dice4 As Integer
  5. Dim dice6 As Integer
  6. Dim dice12 As Integer
  7.  
  8. Dim dice4a As Integer
  9. Dim dice6a As Integer
  10. Dim dice12a As Integer
  11.  
  12. dice4 = 4
  13. dice6 = 6
  14. dice12 = 12
  15.  
  16. dice4a = 4
  17. dice6a = 6
  18. dice12a = 12
  19.  
  20. Dim guess As Integer
  21. guess = 0
  22. guess = InputBox("What side dice do you want, 4, 6, or 12?")
  23. If guess = dice4 Then
  24. dice4 = Rnd() * 3 + 1
  25. MsgBox("You chose a " & dice4a & " sided dice, and your score was " & dice4)
  26. ElseIf guess = dice6 Then
  27. dice6 = Rnd() * 5 + 1
  28. MsgBox("You chose a " & dice6a & " sided dice, and your score was " & dice6)
  29. ElseIf guess = dice12 Then
  30. dice12 = Rnd() * 11 + 1
  31. MsgBox("You chose a " & dice12a & " sided dice, and your score was " & dice12)
  32. Else
  33. MsgBox("There was an error, please try again!")
  34. End If
  35.  
  36. End Sub
  37. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement