At school we are busy making a Spotify application. I am currently making an application where I get images from LastFM, from the current artist now playing. I get three random images shown.I am now trying to make sure that the 3 random images can’t be the same.
This is what I have at the moment:
var randno = Math.floor ( Math.random() * artistImages.length );
var randno2 = Math.floor ( Math.random() * artistImages.length );
var randno3 = Math.floor ( Math.random() * artistImages.length );
Now I want to make sure that they are not the same. Can anybody help me on how to do this?
Use a while loop: