Beginner Coding with Blocks
Chapter
>
Level

Math and Text Operations
String Formats

Objective

Call out the chickens and count how many chickens there are around each coup using text blocks. A coup being the chicken houses seen in the map.

Walk to the darker X mark on the right side of the field and call out the chickens by using the speak block. Use a text block with "ChirpChirpChirpChirpChirpChirpChirpChirpChirpChirp" typed directly into it. Connect this text block to the speak block to call out all the "Chirp"s.

By calling them out, you'll make sure there are no chickens inside the coups. Count how many chickens are around each coup and store the numbers inside variables named: left_coup and right_coup.

After setting up the variables, head for each of the 2 X marks in front of each coup and call out the number of chickens around each using the variables. Use the speak block with a create text with block to combine text and numbers.

The create text with block lets you combine multiple pieces of text and variables together. To use it:

  1. Drag a create text with block from the Text category
  2. Click the gear icon on the block to add more items (you'll need 3 items total)
  3. Connect a text block with "Right Coup has " to the first slot
  4. Connect the right_coup variable to the second slot
  5. Connect a text block with " Chickens" to the third slot
  6. Connect the create text with block to the speak block

For the left coup, do the same but use "Left Coup has " and the left_coup variable.

Code book