dimanche 5 février 2017

Fill a 2D array with non-repeating random numbers

I am currently trying to fill up a 2D array with 16 values from 1-16. I want to fill up the array with non-repeating random values.

For example, if I have an array int array[4][4] how would I go through a loop filling the array while checking to make sure that another identical random value isn't placed into another location in the array?




Aucun commentaire:

Enregistrer un commentaire