Advertisement

Memory match Algorithm

Started by September 02, 2017 08:34 AM
4 comments, last by behdadsoft 7 years, 3 months ago

Hi.

I want make Memory match game but i don't know what is algorithm for generate random picture without repeating more than two time.

anyone can guide me?

Thanks.

Do you mean generate (create from scratch), or do you mean choose randomly?

 

If you mean choose randomly, you can look into various shuffle algorithms, e.g. this one:

https://en.wikipedia.org/wiki/Fisher–Yates_shuffle

Hello to all my stalkers.

Advertisement

I want choose randomly without repeating.

what is scratch?

34 minutes ago, behdadsoft said:

I want choose randomly without repeating.

Then you want to shuffle. Take a look at the link I posted :)

Take your list of images (2 of each image in the list because you want to find a pair), and then shuffle the list.

 

35 minutes ago, behdadsoft said:

what is scratch?

"Create from scratch" means "to create something from nothing". In this case, starting with a blank image, and creating/painting an image using just code. But this wasn't what you wanted to do, so don't worry about it =)

Hello to all my stalkers.

Thanks @Lactose.

 

This topic is closed to new replies.

Advertisement