Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jul 1998 00:04:25 -0600
From:      Brett Glass <brett@lariat.org>
To:        chat@FreeBSD.ORG
Subject:   Object-oriented chickens
Message-ID:  <199807270604.AAA15298@lariat.lariat.org>

next in thread | raw e-mail | index | archive | help
I once supplied the following Object Pascal program to a magazine in
response to the question "why did the (object-oriented) chicken cross the
road?"

--Brett Glass

program KFC;

uses
 Salt, Pepper, Flour, HotOil, Poultry, MackTruck;

const
 MPH = 90;

var
 {Don't reference your chickens before they're declared!}
 Chicken : Poultry.Fowl;
 Truck : MackTruck.EighteenWheeler;

begin
Chicken.Hatch; {Constructor}
Truck.Start; {Constructor}
Truck.Rev(MPH);
Chicken.Cross(Road);
Truck.Horn.Honk;
Truck.Brake := TRUE;
Truck.Tires.PutStr('Screeeeeeeeeeeeeeeeeeee...');
Chicken.PutStr('Scra-daaaaaaaaaaaaaawk!');
Stop; Look; Listen;
if Chicken.Flat then
  Output(Colonel,Chicken);
end.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807270604.AAA15298>