How to properly shuffle an array

Shuffling an array can be tricky exercise since you need to take care to┬áhave equal probabilities for all cases. The solution is the Fisher-Yates algorithm, which is implemented below. First method, randomInteger(…), returns… Continue reading