Presentation is loading. Please wait.

Presentation is loading. Please wait.

2 Making Blocks with INPUTS.

Similar presentations


Presentation on theme: "2 Making Blocks with INPUTS."— Presentation transcript:

1 2 Making Blocks with INPUTS

2 1 2 3 Today’s Objectives Know how to break problems down into chunks
Know how to define blocks with inputs 3 Know how to call the blocks in a program Create programs where you create your own blocks with inputs

3 Homework  Subject Homework Date Done Computing
Learn “2. Making Modular Programs” for test

4 ‘Smarter’ programming
Smart programmers break problems down into smaller parts so they can write code in chunks or modules. In Scratch, you create modules by making your own blocks. Scratch Blocks Own Blocks

5 dd/mm Leave page blank

6 2. Making Modular Programs
dd/mm Leave page blank

7 2. Making Modular Programs
dd/mm

8 2. Making Modular Programs
dd/mm Smart programmers break problems down into smaller parts so they can write code in chunks or modules.

9 2. Making Modular Programs
dd/mm Smart programmers break problems down into smaller parts so they can write code in chunks or modules. Modules of code are good because: You can give them names You can give them different inputs to vary the results And chunks make a program easier to understand and debug

10 Scratch blocks can take INPUTS
number e.g. 1, 20, -2, 3.4 number e.g. 90, 15, -180 text e.g. “Hi”, “meow”, “Correct”

11 3 Stages of creating blocks
BLOCK NAME 3 Stages of creating blocks You define a block with a meaningful name You add any inputs like special variables to use in the block You call the new block from your program INPUT Use INPUT like a block variable length

12 2. Making Modular Programs
dd/mm Smart programmers break problems down into smaller parts so they can write code in chunks or modules. Modules of code are good because: You can give them names You can give them different inputs to vary the results And chunks make a program easier to understand and debug In Scratch, you create modules by making your own blocks in 3 stages: You define a block with a meaningful name You add any inputs like special variables to use in the block You call the new block from your program

13 In Scratch, you create modules by making your own blocks in 3 stages:
You define a block with a meaningful name You add any inputs like special variables to use in the block You call the new block from your program Here is an example of how you define & call a block that uses inputs:

14 Making a block with INPUTS
number or text label label

15 Making Blocks input number or text input boolean label

16 draw square input steps
number or text label label

17 Define block with inputs
Inputs are like special block variables

18 Challenges Draw this pattern Draw any pattern

19 draw any shape input steps input sides
text or number input text or number label label label

20 Define

21 Challenges Draw pattern using draw any shape block Draw any pattern

22 Challenges Draw this pattern Draw any pattern

23 1 2 3 Today’s Objectives Know how to break problems down into chunks
Know how to define blocks with inputs 3 Know how to call the blocks in a program Create programs where you create your own blocks with inputs


Download ppt "2 Making Blocks with INPUTS."

Similar presentations


Ads by Google