📚 Quick Study Guide: Scratch Chatbots
- 💬 A chatbot is a computer program designed to simulate conversation with human users, especially over the internet.
- 🚀 In Scratch, we can create simple chatbots using specific blocks to ask questions, listen to answers, and respond.
- ❓ The 'ask and wait' block (found in Sensing) is crucial for getting input from the user. It also stores the user's answer in a special variable called 'answer'.
- 🗣️ The 'say' block (found in Looks) makes your chatbot speak or display text.
- 🧠 To make smart responses, we use 'if-then' and 'if-then-else' blocks (found in Control) to check the user's 'answer' and respond differently based on what they typed.
- ✔️ Comparison operators like '=' (equals) from the Operators category are used inside 'if' blocks to compare the user's 'answer' to specific words or phrases.
- 💡 Chatbots can be programmed to tell jokes, ask about feelings, or even play simple guessing games, making coding interactive and fun for elementary students.
📝 Practice Quiz
- What is the main purpose of a chatbot in Scratch?
- To draw colorful pictures.
- To make the sprite jump high.
- To have a conversation with the user.
- To play music in the background.
- Which Scratch block is used to ask a question to the user and wait for their response?
say [Hello!] for (2) seconds
ask [What's your name?] and wait
broadcast [message1]
go to x: (0) y: (0)
- Where does Scratch store the user's answer after an 'ask and wait' block is executed?
- In the 'answer' variable.
- In the 'score' variable.
- In the 'timer' variable.
- In the 'my variable' block.
- To make your chatbot respond differently based on the user's input, which type of control block would you primarily use?
repeat (10)
forever
wait (1) seconds
if <> then else
- If you want your chatbot to say "Hello!" after the user types their name, which block would you use to make the chatbot speak?
think [Hmm...] for (2) seconds
say [Hello!]
change [color] effect by (25)
switch costume to [costume1]
- Which category contains the 'ask and wait' block?
- Looks
- Events
- Sensing
- Operators
- What is a common block used with the 'answer' variable to check if the user's input matches a specific word?
pick random (1) to (10)
join [apple] [banana]
< > (comparison operator like equals)
not <>
Click to see Answers
1. C
2. B
3. A
4. D
5. B
6. C
7. C