To consider: should L6 come before L5 (and should they both come before L4?)? These activities seem easier than Caesar. There was also some feedback about reordering the pages in this lab. --MF, 1/10/23

Texting Time

In this activity, you’ll use reporters to transform text messages 🎉 🤩 🐱 and add your own S👏T👏Y👏L👏E👏, and you'll create descriptions of what these reporters do.

Styling Your Text Messages

  1. Open this Texting Time project, and save it to your account. It includes several blocks that process text:
    uppercase () lowercase () clapify () emojify () songify () shorthand ()
  2. All of these blocks take text as input. For example, the uppercase block capitalizes all the English letters in the text:
    uppercase (be more assertive!) reporting 'BE MORE ASSERTIVE!'
  3. Talk with Your PartnerExperiment with the blocks. Try some messages that you might actually text to someone. Do the blocks always work like you expect, or can you find some inputs that cause them to output strange things?
  4. Nest the text processing blocks to turn these input strings into the target output string:
    1. Input: just do it
      ↳ Output: J👏🏽U👏🏽S👏🏽T👏🏽 D👏🏽O👏🏽 I👏🏽T👏🏽
    2. Input: Oh Mister Golden Sun - please come out and play
      ↳ Output: 🎶 oh mister golden ☀️ - please come out and play! 🎵
  5. For each of the following blocks, write a description of what the block does based on the input given and the output reported.
    songify () emojify () clapify () shorthand ()
    For example, for the uppercase () block, you might write: "This block takes a string of text as input and reports the same text but with all of the lowercase letters changed to uppercase."

Adding Program Documentation

Consider breaking this section out onto it's own page after the rest of the content on this page. --MF, 1/10/23

Programmers often write descriptions of their code (also called documentation) to remind themselves what the code does and to help other programmers read, understand, and use it.

In Snap!, you can use "comments" to document your code. If you right-click (or control-click on a Mac) the background of the scripting area and choose "add comment," you will get a comment bubble that you can drop anywhere in your code. Comments are only for reading by humans; they are not run by the computer the way code is.
image of scripting area dropdown menu open showing 'add comment' menu-item selected

Comments can be added near code, between pieces of code, or attached to pieces of code.
clapify (emojify (uppercase ('I won the soccer game!'))) with a comment attached on the right side. The comment contains the text 'This script makes my text uppercase, replaces the word 'soccer' with an emoji, and adds clapping hands.'

A comment can also be attached to the hat block for a custom block, and that text will then appear as the help text for the block. The first step is dropping a comment bubble on the hat block of a custom block in the block editor:
uppercase block code with a comment attached to the hat block. The comment contains the text 'This block takes a string of text as input and reports the same text but with all of the lowercase letters changed to uppercase.'

Then, when right-clicking the block and selecting "help" from the dropdown menu, you'll see something like:
Help window open with the text 'This block takes a string of text as input and reports the same text but with all of the lowercase letters changed to uppercase.' and an 'OK' button.

  1. Read the help text for the lowercase block, and then open the Block Editor for the lowercase block to see how the help text was created by adding a comment to the hat block.
  2. Choose one of the four blocks for which you wrote down a description, and use your description to create help text by attaching a comment to the hat block.
    songify () emojify () clapify () shorthand ()
  3. Save your work
  1. Create help text for the three remaining text processing blocks.

Export Text Messages

  1. Use the output of these blocks outside of Snap! by using the export text () block. Click for instructions.
    1. Put the block that outputs the text message you wish to export into the input slot of the export text block, and run the export text block by clicking it.
    2. Right-click the text to export watcher on the stage, and choose "export..." from the dropdown menu.
      'text to export' watcher on stage with dropdown menu open showing 'export...' menu-item selected
    3. Open the file that is downloaded, copy the text, and paste it wherever you want to use it.

Draw a Conversation

The draw convo with messages () block takes any number of messages as input and draws as many messages as it can fit in a picture of a phone on the stage.

  1. Create a conversation by dragging one of your messages into the block, clicking the right arrow to add more slots for additional messages.
  2. Show your classmates your conversation and check out theirs. A lot can happen in a short number of messages!
  3. Is there a cute show&tell graphic? I don't recall -PF

    Not currently, but that could be fun to make when we have time one day! :) --MF, 10/21/21

In this activity, you explored several text-processing blocks, learned about program documentation, and used Snap! comments to create help text for a block.