If I want to check if all the variables are pairwise distinct, i.e. they're all different. Here's a code I wrote to do this:
1 2 3
if (s!=e&&s!=n&&s!=d&&s!=m&&s!=o&&s!=r&&s!=y&&e!=n&&e!=d)
if (e!=m&&e!=o&&e!=r&&e!=y&&n!=d&&n!=m&&n!=o&&n!=r&&n!=y)
if (d!=m&&d!=o&&d!=r&&d!=y&&m!=o&&m!=r&&m!=y&&o!=r&&o!=y&&r!=y)
Is there perhaps some function that would let me do this in a lot shorter way, i.e. something like this (that would act the same way my other code does): if (different(s,m,d,e,o,n,y))
What is the best way you can think of? Without having all those variables in an array. Otherwise it wouldn't be so hard to create a function. thanks.
Duoas' method is very simple and it is the one I'll use, the other ones are a bit more complicated and not worth my effort. I appreciate all the answers here, thanks!