3 ms·
So what happens in your code if you just change the line j = random(0,51) to j = random(i,51) ?
by Kim_Bruning 4y ago
So what happens in your code if you just change the line
j = random(0,51)
to
j = random(i,51)
?
- tzs 4y agoThat is indeed the simplest fix. It is called the Fisher-Yates shuffle [1]. [1] https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#T...
- Kim_Bruning 4y agoThank you! I now have a bunch of theory to read through that I hadn't encountered before. And I also have some more to think about how I assess people's skills too.