Artificial Stupidity By: Robert A. Seace 120 Brainerd Road, Apt. 2 Allston, MA 02134 (617) 277-8835 ras@magrathea.com http://www.magrathea.com/~ras/ You've heard of AI (Artificial Intelligence), well this is AS (Artificial Stupidity)! It's a fun, table-driven program, in the spirit of the old Eliza program, which responds to user input, with a personality (or multiple personalities) as defined in the current personality table... The program is distributed with a sample table which simulates the complex personalities of Beavis & Butt-Head... ;-) You may just use that one as it is, or modify it to suit your own tastes, or create an entirely new one from scratch... By looking at this sample table, you should be able to figure out how everything works... The code was written with portability in mind, and SHOULD be portable to just about any system with a Posix/ANSI-compliant compiler, and probably to many without such a compiler (though, some features may be lost)... Here are some possible changes you may need to make for the program to compile on your system: as.h: If your compiler doesn't like Posix/ANSI-style function prototypes, then, comment out the line which reads "#define POSIX_PROTOTYPES". Old K&R-style prototypes will be used instead. If your compiler doesn't have the "getopt()" function in its standard libraries, then comment out the line "#define YOU_HAVE_GETOPT". A built-in, less powerful, command-line argument parser will be used instead. You may need to add/remove/change some of the #include'd header files. (Eg: You may not have an "" on your system.) If your compiler doesn't have the "fnmatch()" function in its standard libraries, you have 4 choices: if it supports "gmatch()" instead, then uncomment the line which reads "#define fnmatch(p,s,f) (NOT gmatch (s, p))", and modify the "makefile" to use the right LFLAGS; find a function it does have, which will fill the same role; write your own function to fill the role; or, uncomment the line which reads "#define fnmatch(p,s,f) (strcmp (s, p))". The latter is a drastic, last resort, in my opinion. By doing this, you lose all pattern-matching ability, and are reduced to simple, exact string matches... Hopefully, your compiler will have fnmatch(), or some similar pattern-matching function you can use, so you never have to face this problem. According to my compiler manual, it is a Posix standard function (POSIX 1003.2)... makefile: Change any compiler/linker flags, as necessary for your particular system... (If you're using gmatch() instead of fnmatch(), you'll likely need the "-lgen" added to the "LFLAGS", to link in the appropriate library...) Other than that, you should have no troubles compiling the source. Note: This code is distributed as Public Domain. Do with it whatever you please. However, if you DO change anything, I ask that you please make note of it in the code, and in this README file, and increment the version number, if you plan on re-distributing it in that manner. Thank you...