hello,
I wana show the cards in randomly from the array when I click the start button. ex: I have 12 picture boxes. and if click the button , the randomize cards come out to those boxes. How should I do ? :eek:

hello,
I wana show the cards in randomly from the array when I click the start button. ex: I have 12 picture boxes. and if click the button , the randomize cards come out to those boxes. How should I do ? :eek:

use the random function, start the seed at 0 and to end at 11.

use the randome->next function, have a function to check to see whether or not the number generated or not has been used, so you would probably want an array that was 12 long (0-11) to store each random number as it was generated.

if the number generated matches a number in the array generate another and check again, if not break out and allow the random image to be placed.

hows that?

i've done it before but with random letters that i generated for a game i wrote.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.