Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Horse racing program

16 views
Skip to first unread message

Simplify Please

unread,
Apr 25, 2020, 9:42:53 AM4/25/20
to
Is it possible to sort different arrays? I'm an absolute beginner so bear with me.

What I want to do is to get 3 pace numbers from each horse entered in race. Pace numbers being early pace, mid pace, and late pace. The past performances of the horse is therefore broken up into 3 segments.
Now I want to compare each early pace of horse A to all the other horses entered.
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.

Simplify Please

unread,
Apr 25, 2020, 9:55:52 AM4/25/20
to
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.
early pace would for the 3 horses would be 87, 75, 99 and ditto for the other 2 segments. Rank these. In early pace therefore horse 3 ranks 1, horse 1 ranks 2, and horse 2 ranks 3. etc.

Simplify Please

unread,
Apr 25, 2020, 9:57:58 AM4/25/20
to
I made an error, early pace would for the 3 horses would be 95, 83, 101.

Ben Bacarisse

unread,
Apr 25, 2020, 12:32:05 PM4/25/20
to
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.
0 new messages