Coding Challenge
Björnke von Gierke
bvg at mac.com
Tue Mar 8 08:32:34 EST 2011
I'm not sure i understand the problem. given:
Paul 3
Peter 6
Joanne 6
fritz 9
Madelaine 15
sort by word 2 of each
put lineoffset("paul", theList) - lineoffset ("peter") into theCompare
if theCompare < 0 then
--child one is younger
else
--child 2 is younger
end if
that should solve all cases, unless they're the same age, which you need to check with a direct comparision (if word 2 of child1 = word 2 of child2 then sameAge)...
of course you could as well always use comparisions, and i'm sure you'd think of that yourself. so i really don't understand the question it seems.
On 8 Mar 2011, at 14:15, Malte Brill wrote:
> Hi folks,
>
> this is over my head. I have a problem I can not tackle alone, so please let me scream for help...
>
>
> HEEEEEEEEEELLLLLLLP
>
>
> Imagine a group of kids:
>
> Paul,Peter,Fritz,Madeleine,Joanne (and any additional number of kids)
>
> I want to programmatically test on age relations of those kids:
>
> e.g. Peter is older than Paul, Joanne is the same age as Paul.
> Now I want to be able to test if the statement Joanne is older than Peter (or same age, or younger) are valid or not.
> I will need to be able to do this for all kids in the group. Any ideas on how to tackle that???
>
> Cheers,
>
> Malte
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list