Eventing a Matching Card Game

Hello everyone!

I want to make one of those basic "Match 2" card minigames for my game. I guess I'm a little stumped at what the best way to randomly distribute the cards on the table would be. I plan on having it be a 3 x 8 grid, so 24 cards at the hardest difficulty.

Here is a video reference.

My first thought was to use the random number generator to call a random layout- but how do I stop duplicates? or more specifically- only have one duplicate to match?
Sorry about double posting, but I figured I would answer my own question since I found a solution, I basically used this tutorial as a base.



I used the method twice- once for each card position on the table, and again to select the card's face.

Original thread: https://forums.rpgmakerweb.com/threads/eventing-a-matching-card-game.133390/