Results 1 to 2 of 2

Thread: coding needed for randomising.

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2005
    Posts
    1

    coding needed for randomising.

    does anyone here know the code for this problem?

    i need to randomly generate 8 cards from a deck of 52 cards using a 2 dimentional array. it then has to automatically put those 8 numbers into 8 seperate text boxes. it then has to compare the first 4 cards to the second 4 cards and display a message box if two or more pairs are found.

    thanks all so much.

    Shei

  2. #2
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: coding needed for randomising.

    Well, generating the random number is simple:

    VB Code:
    1. Int(52 * Rnd + 1)

    All you need to do is repeat that a x number of times (Say in a For...Next loop) and then use the generated numbers to grab the data from the array

    Cheers,

    RyanJ
    My Blog.

    Ryan Jones.

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