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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c949,38eaf2ac280788bb X-Google-Attributes: gid10c949,public X-Google-Thread: 109fba,38eaf2ac280788bb X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,38eaf2ac280788bb X-Google-Attributes: gid103376,public X-Google-Thread: fdb77,38eaf2ac280788bb X-Google-Attributes: gidfdb77,public X-Google-Thread: f6290,38eaf2ac280788bb X-Google-Attributes: gidf6290,public X-Google-Thread: 1014db,38eaf2ac280788bb X-Google-Attributes: gid1014db,public X-Google-Thread: 10d15b,38eaf2ac280788bb X-Google-Attributes: gid10d15b,public X-Google-Thread: 114917,38eaf2ac280788bb X-Google-Attributes: gid114917,public From: xdragon@ames.net (Brad Dale) Subject: Re: 'Money wanted' algorithm (Cobol version) Date: 1996/12/31 Message-ID: <32c8845d.205199674@news.ames.net>#1/1 X-Deja-AN: 206854123 references: <5a8h44$elt@news.inetdirect.net> 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: 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