Simplify Please <
parkstre...@gmail.com> writes:
> On Saturday, April 25, 2020 at 9:55:52 AM UTC-4, Simplify Please wrote:
>> On Saturday, April 25, 2020 at 9:42:53 AM UTC-4, Simplify Please wrote:
>> > Is it possible to sort different arrays?
Yes. You can sort almost anything based on almost any criterion.
<cut>
>> > And each mid pace to the other horses, and each late pace segment
>> > to other horses in the race. It is so easy to do using my head,
>> > pen, paper and calculator, but programming this seems to be above
>> > my pay grade.
>>
>> I'm going to detail an example: 3 horses in race.
>> Pace numbers follow for each segment.
>>
>> Horse 1: 95 87 56
>> Horse 2: 83 75 65
>> Horse 3: 101 99 88
>>
>> So I want to rank early pace for each horse, then mid, then late pace.
<cut>
> I made an error, early pace would for the 3 horses would be 95, 83, 101.
This sort of thing is best done with a scripting language. Heck, I'd do
it using the Linux sort command. Windows will have something similar:
$ cat horses
Horse 1: 95 87 56
Horse 2: 83 75 65
Horse 3: 101 99 88
$ sort -nrk3 horses
Horse 3: 101 99 88
Horse 1: 95 87 56
Horse 2: 83 75 65
$ sort -nrk4 horses
Horse 3: 101 99 88
Horse 1: 95 87 56
Horse 2: 83 75 65
$ sort -nrk5 horses
Horse 3: 101 99 88
Horse 2: 83 75 65
Horse 1: 95 87 56
The sort is numeric (-n) in reverse order (-r) and uses numbered field as
the key (-k3 etc).
--
Ben.