Chattering Chatterbot Download

Christina Cacioppo

classes, inheritance Polish needed


Introduction

Computers can do many things, but they're not very good at carrying on a conversation – unless we teach them how to do so.

Chatterbots are programs designed to talk, or chatter, away. Eliza, SmarterChild, and Parry are famous chatterbots of times past. Let's make our own chatterbot.


Task

Let's make a basic chatterbot first. We'll want to build a chatterbot class with:

  1. A way to construct a new Chatterbot.
  2. Every chatterbot knowing its own name
  3. void sayHello(), void sayGoodbye(), void continueConversation(), and void waitForResponse() methods


Starter code

class Chatterbot{
	
}

Expected output

The precise implementation is up to you, but as one example, running this script:


Chatterbot chatters = new Chatterbot();
chatters.sayHello();
String response = chatters.waitForResponse();
while(response){
	chatters.continueConversation();
	if(response.equals("Goodbye!"){
		chatters.sayGoodbye();
		break;
	}
}
should produce something like this, where the chatterbot is in black and the user is in blue.

"Hi there!"
"Hi!"
"Is that so?"
"Er, I think so?"
"Really?"
"Yes! I just said hello!"
"You wouldn't say?"
"Hrmph."
"I had no idea."
"Goodbye"
"Bye!"

(No need to follow this Chatterbot exactly; give yours its own speaking style!)


Hints



Useful tools to solve the problem


Related links