This source code is posted strictly for discussion purpose, without any warranty or guarantee of any kind whatsoever.
#include <stdio.h>
#include <string.h>
/*
Some C language to begin chatbot design.
*/
int main()
{
/* DATA */
char stimulus[72];
int match;
/* INPUT */
printf("Say something: ");
fgets(stimulus,72,stdin);
/* PROCESS */
if (strcasecmp(stimulus, "hello\n") == 0) printf("You greeted me.\n");
/* OUTPUT */
printf("You said: %s\n",stimulus);
return(0);
}
Program Output:
Tell me something: hello
You greeted me.
You told me: hello
It is simple, but simple is a good place to start sometimes.