playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
(Moderator:
600
) »
Compare multiple ints
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Compare multiple ints (Read 2525 times)
LogLady
Full Member
Posts: 150
Compare multiple ints
«
on:
October 29, 2014, 03:49:32 PM »
Hello!
Who can I compare 4 differents ints and find what int has the greatest value and so on? Eg.:
Int1 = 4
Int2 = 3
Int3 = 5
Int4 = 1
Int3 > Int1 > Int2 > Int4
Edit: I forgot to mention that I'd like to sort the values ascending or descending (Int4 < Int2 < Int1 < Int3).
Any help is appreciated.
«
Last Edit: October 29, 2014, 04:01:33 PM by LogLady
»
Logged
escpodgames
Hero Member
Posts: 687
Re: Compare multiple ints
«
Reply #1 on:
October 29, 2014, 05:46:50 PM »
You would want to use array maker. Array maker will allow you to sort the list, get the total count, get the greatest and then remove it from the list so the next greatest is on top.
Logged
Simple Assets -
https://www.assetstore.unity3d.com/en/#!/publisher/5217
djaydino
Administrator
Hero Member
Posts: 7622
Re: Compare multiple ints
«
Reply #2 on:
October 29, 2014, 08:43:01 PM »
do you know some good tutorial videos for array maker?
Logged
Join the PlayMaker Discord Channel!
LogLady
Full Member
Posts: 150
Re: Compare multiple ints
«
Reply #3 on:
November 07, 2014, 11:18:44 AM »
Thanks for you reply, LampRabbit!
I tried your suggestion but looks like ArrayList Sort only sort ascending values.
Then I tried ArrayList Get Max Value and looped it for the size of the list. Would it be the best way to go on ascending/descending sorting?
Logged
jeanfabre
Administrator
Hero Member
Posts: 15500
Official Playmaker Support
Re: Compare multiple ints
«
Reply #4 on:
February 23, 2015, 01:10:45 AM »
Hi,
Use ArrayReverse after you sorted and then you'll get descending sorting.
Bye,
Jean
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
(Moderator:
600
) »
Compare multiple ints