Results 1 to 19 of 19

Thread: Random numbers, but not the same. [GIVEN UP]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Resolved Random numbers, but not the same. [GIVEN UP]

    OK, I got this code:

    VB Code:
    1. Dim p1 As Integer = RandomNo.Next(0, 4)
    2.     Dim p2 As Integer = RandomNo.Next(0, 4)
    3.     Dim p3 As Integer = RandomNo.Next(0, 4)
    4.     Dim p4 As Integer = RandomNo.Next(0, 4)
    5.     Dim p5 As Integer = RandomNo.Next(0, 4)

    What I want to do, is generate a random number between 0 and 4, yet make none of the choices the same. So what can I do to exclude the numbers from the previous P's as the numbers are generated? This is outside of the Event Procedures so I can't use any Loops to check and corect it. I haven't the slightest clue on how to go about this. Any help appreciated.
    Last edited by martw; May 15th, 2005 at 03:47 AM. Reason: Given Up.
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

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