How do I create an array of randomized pairs of numbers?
Show older comments
So I am working on creating a version of the memory card game where you have say a 4x4 array of tiles, and each one has a matching pair within the array. I am using 8 different colors and 2 tiles for each color. How could I create a random 4x4 array that would only contain the numbers 1 through 8 but each one only 2 times? I assume I'd use randi. I know my title is quite confusing but I couldn't think of an easier description without telling why I needed it. Thank you!
Accepted Answer
More Answers (0)
Categories
Find more on Conway's Game of Life in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!