Let's write the script to recognize the names and deliver the parcel accordingly.
Select the Gift sprite.
Add a recognise () in camera image after () seconds block below the go to x: () y: () block. Select handwritten text from the drop-down and set the time as 2 seconds.
Snap an if () else block below the recognise () in camera image after () seconds block.
Add an () = () block in the input of the if block. In the first argument of the () = () block, add a handwritten text result block and in the second, write "John".
Alert: The text is case sensitive, so "John" and "JOHN" will be treated differently.
Add a glide () secs to () block under the if arm and select John from the drop-down.
Duplicate the if () else block and paste it under the else arm.
Write "Hazel" in the first argument of the () = () block and select Hazel from the drop-down of the glide block.
Under the else arm snap a say () for () seconds block and write "Try Again!".
With this, the script is complete:
Write the names on a paper, show it to the camera, and start the script by clicking the green flag.
Conclusion
In this lesson, you learned about optical character recognition, its applications, and made a project in PictoBlox based on OCR.
Assignment
Before you move on to the next lesson, a small assignment awaits you!
You must upload the PictoBlox program you wrote in this activity to the website.
Submitting the assignment is a must in order to receive the certificate after completing the course.
Follow the steps below to upload your assignment:
Click Choose File.
Select the image from the pop-up window that opens up.
Once the image is selected, click Upload Assignment.
The file type allowed is SB3 file generated from the PictoBlox program. The maximum file size allowed is 15 MB.