MV Shuffling 16 Numbers

Hi all.

I have 16 variables that each need to hold a value between 1 and 16, which is easy enough. But I need no two of these variables to contain the same number, which means I can't just Rand between 1 and 16 in all of them. I've tried a couple solutions using the GUI with loops and conditional branches, but I'm still seeing repeated numbers and not sure why. Essentially I need help shuffling a deck of 16 cards, each with a unique value:

16 Variables containing [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]

I need to become something like

16 Variables containing [7, 2, 13, 5, 15, 12, 1, 14, 4, 6, 9, 15, 3, 16, 8, 10]

Does anybody have a simple solution I could attempt with the GUI, or a simple script I can insert into an event?
See if this works for you. Install it, fill in the numbers you want to shuffle, the variables you want to store them in and then execute the plugin command SHUFFLE_NUMBERS whenever you need to shuffle.
See if this works for you. Install it, fill in the numbers you want to shuffle, the variables you want to store them in and then execute the plugin command SHUFFLE_NUMBERS whenever you need to shuffle.

Doesn't seem to be working for me.

Plugin is installed + turned on.

Contents of "Variables":
["101","102","103","104","105","106","107","108","109","110","111","112","113","114","115","116"]

Contents of "Numbers":
["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16"]

Contents of Event:
Plugin Command : SHUFFLE_NUMBERS

Result:
All Variables from 0101-0116 are set to 0.
This stackoverflow answer seems simple enough to just copy and paste into a script call, if you're only going to use it once: https://stackoverflow.com/a/12646864

It also uses an algorithm that is proved to be unbiased, which is neat.

With the function they provide there you could simply do this:

JavaScript:
const deck = Array.from({ length: 16 }, (_, i) => i + 1); // [1..16]
shuffleArray(deck);
deck.forEach((n, index) => $gameVariables.setValue(index + 101, n));

If you need this logic in more than one place, just put the shuffleArray function into a plugin and call it like shown above whenever you need it.
Thanks a lot!

Tried it out, but strangely got the same result. Am I missing something here?

See the attached image: script call is at the top, debug menu with results is below it.
@Sketchward
Works for me in a blank project. I'd try it like that to see if it works and if so, there's likely something else going on that either disrupting the plugin or zeroing out your variables.
Okay, so, I tried it out in a blank project, and no results again. I dug into the code in Notepad and realized that you have the command scripted as SHUFFLE_VARIABLES, while in the plugin's help file it's listed as:

Plugin Command: SHUFFLE_NUMBERS

I was attempting to use the Plugin Command SHUFFLE_NUMBERS as instructed, but the command is actually SHUFFLE_VARIABLES. Now that I've figured that out, it's working flawlessly! Thank you so much for taking the time to make this, I greatly appreciate it.
Oh, crap! I'm sorry. I changed that at the last minute and must have forgot to update that part of the plugin and my test case.

Original thread: https://forums.rpgmakerweb.com/threads/shuffling-16-numbers.133229/