Developing a Block That Makes Plurals

You can load a snap library at any time from the File menu File button under "Libraries...".

For this project, you will need to load the Words, sentences library.

  1. Experiment with the blocks letter n of word, join, last letter of and all but last letter of to see how they behave.
  2. Experiment boldly: Here are some suggestions. You might try other experiments, too.

    letter 2 of butterflies letter 7 of fly letter minus2 of fly

    letter picked randomly from 1 to 10 of butterfly

    all but last letter of butterfly last letter of all but last letter of brush
    join boss es join t all but first letter of when
    Try join-(t)-all-but-first-letter-of with the words "where" and "what" and "wherefore," too.

The goal now is to build plural, a reporter block that takes a noun as input and outputs the plural of the noun, spelled correctly. plural day (with result) plural boss (with result)

Choose the reporter button when you make the plural block.

select reporter as block type

Here's one way to start building that block.

plural-(script), first try

  1. Build this much and test it out on at least "day" and "boss" and "medicine," to make sure it works correctly for those. If it does not, edit it to fix it.
  2. Debugging: Try hard to find words for which this version of plural does not work correctly. Write down the words you find. Organize that list, sorting the words into categories according to their last letter. For example, some of the words it gets wrong will be words that end with the letter h. Try to find other words it gets wrong. You will probably find other categories. Save your list. You will need it for future activities.
  3. Debugging: One important part of writing code that works is trying to "break" it, trying to find situations in which it does not work. This requires thinking of diverse examples, wild and exceptional cases, sometimes even including inputs that are incorrect in some way. plural of a word with a space following the word

    For now, focus only on real English nouns, typed correctly. Record the ones that plural spells wrong.

  4. plural should now work correctly for "day" and "boss" and "medicine," but it probably doesn't yet work correctly for the word "box" suffix s box (with wrong result).

    Edit your plural block to make it work for words that end with x.

 
  1. If you know another language, build a block that takes a pronoun and verb as input and outputs the correct form of that verb.
    For example:
    conjugate verb (Spanish) for nosotros comer conjugate verb (Spanish) for yo tocar
"U2Lab1-Plural"save your work as U1Lab2Crayon