Step 1 Introduction
You are going to learn how to program a character that can talk to you! A character like that is called a chat robot, or
chatbot.
What you will make
What you will learn
Use code to concatenate strings in Scratch
Know that variables can be used to store user input
Step 2 Your chatbot
Open a new scratch project
Step 3 A talking chatbot
Now that you have a chatbot with a personality, you’re going to program it to talk to you.
shown in the top left-hand corner of the Stage. To make it disappear from the Stage, go to the Variables blocks
section and click on the box next to name so that it is not marked.
Step 4 Making decisions
You can program your chatbot to decide what to do based on the answers it receives.
First, you’re going to make your chatbot ask a question that can be answered with “yes” or “no”.
At the moment, your chatbot doesn’t say anything to the answer “no”.
If you click your chatbot’s Costumes tab, you’ll see that there is more than one costume.
Have you noticed that, after your chatbot’s costume has changed, it stays like that and doesn’t change back to what it
was at the beginning?
You can try this out: run your code and answer “no” so that your chatbot’s face changes to an unhappy look. Then run
your code again and notice that your chatbot does not change back to looking happy before it asks your name.
Step 5 Changing location
You can also program your chatbot to change its location!
Test your program, and answer “yes” when the chatbot asks if you want to go to the moon. You should see that
the chatbot’s location changes.