From: paul@pj.tmc.edu (Thorongil)
Subject: Re: FORTRAN food synthesizer program
Organization: Mississippi State University ERC
Date: Fri, 13 Nov 1992 14:38:06 GMT

In article <1992Nov13.123108.28930@umbc3.umbc.edu> cs202144@umbc8.umbc.edu (cs202144) writes:
>>        Here is a goodie I came across in "The Official Star Trek
>> Cooking Manual" by Mary Ann Piccard (New York:  Bantam Books, 1978,
>> 203 pp, ISBN 0-553-11819-6):
>> 
>> Synthesizer Algorithm for Dr. McCoy's Favorite Dish (p. xiii)
>> 
>>        (This program can be modified to run on almost any computer
>> which handles Fortran IV by changing one statement.  The variable
>> IOUT must be set equal to the logical unit number of the output
>> device on which the report is to be written.)
>> 
>> C23456789
>> C        CHANGE THE STATEMENT IOUT=5 TO IOUT=THE
>> C     NUMBER OF THE APPROPRIATE OUTPUT DEVICE FOR
>> C     THE COMPUTER ON WHICH THE PROGRAM IS TO BE
>> C     RUN.....
>>       DOUBLE PRECISION RECIP,BAKED
>>       DIMENSION FOOD(15),DISH(15),PAN(15),
>>       1 FRYER(15),WAFFL(15)
>>       COMMON/MEATS/FOOD,DISH,PAN,FRYER,WAFFL
>>       DATA FOOD/'S','I','H','T',' ','M','A','R',
>>      *          'G','O','R','P',' ','S','I'/
>>       DATA DISH/'N','E','T','T','I','R','W',' ',
>>      *          'N','I',' ','A','T','A','D'/
>>       DATA PAN/'L','A','R','E','N','E','G',' ',
>>      *          'N','A','R','T','R','O','F'/
>>       DATA FRYER/'V','I',' ','T','I',' ','Y','A',
>>      *           'M',' ','N','U','R',' ','N'/
>>       DATA WAFFL/'O',' ','K','N','U','J',' ','S',
>>      *           'E','N','I','H','C','A','M'/
>>       IOUT=5
>>       WRITE(IOUT,007)FOOD(1),WAFFL(3),DISH(2),
>>      1 FOOD(12),DISH(3),FRYER(2),WAFFL(13)
>>   007 FORMAT(2X,///,5X,20A2)
>>       BAKED=DBL(5.)
>>       RECIP=DBLE(71.)/DBLE(113.)
>>       RECIP=RECIP*BAKED
>>       WRITE(IOUT,73)WAFFL(13),FOOD(3),DISH(10),
>>      1 WAFFL(13),WAFFL(3),PAN(6),WAFFL(4),RECIP
>>    73 FORMAT(2X,///,5X,7A2,F12.6)
>>       WRITE(IOUT,007)DISH(2),PAN(5),WAFFL(6),
>>      1 FOOD(10),FRYER(7),WAFFL(2),DISH(10),
>>      1 FRYER(4),FOOD(5),WAFFL(11),DISH(1),PAN(8)
>>       WRITE(IOUT,007)PAN(7),WAFFL(1),PAN(14),
>>      1 DISH(15),FRYER(6),FOOD(3),WAFFL(9),
>>      1 FRYER(8),PAN(1),DISH(4),WAFFL(12)
>>       STOP
>>       END
>>
>>	[It is not quite so ugly translated into BASIC, though :) ]
>
>I wish I had C source code for this, but one thing I did was try to compile it
>as is in fortran on a DEC Unix Machine and a SGI Irix machine. On both it
>complained about an undefined dbl_ and I do not know fortran at all so beyond
>trying to run it through the compiler I am lost. Yes! I did edit out the
>message header and all that junk so that is not my problem.

Simple, this line : 

       BAKED=DBL(5.)

should read :

       BAKED=DBLE(5.)

and the output of the program is :




     S K E P T I C 



     C H I C K E N     3.141593



     E N J O Y   I T   I N   



     G O O D   H E A L T H 


Sorry, but I found this to be stupid.  

       ___   ____                                                      
       /__)   /          ^  __| ^ |\ /|  ______________________________
      / .  \_/ .        /-\(__|/-\| V | (__   paul@erc.msstate.edu     
    _______________________________________)                           
      Engineering Research Center For Computational Field Simulation   

Newsgroups: alt.folklore.computers