Results 1 to 3 of 3

Thread: Random numbers

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    Québec, Canada
    Posts
    131

    Random numbers

    I need help with my program: I need the program to generate 4 numbers from 1 to 6 without any decimal. Can someone give me codes to do it please?
    Khavoerm Irithyl

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    VB Code:
    1. Dim x As Integer, intNum As Integer
    2.  
    3. Randomize Timer 'edit
    4.  
    5. For x = 1 To 4
    6.  
    7.   intNum = Int((6 * Rnd)+1)
    8.  
    9.   MsgBox intNum
    10.  
    11. Next x

    I believe that works
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    Québec, Canada
    Posts
    131
    Thanks, it work!!!
    Khavoerm Irithyl

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