Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to get all possible orders of these 4 words?

Well, they're not words- they're: BrG BrP BP BG

I want the output to print them in every possible order, like:

BrG BrP BP BG

BrP BrG BG BP

BG BrG BP BrP

etc..

So the order of the letters never changes, but the order of the words does.

I would give a code snippet, but it's not even close to the right thing I should be doing. Please help.

1 comment

0

Why do you need them ordered like that? Please give us the code as well.

1 answer

Hi Shady,

What you are trying to do is permutations of a given set of variables or strings in your case.

###You can learn more about permutations here.

###I was going to code it all for you but you won't learn anything from that and I simply don't have the time to learn how to do it and code it up for you. Just figure it out, it shouldn't be that hard to do.

###Here is a really good explanation about how you can code permutations.

##Hopefully those sources helped, good luck!

Thanks,

Best regards,

Idealist Developer

This discussion is preserved as it was. New answers, comments, and votes are closed.