Presentation is loading. Please wait.

Presentation is loading. Please wait.

2 Making Blocks.

Similar presentations


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

1 2 Making Blocks

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

3 Draw a square Leave CAT sprite & leave stage WHITE

4 How to draw a Square 100 Pen down Forward 100 Turn 90 Pen up 90°

5 Blocks needed to draw a square
Motion Pen Pen Add Extensions

6 How to draw a Square

7 ‘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

8 3 Stages of creating blocks
DEFINE 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 CALL

9 Define you block Click Make a Block Give it a name Click OK

10 Defining and Calling Blocks
CALL in MAIN program DEFINE call execute return

11 Defining block - initialise
Initialise is coding what you want to happen at the START of your program. call execute return

12 Challenges 5 6 3 Make a draw triangle block Make a draw pentagon block
\ Make a draw triangle block Make a draw pentagon block Make a draw hexagon block Make one up… 120° 360/3=120 72° 360/5=72 5 6 3

13 Shapes program

14 [1] Squares Using your draw square block, draw this pattern.
Using your draw triangle block, draw this pattern.

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


Download ppt "2 Making Blocks."

Similar presentations


Ads by Google