Customizing and Debugging

Paul please note: Brian and I have agreed to drop costuming from 1.1 entirely (cutting the first part of page 2 and starting with problem 3b) and just giving them the costumes in a starter project on page 1.1.1. Then we'd teach adding costumes here (as shown below) before they write code to let the user change the costume in 2.1.5. Thoughts? --MF, 4/17/19

On this page, you will edit the word lists used by the sprites and debug any problems.

  1. Open your U1L2-Gossip project. Edit these three reporter blocks to change the phrases that the program uses. (See the instructions in the box below.) Be creative and funny but thoughtful.
    who block does what block who2 block

    How to Edit a Block

    1. Find the block in the scripting area or the colored palettes on the left.
    2. Control-click (or right-click) on the block and choose "edit..."
    3. Make changes to the block's internal code. (Instructions are already inside these blocks.)
    4. Click OK when you're satisfied. (Or click "Cancel" if you don't want to make changes.)
Why do these blocks use report ()? Why not just use say ()?

The report and say blocks mean very different things. Report tells something to the computer, and that value can be used as input to another block, such as the join block inside gossip. Say just shows a value to the user in a speech bubble.

: Lists, Strings, and Concatenation

    This process of testing, finding problems, and fixing them is called debugging.

  1. Make sure your program works. Test each block as well as the program as a whole. If something doesn't work, don't go on without fixing it.
  2. Save your work
  3. AAP-2.D
    Which of the following sentences could be reported by gossip?
    gossip: (report (join (who) ( ) (does what) ( ) (who)))
    For reference:
    who reporter block definition: report (item (random) of (list (Señora) (Ms. C) (my cat) (Hannah) (Jake))) does what reporter block definition: report (item (random) of (list (listened to) (loves) (ran away from) (helped) (is in a band with)))
    Señora and Ms. C helped.
    Señora ran away from my cat.
    Hannah listened to Hannah.
    Jake helped.
  4. Change the costumes to anything you like.
    This currently duplicates some content on 1.1.2. We need to decide where costumes really belong. --MF, 4/17/19

    Adding a Costume

    1. In the sprite corral, select the sprite you want to give costumes to.
    2. Choose "Costumes..." from the File (File button) menu.
    3. Choose a costume.
    4. Click "Import."
    5. Click "Cancel" to close the dialog box.
    You can use a photograph or picture from the Internet by dragging the image onto the Snap! window.
  5. Fix any issues with your costumes.

    Adjusting a Costume

    • You can change the size of your sprite using set size to ( ) %.
    • You can change the position of your sprite using go to x: () y: ().
    • You can change the direction your sprite is facing:
      point in direction (270) with menu open showing right left, up, down, random
  1. Change the background on the Stage.

    Adding a Stage Background

    Changing a stage background is almost like changing a costume.
    1. In the sprite corral, select the stage.
    2. Choose "Backgrounds..." from the File (File button) menu.
    3. Choose a background.
    4. Click "Import."
    5. Click "Cancel" to close the dialog box.