comp.lang.ada
 help / color / mirror / Atom feed
From: renegade@dwx.com (Renegade)
Subject: <no subject>
Date: 1996/12/31
Date: 1996-12-31T00:00:00+00:00	[thread overview]
Message-ID: <5a9pka$etr@bagan.srce.hr> (raw)


Subject: Re: 'Money wanted' algorithm (Cobol version)
Date: Mon, 30 Dec 1996 17:39:04 GMT
Message-ID: <32c8f428.76407842@news.dwx.com>
References: <5a8h44$elt@news.inetdirect.net>
X-Newsreader: Forte Agent .99f/32.275
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 106
Path: CARNet.hr!01-newsfeed.univie.ac.at!Austria.EU.net!EU.net!newsfeed.internetmci.com!207.206.192.3!as-dwx-1-11.dwx.net
 comp.lang.tcl:31171 comp.mail.eudora.ms-windows:17519 comp.mail.sendmail:17465 comp.multimedia:35878 comp.music.midi:12527 comp.object:28200

congee@mindspring.com (Deric Cheng) wrote:
>dennis@qltel.exonet.nl (Dennis Janssen) wrote:
>
>>Hi Deric,
>
>>**>> I  need alot of money badly; Could anyone help?
>
>>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:

IDENTIFICATION DIVISION.
PROGRAM-ID 	MAKE-MONEY.
AUTHOR	              MY- ASS.
DATE-WRITTEN   TODAY.
ENVIRONMENT DIVISION.
   HOPEFULLY WARM.
DATA DIVISION.

~~~~ YADA, YADA, YADA
01  HELL-IND                 PIC X     VALUE SPACES.
   88 HELL-FROZEN                    VALUE 'Y'.
01   TIME-IND               PIC X      VALUE SPACES.
   88  SUN-DOWN                        VALUE 'Y'.

PROCEDURE DIVISION.

MAIN.
   PERFORM DAILY-ROUNTINE UNTIL HELL-FROZEN.
   STOP-RUN.

DAILY-ROUTINE.
   PERFORM FIND-EMPTY-COFFEE-CUP.
   PERFORM FIND-SPOT WITH TEST AFTER UNTIL LOCATION = "GOOD".
   PERFORM SIT UNTIL SUN-DOWN.
   IF HELL-TEMP < 32 
        MOVE "Y" TO HELL-IND.

FIND-EMPTY-COFFEE-CUP.
   FIND COFFEE-CUP.
   IF COFFEE-CUP NOT = "EMPTY"
        PERFORM EMPTY-CUP.

EMPTY-CUP.
   IF CUP-CONTENTS-APPEAR = "GOOD"
       DRINK CUP-CONTENTS
   ELSE
        POUR CUP-CONTENTS.

FIND-SPOT.
   MOVE "GOOD" TO LOCATION.
   FIND SPOT.
   IF COP-PRESENT = "YES" 
       MOVE "BAD" TO LOCATION.
   IF STREET-BUSY = "NO"
       MOVE "BAD" TO LOCATION.   
   IF BULLETS-FLYING = "YES"
       MOVE "BAD" TO LOCATION.

SIT.
   IF BUTT-ACHES
       MOVE ASS TO OTHER-SIDE.
   SIT STILL.
   LOOK PITIFUL.
   BEG.
   PLEAD.
   IF DARK="YES"
        MOVE "Y" TO TIME-IND.

Please note:   This program was half the size, and worked twice as
well until administration got ahold of it and requested rewrites.  Now
it is bigger, and nobody knows for sure what it does......

Enjoy....

Dave

The opinions expressed in this post are purely my own. 
You may e-mail replies to:   renegade@dwx.com





             reply	other threads:[~1996-12-31  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-31  0:00 Renegade [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-01-23 15:56 (no subject) Per Sandberg
2002-10-08  2:18 Rick Duley
2001-05-05 10:43 <no subject> Kent Paul Dolan
2001-05-05  8:25 Kent Paul Dolan
1999-09-15  0:00 (no subject) Justine O'Hara
1999-09-14  0:00 ` Keith Thompson
1998-11-13  0:00 niel.williams
1998-11-13  0:00 ` dennison
1998-11-13  0:00   ` Robert I. Eachus
1997-08-18  0:00 Moustafa abdul wahab
1997-06-03  0:00 Matthew Daniel
1997-01-23  0:00 Mathieu POUPARDIN
1996-12-31  0:00 <no subject> Brad Dale
1996-06-07  0:00 (no subject) Mark Fisher
1996-04-15  0:00 Markus Knasmueller
1996-04-09  0:00 chico
1996-04-09  0:00 ` David Weller
1996-03-19  0:00 Mike Ibarra
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox