Say Hello to Snap!

from Jadga: "First project „fancy letter” block – K is twice in the list." --MF, 7/24/23
In this activity, you'll play greet the user in various languages and with fancy text.
say hello to (fancy('Huan') in ('Cantonese') reporting 'néih hóu ᕼย𝕒N'

Snap! is a block-based programming environment designed to teach the big ideas of computer science. It can be used to make all sorts of programs—image editing, text processing, games, data analysis, scientific computation, sound editing, robotics, and more.
Snap! logo

Making Reporters Report

    A block is a piece of code. If you click a block, the computer will run the code.

    Add the open project icon here and on all lab pages going forward. Also update project names to say Sparks instead of BJCMS, and remove any extra blocks added to projects by Snap updates.
  1. Open this Say Hello To Snap project. It has a single block in the "Scripts" area (the central space of the Snap! window):
    say hello to () in ('English')
  2. Type a name in the blank slot, and click the block to see what happens. Did you see a bubble pop-up?
    say hello to (Amira) in (English) reporting 'hello, Amira'
  3. Change the name, and click the block again.

Every Snap! program is made up of blocks like say hello that tell the computer what to do. This block says hello to someone in a specified language.

  1. Choose a different language from the dropdown menu that says "English," and click the block again. What changed about the bubble this time?
    If you'd like a demonstration, click the image below to start/stop a video demonstration.
    video showing how to choose a different language in the 'say hello' block by clidking the dropdown menu that says 'English'

Blocks Within Blocks

  1. Find the fancy () reporter block in the palette on the left. Drag it into the Scripts area somewhere separate from the say hello block.
  2. Type a name into the fancy block, and click the block to see what it reports. Does it look… Ƒᵃ𝐍𝓬у?
  3. Snap! got its name because you can snap blocks together. Drag the fancy block inside the first input slot of the say hello block, replacing the name from before. Click the combined expression to see the output.
    Tip: When you drag one block inside another block, you can see where it will go. It will go in the input slot marked with the white box.
    An image showing 'fancy(Huan)' being dropped into 'say hello'. There is a white box around the first input of 'say hello' showing where 'fancy(Huan)' will go.
    You should see a personalized greeting to a fancy version of the input name in the chosen language.
    say hello to (fancy('Huan') in ('Cantonese') reporting 'néih hóu ᕼย𝕒N'
    1.1.1.7 change result pic to a language without any special characters on the hello so that the fancy really stands out (both images above) --MF, 8/8/23
  4. Talk with Your Partner Does order matter for blocks inside blocks?
    1. What will be the results of clicking the two expressions below? Will they be the same or different? Don't check in Snap!. Try to figure it out.
      say hello to (fancy(Esperanza)) in (Spanish) fancy (say hello to (Esperanza) in (Spanish))
    2. After discussing your ideas, check the difference in Snap!. What's going on? Talk to other people until everyone understands what's happening.
In this activity, you learned to run a block by clicking it, you saw how changing the inputs to a reporter block can change its output, and you used the output of one reporter as the input to another, making a chain of computation.