DE Random Number tomfoolery

Hi All,

Just a quick note as per the instructions to clarify my understanding of this task.

Firstly I created a Int variable assigned with a Random number using the Random.Range function, from 0 (first position in the array) to the Array Length. This works as it non-inclusive, so the highest number it will pick is the length - 1. then I used this Rand number as a ref in the password assignment as the array position.

In subsequent cases, I also declared again the int variable index, which didn’t work, obvs, as I’d already done this. After realising this I simply removed the “int” from the front to change it to a statement. All worked great.

I also carried out an Update Function check to ensure only the the values required were generated, again using the same technique as above but in the update function. All worked great too, each number occurring roughly the same amount of iterations.

Well Happy.

:smile:

Privacy & Terms