Can ChatGPT’s Take on Fischer-Yates Shuffling Be Challenged?

0
1
Asked By CuriousCoder99 On

I was running a simulation for N games where I'm shuffling a set of K objects using the Fischer-Yates algorithm. When I consulted ChatGPT about it, it told me I couldn't re-shuffle an already shuffled deck. It suggested I copy the original array into a new one before passing it to the shuffle function, which seems inefficient to me. Is there really a significant mathematical difference, or am I overthinking this?

1 Answer

Answered By TechieTom123 On

It'd help to see the code you're working with or the exact response from ChatGPT. Otherwise, we could just be guessing here.

CuriousCoder99 -

You're right! So here's what I have: `int* CurrentPrizes = BasePrizes;` followed by a loop for shuffling. ChatGPT suggests I use a new array instead. Does that seem too redundant?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.