Results 1 to 8 of 8

Thread: add two 6 sided dice rolls

Threaded View

  1. #1

    Thread Starter
    Member rockyamyx's Avatar
    Join Date
    Nov 2010
    Posts
    62

    add two 6 sided dice rolls

    VB.NET Code:
    1. Dim myRandomGenerator As System.Random
    2.         'roll1
    3.         Dim r1 As Integer
    4.         'roll2
    5.         Dim r2 As Integer
    6.         myRandomGenerator = New System.Random
    7.         Label1.Text = myRandomGenerator.Next(1, 7)
    8.         Label2.Text = myRandomGenerator.Next(1, 7)
    9.  
    10.         r1 = Val(Label1.Text) 'val()change text to number 'change what control you want (textbox, label, ect)
    11.         r2 = Val(Label2.Text) 'val()change text to number 'change what control you want(textbox, label, ect)
    12.         Label3.Text = r1 + r2 'add the two random numbers


    this is the easiest way i know of.. found a one random number generator on msdn student learning center and made a second one ^^
    Last edited by rockyamyx; Dec 2nd, 2010 at 03:44 PM. Reason: Forgot to wrap code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width