/*
*********************************************************************
*
*	The Essence of OLE
*
*	Source code sample
*
*	Copyright (c) 1996, Rolling Thunder Computing, Ipswich MA
*
*	e-mail: essence@rollthunder.com
*	CompuServe: 73540,3430
*	Web: http://www.rollthunder.com
*
*	File Name: ELIZA.C
*
*	Purpose: Phoney psychiatrist.  Found on the Web, translated from PASCAL.
*
*********************************************************************
*/

#include <windows.h>

#define MAXINDEX 7

WCHAR *Responses [] = {
	L"Eliza: Say, do you have any psychological problems ?",
	L"Eliza: Man, you are just too crazy !",
	L"Eliza: What does that suggest to you?",
	L"Eliza: I see.",
	L"Eliza: I'm not sure I understand you fully.",
	L"Eliza: Come, come, elucidate your thoughts.",
	L"Eliza: Can you elaborate on that?",
	L"Eliza: That is quite interesting." } ;

void Eliza (WCHAR *pIn, WCHAR *pOut)
{
	static int index = 0 ;

	lstrcpy (pOut, Responses [index]) ;

	index ++ ;
	if (index > MAXINDEX)
	{
		index = 0 ;
	}
}