Results 1 to 1 of 1

Thread: Visual Basic Dice simulation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    HappeR's Avatar Semisalis
    Join Date
    Jan 2006
    Location
    the Netherlands
    Posts
    467

    Default Visual Basic Dice simulation

    Hey ya!

    I am having serious problems with simulating a dice thrown in Visual Basic (the one in Excel). I want the number to appear in a textblock (called txt1).

    The code I am using right now is:

    txt1 = Int(6 - 1 + 1) * Rnd + 1

    The problem with this code is that it DOES create numbers ranging from 1 to 6, but it makes those numbers with a 'comma' (is that the right word?). So in short I get 2,4 and 6,9 and stuff.

    My question is: How do I create a code that makes the numbers from 1 to 6 in the textblock without the 'comma'.

    The person who tells me the right thing will get:

    -My eternal thankfulness
    -a rep point

    EDIT: I don't need the code anymore, just got it through another way
    Last edited by HappeR; May 19, 2006 at 05:06 AM.

Posting Permissions

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