On 1/19/06, Dan Wonacott wrote: > I don't think there's a cunning way to do it. It demands a minimum of 2 > comparisons, max 3. Sorting 4 or more you'd want to use a function call or > you'd have a lot of messy and confusing code (this is confusing enough). > Best pseudo code I can do: > > IF B >= A GOTO BA > IF C >= A GOTO A ; A > B if C >= A then C > >= A > B > IF C >= B GOTO C ; A > B and A > C if C >= > B then A > C >= B > ; A > B, A > > C and B > C therefore A > B > C > B ANSWER B > GOTO END > BA IF C >= A GOTO BACA ; B >= A > ; B >= A > > C > A ANSWER A > GOTO END > BACA IF C >= B GOTO B ; B > A, C > A if C >= B then C > >= B > A > ; B > A, C > > A and B > C therefore B > C > A > C ANSWER C > END > Yeah, that's pretty much the answer I came up with last time. (Somehow this thread from July 2005 just got reposted. I have no idea how...) If you found this to be an interesting problem, look back at the piclist archives around July 15, 2005. There were some good responses. Regards, Mark markrages@gmail -- You think that it is a secret, but it never has been one. - fortune cookie -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist