Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: LogLady on October 29, 2014, 03:49:32 PM

Title: Compare multiple ints
Post by: LogLady 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.
Title: Re: Compare multiple ints
Post by: escpodgames 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.
Title: Re: Compare multiple ints
Post by: djaydino on October 29, 2014, 08:43:01 PM
do you know some good tutorial videos for array maker?
Title: Re: Compare multiple ints
Post by: LogLady 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?
Title: Re: Compare multiple ints
Post by: jeanfabre on February 23, 2015, 01:10:45 AM
Hi,

 Use ArrayReverse after you sorted and then you'll get descending sorting.

 Bye,

 Jean