AI-MegaHAL
view release on metacpan or search on metacpan
libmegahal.c view on Meta::CPAN
#define bool Boolean
#endif
#ifdef DOS
#define SEP "\\"
#else
#define SEP "/"
#endif
#ifdef AMIGA
#undef toupper
#define toupper(x) ToUpper(x)
#undef tolower
#define tolower(x) ToLower(x)
#undef isalpha
#define isalpha(x) IsAlpha(_AmigaLocale,x)
#undef isalnum
#define isalnum(x) IsAlNum(_AmigaLocale,x)
#undef isdigit
#define isdigit(x) IsDigit(_AmigaLocale,x)
#undef isspace
#define isspace(x) IsSpace(_AmigaLocale,x)
#endif
#ifndef __mac_os
#undef FALSE
#undef TRUE
typedef enum { FALSE, TRUE } bool;
#endif
typedef struct {
BYTE1 length;
char *word;
} STRING;
typedef struct {
BYTE4 size;
print("#Testing AI::MegaHAL->do_reply method\n");
my $query = "#We are the knights who say NI!";
print("# * Sending: $query\n");
my $reply = $megahal->do_reply($query);
print("# * Replied: $reply\n");
ok($reply ne "", 1);
print("#Destroying MegaHAL - should autosave brain and dictionary files\n");
$megahal = undef;
ok(1);
print("#Checking for brain file: megahal.brn\n");
ok(-f 'megahal.brn', 1);
print("#Checking for dictionary file: megahal.dic\n");
ok(-f 'megahal.dic', 1);
( run in 1.252 second using v1.01-cache-2.11-cpan-d80b1682f3f )