From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c949,d005c9d3109f4fa9 X-Google-Attributes: gid10c949,public X-Google-Thread: fdb77,d005c9d3109f4fa9 X-Google-Attributes: gidfdb77,public X-Google-Thread: 109fba,d005c9d3109f4fa9 X-Google-Attributes: gid109fba,public X-Google-Thread: 10d15b,d005c9d3109f4fa9 X-Google-Attributes: gid10d15b,public X-Google-Thread: 103376,d005c9d3109f4fa9 X-Google-Attributes: gid103376,public X-Google-Thread: 114917,d005c9d3109f4fa9 X-Google-Attributes: gid114917,public X-Google-Thread: f6290,d005c9d3109f4fa9 X-Google-Attributes: gidf6290,public X-Google-Thread: 1014db,d005c9d3109f4fa9 X-Google-Attributes: gid1014db,public From: xdragon@ames.net (Brad Dale) Subject: Date: 1996/12/31 Message-ID: <5aals2$rlg@bagan.srce.hr>#1/1 X-Deja-AN: 206911017 distribution: world content-type: text/plain; charset=US-ASCII organization: CARNet, CROATIA mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.asm.x86,comp.lang.basic.misc,comp.lang.c,comp.lang.c++,comp.lang.clipper,comp.lang.cobol,comp.lang.java.advocacy,comp.lang.java.api,comp.lang.java.misc,comp.lang.java.programmer,comp.lang.javascript,comp.lang.pascal.borland,comp.lang.pascal.delphi.components.misc,comp.lang.pascal.delphi.databases,comp.lang.pascal.delphi.misc,comp.lang.perl.misc,comp.lang.smalltalk,comp.lang.tcl,comp.mail.eudora.ms-windows,comp.mail.sendmail,comp.multimedia,comp.music.midi,comp.object,com Date: 1996-12-31T00:00:00+00:00 List-Id: Subject: Re: 'Money wanted' algorithm (Cobol version) Date: Tue, 31 Dec 1996 03:24:55 GMT Message-ID: <32c8845d.205199674@news.ames.net> References: <5a8h44$elt@news.inetdirect.net> X-Newsreader: Forte Free Agent 1.1/32.230 Lines: 70 Path: CARNet.hr!01-newsfeed.univie.ac.at!zeus.cc.ucy.ac.cy!athena.cytanet.com.cy!news-out.internetmci.com!newsfeed.internetmci.com!n5.gbso.net!zot.ames.net comp.lang.tcl:31203 comp.mail.eudora.ms-windows:17552 comp.mail.sendmail:17486 comp.multimedia:35901 comp.music.midi:12556 comp.object:28217 On Mon, 30 Dec 96 13:54:10 GMT, spam.free.zone@no-spam.com (Doug Miller) wrote: >>>DC> Step 1 Find empty coffee cup >>>DC> Step 2 Find busy Street >>>DC> Step 3 Sit in middle of Street >>>DC> Step 4 goto Step 3 until sun goes down. >>>DC> Stpe 5 goto step 1 in the next day. >> >>>Tsk, tsk, bad advice. Goto's are evil! >> >>>Program Make_Money; >> >>>Uses >>> Nothing; >> >>>begin >>> Repeat >>> Find(EmptyCoffeeCup); >>> Find(BusyStreet); >>> Repeat >>> Sit(MiddleOfStreet) >>> Until Sun(Down) >>> Until Hell(FrozenOver) >>>end. >> >>>See mom, I DO have the Christmas spirit! >> >>> Dennis! >>Hey that's cool can you do it in Cobol? >> >Sure thing: > >PERFORM WITH TEST AFTER UNTIL hell-frozen-over > PERFORM find-empty-coffee-cup > PERFORM find-busy-street > PERFORM sit-middle-of-street UNTIL sunset > PERFORM wait-til-morning >END-PERFORM > (define get_money (lambda (status amount_money) (if ((!= status HELLFROZEN) amount_money) (+ amount_money (coffee status amount_money)))))) (define coffee (lambda (status amount_money) (begin (1 COFFECAN) (find_street status amount_money)))) (define find_street (lambda (status amount_money) (begin (1 STREET) (sit_street 0 status amount_money)))) (define sit_street (lambda (time status amount_money) (if ((= time SUNSET) amount_money) (+ (+ amount_money PROFIT) (sit_street (+ 1 time) status amount_money))))) Written sorta in SCHEME, been awhile so don't be to hard on it firehawk@ames.net