Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fisher Yates Shuffle for cards or any number of items
#3
Nearly as fast but you are doing one extra swap.

But more importantly, it is less efficient, you are swapping each time with a random from whole set which can cause ripples or waves that upset a normal distribution. The wiki will confirm this but the math is quite wonky.
https://en.wikipedia.org/wiki/Fisher–Yates_shuffle see Naive method which is yours basically.
b = b + ...
Reply


Messages In This Thread
RE: Fisher Yates Shuffle for cards or any number of items - by bplus - 06-20-2023, 09:33 AM



Users browsing this thread: 3 Guest(s)