1

I am trying to create a random number generator in a matrix but with no duplicates. I can create the randomness, but not the uniqueness, does anyone have any ideas?

Sub makeInitialSolution(Sol() As Integer, numSlots As Integer, numRooms As Integer, numExams As Integer)

Dim i As Integer, j As Integer

For i = 1 To 3
    For j = 1 To 3

        Sol(i, j) = Int((8 - 1 + 1) * Rnd + 1)

    Next j
Next i

Sol(i - 1, j - 1) = -1

End Sub
Scott Craner
  • 148,073
  • 10
  • 49
  • 81
Helen
  • 11
  • 1

0 Answers0