Walkthrough for making a chatbot in PictoBlox
In this tutorial, we will make a chatbot in PictoBlox. We will use conditional statements to make the chatbot respond to the user's input.
Getting Started
First, download and install PictoBlox from here.
Launch PictoBlox and choose the Block Coding mode.
Now, let's start making the chatbot!
Making the chatbot
First, let's make the chatbot greet the user.
Drag and drop the when flag clicked block from the Events palette.
Next, drag and drop the say block from the Looks palette, write Hello! I'm your chatbot. How can I assist you today? in the text field and place it under the when flag clicked block.
Now, let's make the chatbot respond to the user's input.
Drag and drop an ask and wait block from the Sensing palette into the "forever" block. This block will allow the user to input their message.
Enter the question: "How can I help you today?"
Drag and drop an "if" block from the Control palette below the "ask and wait" block.
Drag and drop a "contains?" block from the Operators palette into the condition slot of the "if" block.
Place the "answer" block from the Sensing palette into the first slot of the "contains?" block.
Enter the keyword "symptoms" in the second slot of the "contains?" block.
(You can add the name of the symptoms like "fever", "cough", etc. in the "say" block.)
Drag and drop a "say" block from the Looks palette inside the "if" block.
Add the say block for the chatbot to send the details of the symptoms and treatments.
You can add more "if" blocks for the chatbot to respond to more keywords.
Now, To make the chatbot say goodbye to the user.
Drag and drop the say block from the Looks palette, write Goodbye! in the text field and place it under the if block.
Final Look:
That's it! We have successfully made a chatbot using conditional statements in PictoBlox!
You can also refer to this related tutorial: Make a Chatbot using PictoBlox using Speech Recognition
Top comments (0)