Goal: Ask something, answer something, say something.
Vocabulary: question, answer, announce, if, = (equals sign), stop
question [Hi! Do you want to learn how to make a quiz? Type YES or No and then click OK.]
if answer = "no [stop]
question [I'm glad. I will teach you. (This time after you write your answer, try hitting the Enter key instead of clicking OK.) How old are you?]
question [That's how old I am, too! What is your name?]
question [That is my name, too! What street do you live on?]
question [That is my street, too! How tall are you?]
announce [Well, I'm much smaller, as you can see. Will you still be my friend?]
announce [Good! You can learn how to make conversations like this by looking at the Procedures Page. Have fun!]
Your project can "talk" with a visitor using pop-up dialog boxes for asking questions and collecting answers.
- Hatch a turtle and turn it into the shape of a character who will "talk" with your visitors.
- In the Let's_talk! procedure, the command question makes a question box appear, with an area for an answer. Everything in the brackets after the word question will become the question.
Answer will report whatever is typed in the answer box is called as a single word. The computer can review what answer reports and decide what to do next.
- For the first question, ("Hi! Do you want to learn how to make a quiz?"), if the answer is no, then the procedure will stop. We use this command:
if answer = "no [stop]
For any other answer, the procedure will keep on going. In this sample project, no matter what the other answers are, the program is going to pretend to agree with it, until the last question! Then it will make an announcement instead of asking a new question.
Of course you should feel free to make up your own questions!
- Announce is a way to say something in a pop-up dialog box without giving a chance for an answer.
- Make a button with the procedure name Let's_talk! as its instruction, set to Once, and try talking with your "critter."
See if you can insert an announcement (such as "good-bye!") before stop in this command: if answer = "no [stop]
Write another if command so that if the user is the same age as you, the computer will announce your exact age.
On Your Own - Project Ideas
Design your own character.
Can you write your own questions for a conversation?