Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How to organize variables from greatest to least?[SOLVED]

Asked by
parkderp1 105
9 years ago

I'm trying to compare a group of variables to see which one is larger and whether or not one of them equal each other. I realise you can use an if elseif chain but is there a better way to do this?

0
Can you give an example data set, and what you want the results to be? adark 5487 — 9y
0
int1=3 int2=2 int3=64 int4=10. Basically, I want to arrange these in order from least to greatest or greatest to least. parkderp1 105 — 9y
0
Without using an if elseif chain parkderp1 105 — 9y
1
Couldn't you just create a table and sort it? VariadicFunction 335 — 9y
0
Didnt think of that, thanks. parkderp1 105 — 9y

1 answer

Log in to vote
1
Answered by
yumtaste 476 Moderation Voter
9 years ago

Simple. Use table.sort(table). Very easy :D!

Ad

Answer this question