comp.lang.ada
 help / color / mirror / Atom feed
* Re: 'Money wanted' algorithm (Cobol version)
  1996-12-30  0:00 'Money wanted' algorithm (Cobol version) Doug Miller
@ 1996-12-30  0:00 ` Sundial Services
  1996-12-30  0:00 ` Beldraen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Sundial Services @ 1996-12-30  0:00 UTC (permalink / raw)



In article <5a8h44$elt@news.inetdirect.net> spam.free.zone@no-spam.com (Doug Miller) writes:

>>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


I'd like to see it in APL.  If we told this bozo what we think of him 
("$#%#@$#!!"), it might -run!-

Oh well... funny as it may be, this is a grossly over-cross-posted thread and 
it's time we let it die.








^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Cobol version)
  1996-12-30  0:00 'Money wanted' algorithm (Cobol version) Doug Miller
  1996-12-30  0:00 ` Sundial Services
@ 1996-12-30  0:00 ` Beldraen
  1996-12-31  0:00   ` Constantinos A. Kotsokalis
  1996-12-30  0:00 ` Renegade
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Beldraen @ 1996-12-30  0:00 UTC (permalink / raw)



spam.free.zone@no-spam.com (Doug Miller) wrote:

>>>**>> 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 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

class Make_Money extends java.applet.Applet implements runnable
{
             Thread Body = null;
	fluid_container CoffeeCup;
	stellar_mass Sun;

	public void init()
	{
		CoffeCup = new fluid_container("COFFEE");
		Sun = new stellar_mass();
	}
	public void start()
	{
		if (Sun.Status = Sun.Down) Body == null;
		if(Body == null)
		{
			Body = new Thread(this);
			Body.start();
			Body.goToBusyStreet();
		}
	}
	public void stop()
	{
		Body.goToShelter'
		Body = null;
	}

	public void run()
	{
		long time = System.currentTimeMillis();
		while (Body!= null)
		{
			try
			{
				time += delay;
				Thread.sleep(Math.max(0, time
System.currentTimeMillis()));
			}
			catch (InterruptedException e)
			{
				CoffeeCup.addMoney();
				Body.lookGreatful();
				Body.getMoreConfortable();
			};
			if (Sun.Status = Sun.Down) Body == null;
			repaint();
		}
	}
}
Bel, the mostly sane...

Eagles may fly, but weasles don't get sucked into jet engines.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Cobol version)
  1996-12-30  0:00 ` Renegade
@ 1996-12-30  0:00   ` Bill Haverberg
  1996-12-30  0:00   ` 'Money wanted' algorithm (Lisp version) Ken Tilton
  1996-12-31  0:00   ` 'Money wanted' algorithm (Cobol version) Bob Jarvis
  2 siblings, 0 replies; 12+ messages in thread
From: Bill Haverberg @ 1996-12-30  0:00 UTC (permalink / raw)



renegade@dwx.com (Renegade) wrote:

>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
>

My K&R is at work so I don't have anything to spot check my code
against...might be a couple syntax errors here and there.

#include <stdio.h>
#include <city.h>

enum { new, battered, travel, captains, porcelain } cupCondition_e;
extern Streets;

typedef {
   enum cupCondition_e condition;
   float amount;
} coffeeCup_t;

int main()
{
   coffeeCup_t CoffeeCup;
   CoffeeCup.condition = battered;
   CoffeeCup.amount = 0f;

   for (i=0; i<Streets.Num && Streets.traffic[i]<50; i++);
   if (Streets.traffic[i]<50) {
      fprintf(stderr, "Town too small, catching bus to big city\n");
      /* Have to implement this part. For now, we assume the 
         freeloader dies of starvation. Phase II replaces this with 
         signal handling.
      */
      exit(1);
   }
   while (1) {
      SitInMiddleOf(&Streets, i);
   }
}





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Cobol version)
  1996-12-30  0:00 'Money wanted' algorithm (Cobol version) Doug Miller
  1996-12-30  0:00 ` Sundial Services
  1996-12-30  0:00 ` Beldraen
@ 1996-12-30  0:00 ` Renegade
  1996-12-30  0:00   ` Bill Haverberg
                     ` (2 more replies)
  1996-12-31  0:00 ` Brad Dale
  1996-12-31  0:00 ` Robin Becker
  4 siblings, 3 replies; 12+ messages in thread
From: Renegade @ 1996-12-30  0:00 UTC (permalink / raw)



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





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Lisp version)
  1996-12-30  0:00 ` Renegade
  1996-12-30  0:00   ` Bill Haverberg
@ 1996-12-30  0:00   ` Ken Tilton
  1996-12-31  0:00   ` 'Money wanted' algorithm (Cobol version) Bob Jarvis
  2 siblings, 0 replies; 12+ messages in thread
From: Ken Tilton @ 1996-12-30  0:00 UTC (permalink / raw)



>>Program Make_Money;
>
>>Uses
>>  Nothing;
>
>>begin
>>  Repeat
>>    Find(EmptyCoffeeCup);
>>    Find(BusyStreet);
>>    Repeat
>>      Sit(MiddleOfStreet)
>>    Until Sun(Down)
>>  Until Hell(FrozenOver)
>>end.

Hmmm.

(defparameter *self* (make-instance 'person)))
(defparameter *sun* 'up)
(defparameter *hell* 'hotter-n-blazes)
(defparameter *cups* (list (make-instance 'cup :contents 'java) ...)
(defparameter *corners* (make-instance 'corner :traffic 'light)...)

(defun main ()
  (do ()
      ((eql *hell* 'frozen-over))
    (let ((cup (find-if 'empty *cups* :key #'contents))
          (corner (find-if 'heavyy *corners* :key #'traffic)))
      (sit *self* :where corner :with cup)
      (do ()
          ((eql *sun* 'down))
        (beg *self* "~&Buddy, can you spare a dime?"))))

(defmethod sit ((who person) &key where with)
  (assert (and where with) "There's a hole in the spec!")
  (setf (butt person) where)
  (setf (hand person) with))

(defmethod beg ((who person) rap)
  (declare (ignore person))
  (format t rap))



Yes, I have deviated from the spec. :) I'm a cowboy. And without a Lisp
editor, I cannot guarantee the parens. <G>




^ permalink raw reply	[flat|nested] 12+ messages in thread

* 'Money wanted' algorithm (Cobol version)
@ 1996-12-30  0:00 Doug Miller
  1996-12-30  0:00 ` Sundial Services
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Doug Miller @ 1996-12-30  0:00 UTC (permalink / raw)



congee@mindspring.com (Deric Cheng) wrote:
>Path: news.netdirect.net!news.sprintlink.net!news-chi-13.sprintlink.net!www.nntp.primenet.com!nntp.primenet.com!news.mindspring.com!usenet
>From: congee@mindspring.com (Deric Cheng)
>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
>p.org.eff.ta
>Subject: Re: Money wanted
>Date: Sun, 29 Dec 1996 05:51:17 GMT
>Organization: MindSpring Enterprises, Inc.
>Lines: 34
>Message-ID: <5a50s6$kfp@camel2.mindspring.com>
>References: <32BFDC0E.79BB@solutions.mb.ca> <32C15269.2481304F@seahunt.imat.com> <32c1bb07.1770350@news.2sprint.net> <32C1ECEF.32B8@pacbell.net> <59t5l6$kes@camel2.mindspring.com> <f4c_9612272359@exonet.nl>
>Reply-To: congee@mindspring.com
>NNTP-Posting-Host: ip253.an13-new-york4.ny.pub-ip.psi.net
>X-Server-Date: 29 Dec 1996 05:51:02 GMT
>X-Newsreader: Forte Free Agent 1.0.82
>Xref: news.netdirect.net comp.lang.ada:48423 comp.lang.asm.x86:29605 comp.lang.basic.misc:23092 comp.lang.c:202850 comp.lang.c++:208853 comp.lang.clipper:19938 comp.lang.cobol:12231 comp.lang.java.advocacy:2908 comp.lang.java.api:4850 comp.lang.java.misc:6535 comp.lang.java.programmer:19677 comp.lang.javascript:14294 comp.lang.pascal.borland:22596 comp.lang.pascal.delphi.databases:24628 comp.lang.pascal.delphi.misc:58635 comp.lang.perl.misc:43611 comp.lang.smalltalk:41655 comp.lang.tcl:52025 comp.mail.e

>udo
>ra.ms-windows:19511 comp.mail.sendmail:35187 comp.multimedia:60129 comp.music.midi:13092 comp.object:51961
>
>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 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



Doug Miller
dlmiller@inetdirect.net     ('from' field rigged to foil e-mail spammers)
views expressed are mine and not those of
Hospital Health Plan Corp.  "all health care is local"







^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Cobol version)
  1996-12-30  0:00 'Money wanted' algorithm (Cobol version) Doug Miller
                   ` (2 preceding siblings ...)
  1996-12-30  0:00 ` Renegade
@ 1996-12-31  0:00 ` Brad Dale
       [not found]   ` <32C988BA.427D@dynasty.net>
  1996-12-31  0:00 ` Robin Becker
  4 siblings, 1 reply; 12+ messages in thread
From: Brad Dale @ 1996-12-31  0:00 UTC (permalink / raw)



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





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Cobol version)
  1996-12-30  0:00 'Money wanted' algorithm (Cobol version) Doug Miller
                   ` (3 preceding siblings ...)
  1996-12-31  0:00 ` Brad Dale
@ 1996-12-31  0:00 ` Robin Becker
  4 siblings, 0 replies; 12+ messages in thread
From: Robin Becker @ 1996-12-31  0:00 UTC (permalink / raw)



In article <5a8h44$elt@news.inetdirect.net>, Doug Miller
<spam.free.zone@no-spam.com> writes
>>>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
>
>
>
>Doug Miller
>dlmiller@inetdirect.net     ('from' field rigged to foil e-mail spammers)
>views expressed are mine and not those of
>Hospital Health Plan Corp.  "all health care is local"
>
>
>
somewhere the should be an initial
        PERFORM find-lovable-looking-mongrel
-- 
Robin Becker




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Cobol version)
  1996-12-30  0:00 ` Beldraen
@ 1996-12-31  0:00   ` Constantinos A. Kotsokalis
  0 siblings, 0 replies; 12+ messages in thread
From: Constantinos A. Kotsokalis @ 1996-12-31  0:00 UTC (permalink / raw)



Yes, but can you actually write it in SPARC ASSEMBLY??? :-)
(HP-PA will do too, hehehe)

   Costas

--
Costas Kotsokalis
Electrical & Computer Engineering Department
National Technical University of Athens
"According to Einstein, time is relative, so there is no way I can be late."




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Cobol version)
  1996-12-30  0:00 ` Renegade
  1996-12-30  0:00   ` Bill Haverberg
  1996-12-30  0:00   ` 'Money wanted' algorithm (Lisp version) Ken Tilton
@ 1996-12-31  0:00   ` Bob Jarvis
  1996-12-31  0:00     ` Deric Cheng
  2 siblings, 1 reply; 12+ messages in thread
From: Bob Jarvis @ 1996-12-31  0:00 UTC (permalink / raw)



Renegade <renegade@dwx.com> wrote in article <32c8f428.76407842@news.dwx.com>...
> congee@mindspring.com (Deric Cheng) wrote:
> > (pseudocode and Pascal deleted for brevity)
> >Hey that's cool can you do it in Cobol?
> 
> Sure:

The code in this program does not conform to Corporate Standards and
must be rewritten prior to being stored permanently in the Corporate Library.
Please consult the appropriate documentation (ref. CorpStan 01-R97301
"Standards For Corporate Software and Other Anal-Retentive Stuff"), revise
your program, and resubmit.  In particular the following areas requiring revision
have been noted:

> IDENTIFICATION DIVISION.
> PROGRAM-ID 	MAKE-MONEY.
> AUTHOR	              MY- ASS.
> DATE-WRITTEN   TODAY.

The identification division lacks the appropriate copyright notice, liability
limitations, equal opportunity employment disclaimer, and vaguely threatening
legal language.  Inclusion of these clauses is required (ref. CorpStan 09-R4763
"Standards For The Inclusion Of Useless Comments and Boilerplate") unless
authorization for their non-inclusion has been previously granted by the 
Software Standards Exceptions Committee (ref. CorpStan A3-R1072 "Procedures
For Requesting Exceptions To Corporate Standards", CorpStan A16-R982
"Standard Exception Request Procedures", and CorpStan A87-R1071 "Procedural
Standards For Corporate Exceptions").  The Software Standards Exceptions
Committee meets on the sixth Thursday of each month to review all outstanding
exception requests.  Please plan on attending their next meeting.  Bring your own
kneepads and bandages.

> ENVIRONMENT DIVISION.
>    HOPEFULLY WARM.

As noted in Executive Memorandum #930831-102 the corporate heating and cooling
system schedule has been revised.  In years past the cooling system was run during
the summer, and the heating system was run during the winter.  Thanks to diligent
work on the part of some of our Junior Cost Accountants it was determined that
it is much more efficient to run the heating system during the summer, and the cooling
system during the winter.  During the past several years our company has realized
substantial savings from this schedule change.

In a related issue, the annual closing of the restrooms in the Corporate Office Building
is scheduled for September 30th so the water can be drained from the pipes.  As in past
years portable chemical toilets will be installed on the front lawn for the convenience of
all employees.  Please note that the toilets with the gold stars on the doors are for the
use of executives ONLY!  Thank you.

> 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'.

The use of 88-levels has been disallowed (ref. CorpStan P23-99061 "Obfuscatory Coding
Methods" and CorpTechNote P37-0978 "Recommended Clarification Reduction Techniques").
Remember - analysts only have ten fingers and ten toes, so the use of any nesting level
greater than twenty is not allowed.

> PROCEDURE DIVISION.
> 
> MAIN.
>    PERFORM DAILY-ROUNTINE UNTIL HELL-FROZEN.
>    STOP-RUN.

The MAIN procedure in this program lacks the following necessary elements (ref. CorpStan
E7-83610 "Stuff You've Got To Put In Because We Say So"):
    1. Notification to the operator that the program has begun execution.
    2. Notification to the operator that the program has terminated.
    3. Notification to the operator that the program has notified the operator.
    4. Lots of bell ringing on the console to wake the operator up and/or distract him/her/it
        from whatever else it is they're doing.
    5. Setting a proper return code.  The following standard return codes have been defined
        to provide the operations staff with appropriate information about program status
        (ref. CorpStan P74-9876 "Standard Return Codes and Other Anal-Retentive Crap"):
            0   Program completed successfully, or forgot to set any other return code.
            4   Something went wrong.  We think it's minor.  Probably.
            8   An error has occurred.  Wait until 2:00 A.M., then call the programmer listed on
                 the call sheet.  The call sheet, of course, is out of date - the programmer listed
                 hasn't seen this code in years, doesn't know who's currently responsible for it,
                 and may in fact no longer work for the company.  No matter.  Keep calling
                 him/her/it once every five minutes.
           12  A serious error has occurred.  Ignore it.  It's probably not all that important.  Anyways,
                 if it *is* important someone on the day shift will take care of it.
           16  That glowing lump of slag in front of you *used* to be a computer.  Take your
                 lunch break.

> 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.

The paragraph named DAILY-ROUTINE does not conform to corporate standards
(ref. CorpStan K9-83902 "Proper Naming Of Paragraphs In Corporate Software").
The name of a paragraph must include the following elements, separated by dashes:
    1.  The eight-digit program number (e.g. P1234567).
    2.  The six-digit analysis tool ID for the superblock containing the functionality
         implemented by this paragraph (e.g. 42K7AB).
    3.  The flowchart name and block number for this paragraph (e.g. MAKEMONEY72).
    4.  The unique 16-digit Paragraph Identification Number assigned by the Paragraph
         Serialization Committee.  See CorpStan K6-8362 "Procedures for Requesting
         Paragraph Identification Numbers".  Submit all forms in triplicate.  Give three
         examples.  Show your work.
    5.  A descriptive name for the paragraph, which must not be more than 6 characters
         long.

Thus, an appropriate and correct paragraph name might be

    P1234567-42K7AB-MAKEMONEY72-9384750532894761-DLYRTN

Please make similar corrections on all affected non-standard paragraph names in this
program.

> 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......

Your continued complaints about administration are being duly noted and
recorded.  Please enunciate clearly and speak into the microphone.  There
is no need to panic (ref. CorpStan 01-666 "Panic - Requirements For").

Remember - the word "standard" is morally and intellectually equivalent to
"religious rite".

:-)

-- 
Bob Jarvis
Mail addresses hacked to foil automailers!
Send replies to jarvisb@timken.com




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Cobol version)
  1996-12-31  0:00   ` 'Money wanted' algorithm (Cobol version) Bob Jarvis
@ 1996-12-31  0:00     ` Deric Cheng
  0 siblings, 0 replies; 12+ messages in thread
From: Deric Cheng @ 1996-12-31  0:00 UTC (permalink / raw)



"Bob Jarvis" <nospam@thankyou.net> wrote:

>Renegade <renegade@dwx.com> wrote in article <32c8f428.76407842@news.dwx.com>...
>> congee@mindspring.com (Deric Cheng) wrote:
>> > (pseudocode and Pascal deleted for brevity)
>> >Hey that's cool can you do it in Cobol?
>> 
>> Sure:

>The code in this program does not conform to Corporate Standards and
>must be rewritten prior to being stored permanently in the Corporate Library.
>Please consult the appropriate documentation (ref. CorpStan 01-R97301
>"Standards For Corporate Software and Other Anal-Retentive Stuff"), revise
>your program, and resubmit.  In particular the following areas requiring revision
>have been noted:

~snip~ cut to conserve bandwidth
hope that's not against any corpstanses.

>Your continued complaints about administration are being duly noted and
>recorded.  Please enunciate clearly and speak into the microphone.  There
>is no need to panic (ref. CorpStan 01-666 "Panic - Requirements For").

>Remember - the word "standard" is morally and intellectually equivalent to
>"religious rite".

>:-)

>-- 
>Bob Jarvis
>Mail addresses hacked to foil automailers!
>Send replies to jarvisb@timken.com

Whow this guy is cool.  Makes a good Dilbert comic.  =)





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 'Money wanted' algorithm (Cobol version)
       [not found]   ` <32C988BA.427D@dynasty.net>
@ 1997-01-01  0:00     ` Pae Choi
  0 siblings, 0 replies; 12+ messages in thread
From: Pae Choi @ 1997-01-01  0:00 UTC (permalink / raw)



Richie Lai wrote:
> 
> Damn.. from psuedo, to pascal.. to i can't even make that out <G>
> 
> #define CUP empty
> #define empty 0
> 
> int main
> (int ense,char *is_stupid[])
> {
>    while (CUP = empty)
>    {
>        for (time = 720; time < 1440 ; time ++)  {
>          siton(street);
>          look(stupid);
>          hopefor(money);
>        }
>     }
> }
> 
> 
> Brad Dale wrote:
> >
> > 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
> 
> --
> =======================================================================
> Richie Lai    Windows NT the only operating
> rla@dynasty.net    system that makes you hit c-a-d
> http://www.sindac.com/richie  to start using it...
> =======================================================================
> 


Hahaha ... I thought this thread was over..... I'm so glad you
guys haven't lost the sense of humors..... hahaha ... Very good
guys. happy new year.



pae




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~1997-01-01  0:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-12-30  0:00 'Money wanted' algorithm (Cobol version) Doug Miller
1996-12-30  0:00 ` Sundial Services
1996-12-30  0:00 ` Beldraen
1996-12-31  0:00   ` Constantinos A. Kotsokalis
1996-12-30  0:00 ` Renegade
1996-12-30  0:00   ` Bill Haverberg
1996-12-30  0:00   ` 'Money wanted' algorithm (Lisp version) Ken Tilton
1996-12-31  0:00   ` 'Money wanted' algorithm (Cobol version) Bob Jarvis
1996-12-31  0:00     ` Deric Cheng
1996-12-31  0:00 ` Brad Dale
     [not found]   ` <32C988BA.427D@dynasty.net>
1997-01-01  0:00     ` Pae Choi
1996-12-31  0:00 ` Robin Becker

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