comp.lang.ada
 help / color / mirror / Atom feed
From: beldraen@mail.earthlink.net (Beldraen)
Subject: Re: 'Money wanted' algorithm (Cobol version)
Date: 1996/12/30
Date: 1996-12-30T00:00:00+00:00	[thread overview]
Message-ID: <32c7f30a.2066168@news.earthlink.net> (raw)
In-Reply-To: 5a8h44$elt@news.inetdirect.net


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.




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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
1996-12-31  0:00   ` Constantinos A. Kotsokalis
1996-12-30  0:00 ` Renegade
1996-12-30  0:00   ` 'Money wanted' algorithm (Lisp version) Ken Tilton
1996-12-30  0:00   ` 'Money wanted' algorithm (Cobol version) Bill Haverberg
1996-12-31  0:00   ` 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
replies disabled

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