0

Javascript on repeat image generator

I want to write an image generator, there are 10 images in total and it will display 5 images randomly each time without repeating, how do I do that???

7th Dec 2019, 10:50 PM
Maple
2 Answers
0
Make an array of all images and use Array_name[math.floor(math.random()*array.length)] Not sure if the formula is correct, but try it
7th Dec 2019, 11:19 PM
Mirielle
Mirielle - avatar
0
But you can't guarantee math.random() does not generate same numbers, right?😓
8th Dec 2019, 3:04 PM
Maple