Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By : Michael Badger
Book Image

Scratch 2.0 Beginner's Guide: Second Edition

By: Michael Badger

Overview of this book

Table of Contents (18 chapters)
Scratch 2.0 Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – ensuring grammatically correct questions


We have a good grasp on accessing groups of words as a single item, but this exercise is going to look at the individual characters of those strings. Right now, the teller has a script that starts with the when I receive (intro) block. It ultimately prompts the player for a question and validates the question before issuing the answer. We're going to revise this script. The steps are as follows:

  1. Detach the broadcast (fortune) block from the bottom of the stack and move it out of the way for now.

  2. The existing repeat until () block already provides a check for a minimum length and a duplicate question. We can perform a third check by adding a second () and () block to the existing evaluation. You'll need to reconstruct the expression by replacing the not ((questions) contains (answer)) expression with an () and () block. The following screenshot shows the revision:

  3. To the open value, we want to add the following evaluation: ((letter ...