Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site raybed2.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!linus!raybed2!tools From: tools@raybed2.UUCP (TOOLS) Newsgroups: net.sources Subject: C Inference (Part 4 of 4) Message-ID: <1022@raybed2.UUCP> Date: Mon, 27-Jan-86 12:13:11 EST Article-I.D.: raybed2.1022 Posted: Mon Jan 27 12:13:11 1986 Date-Received: Wed, 29-Jan-86 06:35:07 EST Organization: Raytheon Co., Bedford MA Lines: 1003 As requested by the author we are reposting the source and documentation of a C inference engine. Address all questions to George Hageman at: UUCP: {asgb!benish}!hageman MAIL: George W. Hageman P.O. Box 11234 Boulder, Colorado 80301 NOTE: RAYTHEON Inc. is not reponsible for the contents and/or consequences of use of this software. This software is totally the work of George Hageman and is being reposted as per his request (see following message). Address all questions, comments, etc. to him. ========================================================================= >From linus!decvax!seismo!hao!asgb!benish!hageman Fri Jan 24 07:31:04 1986 >Subject: Re: C inference engine > > ... it seems that > the probability of getting somthing out to net.and is > inversely proportional to the number of hops it has to go. > > I'll send you all of the shars (inference rulecompiler and > the storm expert). If you could make sure that they are > available at your site either by reposting them from your > end or by some other means it would be appreciated. > > Thanks, > >George [Hageman] ========================================================================= ____Cut for storm.sh _____ #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # routine.h # weather.h # edir.c # gt_301.c # gt_302.c # lt_298.c # lt_301.c # message1.c # ndir.c # nedir.c # nwdir.c # rpd_fall.c # rpd_rise.c # sdir.c # sedir.c # slo_fall.c # slo_rise.c # steady.c # swdir.c # wdir.c # animal # weather # makefile # This archive created: Sun Jan 12 16:14:38 1986 export PATH; PATH=/bin:$PATH if test -f 'routine.h' then echo shar: will not over-write existing file "'routine.h'" else cat << \SHAR_EOF > 'routine.h' /* ** these are the two return values ** which must be returned as the exit ** value. Any other will result in ** an assumption that the result is true ** or that some sort of error occured. */ #define RETURN_ROUTINE_TRUE 254 #define RETURN_ROUTINE_FALSE 255 SHAR_EOF fi # end of overwriting check if test -f 'weather.h' then echo shar: will not over-write existing file "'weather.h'" else cat << \SHAR_EOF > 'weather.h' #define NORTH 1 #define NORTH_EAST 2 #define EAST 3 #define SOUTH_EAST 4 #define SOUTH 5 #define SOUTH_WEST 6 #define WEST 7 #define NORTH_WEST 8 #define STEADY 1 #define RISE_SLOW 2 #define RISE_FAST 3 #define FALL_SLOW 4 #define FALL_FAST 5 SHAR_EOF fi # end of overwriting check if test -f 'edir.c' then echo shar: will not over-write existing file "'edir.c'" else cat << \SHAR_EOF > 'edir.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[2]==EAST) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'gt_301.c' then echo shar: will not over-write existing file "'gt_301.c'" else cat << \SHAR_EOF > 'gt_301.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[0]>3010) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'gt_302.c' then echo shar: will not over-write existing file "'gt_302.c'" else cat << \SHAR_EOF > 'gt_302.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[0]>=3020) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'lt_298.c' then echo shar: will not over-write existing file "'lt_298.c'" else cat << \SHAR_EOF > 'lt_298.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[0]<2980) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'lt_301.c' then echo shar: will not over-write existing file "'lt_301.c'" else cat << \SHAR_EOF > 'lt_301.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[0]<=3010) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'message1.c' then echo shar: will not over-write existing file "'message1.c'" else cat << \SHAR_EOF > 'message1.c' #include #include "routine.h" #include "weather.h" /* common definitions for direction and stuff */ int main() /* ** note that argv[1] is a pointer to our array of common value */ { char string[20] ; int test ; int value[20] ; FILE *dataFile ; dataFile = fopen("WEATHER.DAT","wb") ; for(test = 0 ; test < 20 ; test++) value[test] = 0 ; /* ** value[0] = barometric pressure * 100 ** value[1] = condition of pressure ** 1-steady, 2-rise_slow, 3-rise_fast, 4-fall-slow, 5-fall-fast ** value[2] = direction of ground wind ** 1-n, 2-ne, 3-e, 4-se, 5-s, 6-sw, 7-w, 8-nw ** */ printf("\n \nWEATHER EXPERT: \n") ; printf("\n This program attempts to prove one of the following:"); printf("\n\tthe weather is ok\n\tthe weather is improving\n\tthe weather is deteriorating\n"); printf("\nNot all weather cases are included in the forecast algorithm."); printf("\n\nBefore we attempt a forecast, I need some data\n What is the barometric pressure reading?\n"); test = 0 ; while((test < 2000) || (test > 4000)) { printf("\n(Type in the pressure as an integer (BP*100) 30.1 = 3010...?"); scanf("%d",&value[0]) ; test = value[0] ; } printf("\n\t Thankyou!, \n\n Now I need to know how the barometer is acting\n"); test = 0; while((test <1) || (test >5)) { printf("\n\t Please input the correct number for the following:\n"); printf("\n\t 1 -- It is steady\n\t 2 -- It is rising slowly\n\t 3 -- It is rising rapidly") ; printf("\n\t 4 -- It is falling slowly\n\t 5 -- It is falling rapidly \n?"); scanf("%d",&value[1]); test = value[1] ; } test = 0 ; printf("\n\t Thankyou,") ; while((test < 1) || ( test > 8 ) ) { printf("\n\nNow I need the wind direction, which direction is it blowing from?\n"); printf("?") ; scanf("%s",string) ; if(0 == strcmp(string,"n")) value[2]=NORTH ; if(0 == strcmp(string,"ne")) value[2]=NORTH_EAST ; if(0 == strcmp(string,"e")) value[2]=EAST ; if(0 == strcmp(string,"se")) value[2]=SOUTH_EAST ; if(0 == strcmp(string,"s")) value[2]=SOUTH ; if(0 == strcmp(string,"sw")) value[2]=SOUTH_WEST ; if(0 == strcmp(string,"w")) value[2]=WEST ; if(0 == strcmp(string,"nw")) value[2]=NORTH_WEST ; if(0 == strcmp(string,"N")) value[2]=NORTH ; if(0 == strcmp(string,"NE")) value[2]=NORTH_EAST ; if(0 == strcmp(string,"E")) value[2]=EAST ; if(0 == strcmp(string,"SE")) value[2]=SOUTH_EAST ; if(0 == strcmp(string,"S")) value[2]=SOUTH ; if(0 == strcmp(string,"SW")) value[2]=SOUTH_WEST ; if(0 == strcmp(string,"W")) value[2]=WEST ; if(0 == strcmp(string,"NW")) value[2]=NORTH_WEST ; test = value[2] ; } printf("\n\n\n\n For the next question, you should stand outside with your back"); printf("\nto the surface wind. You now must observe the direction the"); printf("\nupper level clouds are moving. You observe them to be moving") ; printf("\nfrom your right, from your left, or in a direction parallel") ; printf("\nto that which your are facing.\n") ; printf("\nUse this information to answer the following question. If you"); printf("\nare unable to see the upper level clouds, answer no to the following"); printf("\nquestion.\n\n") ; fwrite(value,2,20,dataFile) ; fclose(dataFile) ; exit(RETURN_ROUTINE_TRUE) ; } SHAR_EOF fi # end of overwriting check if test -f 'ndir.c' then echo shar: will not over-write existing file "'ndir.c'" else cat << \SHAR_EOF > 'ndir.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[2]==NORTH) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'nedir.c' then echo shar: will not over-write existing file "'nedir.c'" else cat << \SHAR_EOF > 'nedir.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[2]==NORTH_EAST) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'nwdir.c' then echo shar: will not over-write existing file "'nwdir.c'" else cat << \SHAR_EOF > 'nwdir.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[2]==NORTH_WEST) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'rpd_fall.c' then echo shar: will not over-write existing file "'rpd_fall.c'" else cat << \SHAR_EOF > 'rpd_fall.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[1]==FALL_FAST) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'rpd_rise.c' then echo shar: will not over-write existing file "'rpd_rise.c'" else cat << \SHAR_EOF > 'rpd_rise.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[1]==RISE_FAST) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'sdir.c' then echo shar: will not over-write existing file "'sdir.c'" else cat << \SHAR_EOF > 'sdir.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[2]==SOUTH) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'sedir.c' then echo shar: will not over-write existing file "'sedir.c'" else cat << \SHAR_EOF > 'sedir.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[2]==SOUTH_EAST) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'slo_fall.c' then echo shar: will not over-write existing file "'slo_fall.c'" else cat << \SHAR_EOF > 'slo_fall.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[1]==FALL_SLOW) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'slo_rise.c' then echo shar: will not over-write existing file "'slo_rise.c'" else cat << \SHAR_EOF > 'slo_rise.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[1]==RISE_SLOW) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'steady.c' then echo shar: will not over-write existing file "'steady.c'" else cat << \SHAR_EOF > 'steady.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[1]==STEADY) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'swdir.c' then echo shar: will not over-write existing file "'swdir.c'" else cat << \SHAR_EOF > 'swdir.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[2]==SOUTH_WEST) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'wdir.c' then echo shar: will not over-write existing file "'wdir.c'" else cat << \SHAR_EOF > 'wdir.c' #include #include "routine.h" #include "weather.h" main() { FILE *dataFile ; int value[20] ; dataFile = fopen("WEATHER.DAT","rb") ; fread(value,2,20,dataFile) ; fclose(dataFile) ; if(value[2]==WEST) return(RETURN_ROUTINE_TRUE) ; else return(RETURN_ROUTINE_FALSE) ; } SHAR_EOF fi # end of overwriting check if test -f 'animal' then echo shar: will not over-write existing file "'animal'" else cat << \SHAR_EOF > 'animal' ! THIS IS THE KNOWLEDGE BASE FOR THE ! ANIMAL CLASIFICATION EXPERT ! IF ANIMAL HAS FEATHERS ANDIF ANIMAL LAYS EGGS THEN ANIMAL IS BIRD ! IFNOT ANIMAL IS BIRD THEN ANIMAL IS MAMMAL ! IF ANIMAL IS MAMMAL AND ANIMAL EATS MEAT THEN ANIMAL IS CARNIVORE ! IF ANIMAL IS CARNIVORE AND ANIMAL HAS POINTED TEETH AND ANIMAL HAS RETRACTABLE CLAWS AND ANIMAL HAS FORWARD POINTING EYES THEN ANIMAL IS CAT ! IF ANIMAL IS MAMMAL ANDNOT ANIMAL IS CARNIVORE AND ANIMAL HAS HOOFS THEN ANIMAL IS UNGULATE ! IF ANIMAL IS CAT AND ANIMAL HAS TAWNY COLOR AND ANIMAL HAS DARK SPOTS THENHYP ANIMAL IS CHEETA ! IF ANIMAL IS CAT AND ANIMAL HAS TAWNY COLOR AND ANIMAL HAS BLACK STRIPES THENHYP ANIMAL IS TIGER ! IF ANIMAL IS CAT AND ANIMAL IS SMALL AND ANIMAL IS DOMESTICATED AND ANIMAL MOSTLY CATCHES MICE AND ANIMAL LOVES WARM LAPS THENHYP ANIMAL IS A HOUSE CAT ! IF ANIMAL IS UNGULATE AND ANIMAL HAS LONG NECK AND ANIMAL HAS LONG LEGS AND ANIMAL HAS DARK SPOTS THENHYP ANIMAL IS GARAFFE ! IF ANIMAL IS BIRD ANDNOT ANIMAL FLIES ANDNOT ANIMAL SWIMS AND ANIMAL HAS LONG NECK AND ANIMAL IS BLACK AND WHITE THENHYP ANIMAL IS OSTRICH ! IF ANIMAL IS UNGULATE AND ANIMAL HAS BLACK STRIPES THENHYP ANIMAL IS ZEBRA ! IF ANIMAL IS BIRD ANDNOT ANIMAL FLIES AND ANIMAL SWIMS AND ANIMAL IS BLACK AND WHITE THENHYP ANIMAL IS PENGUIN ! IF ANIMAL IS BIRD AND ANIMAL FLIES AND ANIMAL FLIES WELL AND ANIMAL HAS WEBBED FEET ANDNOT ANIMAL HAS FLAT BILL THENHYP ANIMAL IS ALBATROS ! IF ANIMAL IS BIRD AND ANIMAL FLIES AND ANIMAL FLIES WELL AND ANIMAL HAS WEBBED FEET AND ANIMAL HAS FLAT BILL THENHYP ANIMAL IS DUCK ! ! ! IFNOT ANIMAL IS CHEETA IFNOT ANIMAL IS TIGER IFNOT ANIMAL IS A HOUSE CAT IFNOT ANIMAL IS GARAFFE IFNOT ANIMAL IS OSTRICH IFNOT ANIMAL IS ZEBRA IFNOT ANIMAL IS PENGUIN IFNOT ANIMAL IS ALBATROS IFNOT ANIMAL IS DUCK THENHYP THIS ANIMAL IS NOT WITHIN MY KNOWLEDGE SHAR_EOF fi # end of overwriting check if test -f 'weather' then echo shar: will not over-write existing file "'weather'" else cat << \SHAR_EOF > 'weather' ! ! WEATHER PREDICTOR AS WRITTEN BY JACK PARK AND ! TRANSLATED BY GEORGE HAGEMAN FOR DEMONSTRATION ! PURPOSES ONLY ! IF YOU WANT TO HAVE ME PREDICT THE WEATHER THENRUN message1.exe ! IFNOT YOU WANT TO HAVE ME PREDICT THE WEATHER ANDNOT YOU ARE ABSOLUTELY POSITIVE ABOUT IT THENRUN message1.exe ! IFNOT YOU WANT TO HAVE ME PREDICT THE WEATHER ANDIF YOU ARE ABSOLUTELY POSITIVE ABOUT IT THENHYP TOO BAD, WE COULD HAVE HAD SOME FUN! ! IFRUN message1.exe ANDIF YOU CAN SEE UPPER LEVEL CLOUDS ANDIF CLOUDS MOVING FROM YOUR LEFT THEN CLOUDS INDICATE BAD WEATHER ! IFRUN message1.exe ANDIF YOU CAN SEE UPPER LEVEL CLOUDS ANDNOT CLOUDS INDICATE BAD WEATHER ANDIF CLOUDS MOVING FROM YOUR RIGHT THEN CLOUDS INDICATE WEATHER IMPROVING ! ! IFRUN message1.exe ANDIF YOU CAN SEE UPPER LEVEL CLOUDS ANDNOT CLOUDS INDICATE BAD WEATHER ANDNOT CLOUDS INDICATE WEATHER IMPROVING ANDIF CLOUDS MOVE PARALLEL TO DIRECTION THEN CLOUDS INDICATE STEADY WEATHER ! IFRUN message1.exe ANDNOT YOU CAN SEE UPPER LEVEL CLOUDS THEN CLOUDS INDICATE STEADY WEATHER ! IFRUN gt_302.exe ANDRUN slo_fall.exe ANDRUN wdir.exe THEN WEATHER OK THEN FAIR AND WARM NEXT 48 HRS ! IFRUN gt_302.exe ANDRUN steady.exe ANDRUN wdir.exe THEN CONTINUED FAIR THEN LITTLE TEMPERATURE CHANGE THEN WEATHER OK ! IFRUN gt_301.exe ANDRUN slo_fall.exe ANDRUN nedir.exe AND CLOUDS INDICATE STEADY WEATHER AND SEASON IS SUMMER THEN RAIN MAY NOT fall THEN STEADY FOR SEVERAL DAYS THEN WEATHER OK ! IFRUN gt_301.exe ANDRUN slo_fall.exe ANDRUN nedir.exe AND CLOUDS INDICATE BAD WEATHER AND SEASON IS WINTER THEN RAIN WITHIN 24 HOURS THEN WEATHER TURNING BAD ! IFRUN lt_298.exe ANDRUN rpd_rise.exe THEN WEATHER IMPROVING THEN CLEARING AND COLDER ! IFRUN lt_301.exe ANDRUN slo_rise.exe AND CLOUDS INDICATE WEATHER IMPROVING THEN CLEARING WITHIN A FEW HOURS THEN FAIR NEXT SEVERAL DAYS THEN WEATHER IMPROVING ! IFRUN gt_301.exe ANDRUN slo_fall.exe ANDRUN edir.exe AND CLOUDS INDICATE BAD WEATHER THEN RAIN IN 12 - 18 HOURS THEN WEATHER TURNING BAD ! IFRUN lt_298.exe ANDRUN rpd_fall.exe ANDRUN ndir.exe THEN SEVERE STORM WARNING THEN SEVERE NORTHEAST GALES THEN WEATHER TURNING BAD ! IFRUN lt_298.exe ANDRUN rpd_fall.exe ANDRUN sedir.exe THEN SEVERE STORM WARNING THEN RAIN OR SNOW IMMINENT THEN WEATHER TURNING BAD ! IFRUN lt_301.exe ANDRUN slo_fall.exe ANDRUN edir.exe AND CLOUDS INDICATE BAD WEATHER THEN RAIN FOR NEXT DAY OR TWO THEN WEATHER TURNING BAD ! IFRUN lt_301.exe ANDRUN rpd_fall.exe ANDRUN edir.exe AND CLOUDS INDICATE BAD WEATHER THEN CLEARING WITHIN 24 HOURS THEN COOLER TEMPERATURES THEN WEATHER TURNING BAD ! IFRUN gt_301.exe ANDRUN rpd_rise.exe ANDRUN wdir.exe THEN FAIR TODAY THEN RAIN AND WARMER NEXT 48 HOURS THEN WEATHER TURNING BAD ! IFRUN gt_301.exe ANDRUN slo_fall.exe ANDRUN wdir.exe THEN WARMER THEN RAIN WITHING 24 - 36 HOURS THEN WEATHER TURNING BAD ! IFRUN gt_301.exe ANDRUN rpd_fall.exe ANDRUN wdir.exe AND CLOUDS INDICATE BAD WEATHER THEN WARMER THEN RAIN WITHIN 18 - 24 HOURS THEN WEATHER TURNING BAD ! IFRUN gt_301.exe ANDRUN slo_fall.exe ANDRUN sdir.exe THEN RAIN WITHIN 24 HOURS THEN WEATHER TURNING BAD ! IFRUN gt_301.exe ANDRUN rpd_fall.exe ANDRUN sdir.exe THEN WEATHER TURNING BAD THEN WINDY, RAIN WITHIN 12 HOURS ! IFNOT WEATHER OK IFNOT WEATHER TURNING BAD IFNOT WEATHER IMPROVING THENHYP INSUFFICIENT DATA FOR A FORECAST ! IF WEATHER OK THENHYP I'M GLAD THAT THE WEATHER WILL BE OK ! IF WEATHER TURNING BAD THENHYP TOO BAD ABOUT THE PICKNICK ! IF WEATHER IMPROVING THENHYP HOW ABOUT A PICKNICK? ! SHAR_EOF fi # end of overwriting check if test -f 'makefile' then echo shar: will not over-write existing file "'makefile'" else cat << \SHAR_EOF > 'makefile' #make file for weather storm: message1.exe gt_302.exe gt_301.exe lt_301.exe lt_298.exe \ wdir.exe nwdir.exe ndir.exe nedir.exe edir.exe sedir.exe sdir.exe \ swdir.exe steady.exe rpd_fall.exe rpd_rise.exe slo_rise.exe slo_fall.exe message1.exe: message1.c cc message1.c -omessage1.exe gt_302.exe: gt_302.c cc gt_302.c -ogt_302.exe gt_301.exe: gt_301.c cc gt_301.c -ogt_301.exe lt_301.exe: lt_301.c cc lt_301.c -olt_301.exe lt_298.exe: lt_298.c cc lt_298.c -olt_298.exe wdir.exe: wdir.c cc wdir.c -owdir.exe nwdir.exe: nwdir.c cc nwdir.c -onwdir.exe swdir.exe: swdir.c cc swdir.c -oswdir.exe edir.exe: edir.c cc edir.c -oedir.exe nedir.exe: nedir.c cc nedir.c -onedir.exe sedir.exe: sedir.c cc sedir.c -osedir.exe sdir.exe: sdir.c cc sdir.c -osdir.exe ndir.exe: ndir.c cc ndir.c -ondir.exe slo_rise.exe: slo_rise.c cc slo_rise.c -oslo_rise.exe steady.exe: steady.c cc steady.c -osteady.exe rpd_rise.exe: rpd_rise.c cc rpd_rise.c -orpd_rise.exe rpd_fall.exe: rpd_fall.c cc rpd_fall.c -orpd_fall.exe slo_fall.exe: slo_fall.c cc slo_fall.c -oslo_fall.exe SHAR_EOF fi # end of overwriting check # End of shell archive exit 0