From ecker@us.hsanet.net Mon Jan 29 11:57:39 2001 Date: Wed, 13 Dec 2000 05:51:02 -0000 From: Bryan Ecker Newsgroups: rec.arts.sf.written.robert-jordan Subject: Re: TAN: C experts please help!!! jim.millen@hotmail.com (Jim Millen) wrote in <3a36ecd2.26767350@news.ntlworld.com>: >problem - how do I write a subroutine to find the maximum value out of >a 10 element array? I've tried several options and have just come to >a dead end on all of them. Piece of cake! Observe carefully: /* Totally necessary precompile directives */ #define ___o int #define __o_ main #define __oo array #define _o__ srand #define _o_o rand()% #define _oo_ 10 #define _ooo 100 #define o___ maximum #define o__o max_value #define o_o_ return #define o_oo 0 #define oo_o max_val #define oooo for #define o____ index #define o___o if /* implementation */ ___o o__o(___o* __oo);___o __o_(); ___o __o_(){___o __oo[_oo_];_o__(_ooo); oooo(___o o____=o_oo;o____<_oo_;o____++) __oo[o____]=_o_o _ooo;___o o___=o__o(__oo);o_o_ o_oo;} ___o o__o(___o* __oo){___o oo_o=o_oo; oooo(___o o____=o_oo;o____<_oo_;o____++) o___o(__oo[o____]>oo_o) oo_o=__oo[o____];o_o_ oo_o;} /* end */ There are a couple of includes left out, since I didn't want to do EVERY-thing for you, plus it reduced the redability of this code a little. >Apologies for this extreme TAN, and believe me, being as impolite as >asking you guys for help is a measure of extreme desperation. Hey, don't mention it. -- Bryan Ecker Yeah, I'm bored.