Activity 5: Echoing Wildcards
Echoing Wildcards
Let’s use the wildcard *
and <star />
tag together to allow our bot to include user input in its response.
If the user enters “My name is [name]”, the bot should respond with “Nice to meet you, [name]!”. Examples:
Input Output My name is John Nice to meet you, John! My name is Jane Nice to meet you, Jane! My name is Bob Nice to meet you, Bob! If the user enters “My favorite color is [color]”, the bot should respond with “I also like [color]!”. Examples:
Input Output My favorite color is blue I also like blue! My favorite color is red I also like red! My favorite color is green I also like green! If the user enters “My favorite food is [food]”, the bot should respond with “[food]! Yum!”. Examples:
Input Output My favorite food is pizza pizza! Yum! My favorite food is pasta pasta! Yum! My favorite food is sushi sushi! Yum!