I want to make a program where on a 8x8 2D array, I input an integer from 0 to 64, and it will place that amount of 'Z' on the array randomly. I can't figure out how to generate a loop of pair of random numbers that do not have any duplicate pairs. Since the pair of random numbers generate will represent the position in the 2D array where the 'Z' will be placed, there should be no duplicate pairs generated so that all the 'Z' are printed.
Aucun commentaire:
Enregistrer un commentaire