mercredi 26 août 2015

Printing function results into an array

Seems simple but I can't figure it out.

let getRandom = randomSequenceGenerator(min: 1, max: 20)
for _ in 1...20 {
    println(getRandom())
}

getRandom prints out 20 non-repeating numbers into the console... PERFECT.

I want to get those 20 non-repeating numbers into an array so I can use them. I can't seem to figure it out.

Or anyway I can access those 20 numbers other than in the console.




Aucun commentaire:

Enregistrer un commentaire