Chapter 3: Conditional Blocks and and an App’s Hidden Memory

Build

Video Tutorial

The following 6-part video series accompanies Chapter 3 of Drag and Drop Code with Thunkable. It is a key fundamentals chapter and you’ll learn about how memory works, how to ask questions in your app (if conditionals), and how to build a count-down app.

  1. When a button is clicked, turn it red
  2. If conditions: click a button to toggle between red and blue
  3. Toggle a button from blue to purple to red
  4. Incrementing: Count how many times a button is clicked
  5. Build a Timer App
  6. Build a Timer App with a Start Button

CONCEPTUALIZE

1. How are an app’s memory cells named differently than the memory cells in a spreadsheet?

2. Explain what a set operation and a get operation do.

3. Consider the following blocks:

a. Assume that CountLabel.Text has a 5 in it. What will the value of CountLabel.Text be after this row of blocks is performed?

b. In what order are the individual blocks in this row executed? c. What is the term for the task completed by the row of blocks?

4. Consider an app with a Button that starts with the text “Go” on it. The following blocks are supposed to toggle the button’s text between “Go” and “Stop” each time it is clicked.

The code doesn’t work. Explain, in detail, what actually happens when the button is clicked.

5. Consider the following diagram and suppose A, B, and C are boolean (true/false) conditions.

“operation 1” will be executed if A is true. Under what conditions will operation 2 and operation 3 be executed?

CUSTOMIZE

1. Write an app with a single button that starts with a zero on it. When clicked, the number on the button should increase by 1. When the number reaches 10, the app should speak, “Mission complete” and clicking the button again should no longer have an effect.

2. Write an app that has two buttons, both starting out with blue backgrounds. When the first button is clicked, it should toggle between blue and red. When the second button is clicked, it should become the current color of the first button.

CREATE

Create a simple arithmetic game for kids. Provide some simple math problems displayed in Labels, with adjacent input forms (TextInput and Button) for the user to enter answers. Check the user’s answer and report if they are right or wrong using another Label or a say block.

Share your creative apps with your authors and other Drag and Drop coders:

  • Use #DragAndDropCode and #MadeWithThunkable on your social media platforms.
  • @ us at @DragAndDropCode on Twitter and Instagram.