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.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Weighted Random number about a Center bplus 3 952 01-25-2023, 06:45 PM
Last Post: bplus
  Drop down (& up) number pad OldMoses 1 775 09-24-2022, 03:37 PM
Last Post: mnrvovrfc

Forum Jump:


Users browsing this thread: 1 Guest(s)