06-Dec-16
INTRO
BACKGROUND
EXPERIENCE
EXPECTATION
USE OF TODAY’S LEARNING SESSION
1
06-Dec-16
SCRATCH PROGRAMMING EDUCATOR TRAINING
TIME ACTIVITY
10.00AM INTRODUCTION TO CODING
11.00AM LOGIC THINKING – OFFLINE MODE
12.00PM INTRODUCTION TO PSEUDOCODE
12.30PM FLOWCHART
2.00PM LUNCH
2.30PM TIMELINE CONCEPT
4.00PM TIPS AND DEBUGGING
5.00PM SESSION ENDS
SCRATCH PROGRAMMING EDUCATOR TRAINING
SCRATCH PROGRAMMING BEGINNER LEVEL
Familiar with Scratch programming platform and able to come out with
simple project easily.
PROGRAMMING LOGIC THINKING
Teaching the educator on the logic thinking using problem solving skill
through application. You will experience on building new program with a
systematic approach.
PSEUDOCODE AND FLOW CHART
Understanding the pseudo code and flow chart programming to have a
structural progress thinking before programming an applications.
2
06-Dec-16
EHXOEWCUITTIISVCEOSNUDMUMCTAERDY
FORUM FOR DISCUSSION
TEAMWORK IN SOLVING
CHALLENGES
ENJOYABLE WITH
EDUCATION SENSE
EXITE’CS UYTOIUVREPSRUOMGRMAAMRY
TAKE ACCOUNTABILITY &
RESPONSIBILITY FOR YOUR
LEARNING.
LET US KNOW IF THERE IS A
PROBLEM
ENJOY THE PROGRAMME
3
06-Dec-16
1) You will be given one piece of paper
2) Using the following “programming
code”, try to achieve the same outcome
as the picture shown
move one square forward
move one square backward
move one square up
move one square down
fill in square with black colour
RULE : Start at star
4
06-Dec-16
5
06-Dec-16
• PROGRAMMING SOFTWARE
PROGRAMMER INDIVIDUAL
WORK
What is a Program ?
provide (a computer or other machine) with coded instructions for the automatic
performance of a particular task.
What is Programming ?
the action or process of writing computer programs.
6
06-Dec-16
Learning Coding/Programming Is like learning how to read.
7
06-Dec-16
What do you know about Scratch?
How would you describe Scratch to a friend/ you student?
USING SCRATCH SOFTWARE
SCRATCH ONLINE SCRATCH OFFLINE
Click to use
Download Install Play
Go to use Go to download
http://scratch.mit.edu https://scratch.mit.edu/scratch2download/
8
06-Dec-16
ANIMATION STORIES VIDEO SENSING
GAMES INTERACTIVE ART MUSIC & DANCE
NEW FILE -> NEW
OPEN FILE -> OPEN - > LOCATE FILE
SAVE FILE -> SAVE/ SAVE AS
9
06-Dec-16
WE START TODAY BY
HAVING OUR CAT SAY
“HELLO”
WE START TODAY BY
HAVING OUR CAT SAY
“HELLO”
TODAY YOU WILL LEARN
HOW TO PROGRAM !! COOL ?
10
06-Dec-16
TEST AND EXPERIENCE SCRATCH
15 MINUTES
What does each colour represents?
What does each block do?
Try each block – whats possible
DISCUSSION TIME : 10 MINUTES
PAPER ACTIVITY : 30 MINUTES
11
06-Dec-16
Pseudocode is an artificial and informal language that helps programmers develop
algorithms. Pseudocode is a "text-based" detail (algorithmic) design tool
Example:
Pick up a cup
Place cup on the table
Fill cup with hot water
Put tea bag in the cup
Wait for 1 minutes
Tea is ready
If student's grade is greater than or equal to 60
Print "passed"
else
Print "failed"
LET’S MAKE THE CAT LIKE THIS IM GONNA
MOVE IT MOVE IT
WHEN CLICK UP
PEN DOWN
SET CAT DIRECTION UP
THE CAT MOVE 10 STEPS
12
06-Dec-16
TIPS
DEFINE CREATE STORY/
CHARACTERS FLOW
PROGRAMMING START CODING / MAKE MISTAKES
FLOW PROGRAMMING (TRY AND
ERROR)
(PSEUDOCODE)
DO IT FOR DOWN, LEFT & RIGHT
13
06-Dec-16
Any program can be described by using these 3 concept: sequences,
choices and loops.
SEQUENCE
Sequences are list of basic actions or step by step coommand to
be done in great detail for it to act.
14
06-Dec-16
Any program can be described by using these 3 concept: sequences,
choices and loops.
CHOICES
Choices are used to switch between different actions depending on a
condition.
For example: a condition that might check if the cup is there). A choice is
represented as a question mark in the diamond. The program flow will
have switched to one of the two branches according to the condition
meet (true) or not (false).
.
Any program can be described by using these 3 concept: sequences,
choices and loops.
LOOPS
Loops are used to repeat a sequence of actions or one action
depending on a condition. (for example: as long as there is cup
visible, continue to fill in water on each cup). The action repeat is
depending on the condition which is represented as a question
mark in a diamond. The program flow will repeat according to the
condition meet (true) or not repeat (false) will move on to another
action
15
06-Dec-16
MOVE UR CAT TO DRAW YOUR EQUAL SQUARE
FASTEST WILL WIN!
DISCUSSION TIME : 5 MINUTES
16
06-Dec-16
17
06-Dec-16
Let’s Make a Story
The cat is enjoying his time
in the woods.
A bat will appear suddenly
and say “boo”!
The cat will be scared and
run away
Let us start! www.littlebotz.com
1. Go to the ‘Looks’ section 18
and drag a “say” block
onto the script area.
2. Fill it in to say ‘Boo!’.
3. Start the script with the
green flag.
4. The bat will hide and wait
for 5 seconds:
5. After 5 seconds the bat
will appear and say
“Boo!”.
Learning Resources
06-Dec-16
Make the Bat Fly
1. The bat has two costumes. 2. We can make the animation
We can switch these happen with less script
costumes to make the bat flap blocks than we did with the
its wings cat.
Learning Resources www.littlebotz.com
The Bat’s Scripts www.littlebotz.com
1. The bat has two script blocks. One
block to hide and say “Boo!” and
another to flap it’s wings.
2. The bat will now hide for X
seconds, then suddenly appear
and say “Boo!”.
3. Test the bat script by clicking on
the green flag.
You can hide the cat so you just can watch the
bat
Does the script work as
Learning Resoeurxcpesected?
19
06-Dec-16
The Cat’s Scripts www.littlebotz.com
1. The cat is in the woods
enjoying the nice evening until
the bat appears and gives him
a fright.
2. The cat waits for X seconds,
then starts running.
3. Test the cat script by clicking
on the green flag.
You can hide the cat so you just can
watch the bat
Does the script work as
Learning Resoeuxrcpees cted?
Run the Story
1. Show the cat, then click on
the green flag.
Learning Resources 1. Does the cat run away exactly
when it was scared by the
bat?
2. You can adjust the wait time
so that the cat runs away at
the right time.
www.littlebotz.com
20
06-Dec-16
WHAT PROBLEM DO YOU ENCOUNTER WHEN RUNNING THE PROGRAM?
HOW CAN YOU SOLVE THEM?
Sprite Timing
1. We have made the cat look like it runs away when it has
seen the bat, but this is not really true. The cat is actually
waiting for 5 or 6 seconds and then it starts running
away.
2. Disconnect the bat’s script from the green flag and run
the project and see what happens.
3. The cat does really does not know that the bat exists at
all.
4. We want to make the cat react to the bat. Then we don’t
have to worry about getting the wait time exactly right.
Learning Resources www.littlebotz.com
21
06-Dec-16
Sprite Time Line
Sprite Timing Problem
1. We are trying to guess how many seconds the cat needs
to wait before running away. Why is this a problem?
2. What would happen if the bat was made to appear when
a key was pressed?
3. Then how will the cat know when the bat has appeared
and it is time to run away?
Learning Resources www.littlebotz.com
22
Broadcasting 06-Dec-16
1. The cat needs to be able www.littlebotz.com
to know the bat has
appeared so he can start
to run away.
2. This is done with
broadcasting
3. The bat must broadcast a
message.
4. The cat must receive the
broadcast message.
Learning Resources
Bat Broadcasting
1. Create a new broadcast message.
2. Name the message “booMessage”.
Add the “broadcast ‘booMessage’” block
to the bat’s script:
Learning Resources www.littlebotz.com
23
06-Dec-16
Cat Receives Broadcast
Message
1. The cat must receive the broadcast www.littlebotz.com
message.
2. Instead of waiting for 6 seconds before
running, replace this with a “When I receive
BooMessage” hat block:
Learning Resources
Cat Receives Broadcast
Message
replace Now the cat will
Learning Resources wait to receive the
message from the
bat before running
away.
www.littlebotz.com
24
06-Dec-16
Run Your Story!
1. Press a key to make the bat appear and say, “Boo”!
2. The cat will receive the broadcast and start running.
Learning Resources Don’t forget to hide the
bat when the story starts
www.littlebotz.com
TRY DEBUGGING YOUR PROGRAM
25
06-Dec-16
WE HAVE LEARNED MOTION
MOVE _SP_R_IT_E _(C_H_AR_A_C_TER)
PEN
SPRITE _D_R_AW__S ____
EVENTS
SPRITE _R_E_AC_T_S _ TO
EVENTS
DANGEROUS MAZE GAME
26
06-Dec-16
WE ARE GOING TO
LEARN
CONTROL
Control Sprite
SENSING
Senses your input to the
Sprite
YOUR INPUT = MOUSE OR KEYBOARD
OPEN YOUR BACKDROP DRAWING TOOLS
CLICK HERE
27
06-Dec-16
LEARNING TO DRAW BACKDROP
DRAW MAZE
HERE
DRAWING
TOOLS
LEARNING TO DRAW A BACKDROP
LINE
THICKNESS
COLOUR
PALLET
28
06-Dec-16
LEARNING TO DRAW A BACKDROP
CHANGE THE
BACKDROP
NAME
CLEAR/ADD
BACKDROP
BY
IMPORTING AN
IMAGE
MAKE IT HARD FOR
YOUR FRIENDS TO PLAY
<EVIL LAUGHTER>
29
RESIZE YOUR CAT 06-Dec-16
20
I’M TOO BIG FOR
THE MAZE
OPPSS..
I’M SMALL NOW SET YOUR
BUT I AM NOT CAT’S
SUPPOSE TO BE
STARTING
HERE POSITION
30
06-Dec-16
NOTICE:
THE
POSITION
YOU WANT
CAN BE SEEN
HERE
PROGRAMMING THE CAT TO MOVE
ARROWS KEYS
31
06-Dec-16
PROGRAMMING THE CAT TO MOVE
MAKE A COPY AND
CHANGE WHAT IS
NESSESARY
TIPS TO MAKE IT FASTER ARROWS KEYS
OH GOSH I CAN
PASS THE WALL.
AM I A GHOST ??
WE WILL USE
CONTROL &
SENSING HERE
32
06-Dec-16
INTRODUCING LOOP BLOCK
forever repeating LOOP BLOCK
Loop means repeating tasks.
There are two types of loops which
are forever repeating and repeat
10 times.
repeating for 10x
INTRODUCING IF BLOCK
IF BLOCK
IF Block means when
if (something happen) then do this
IF BLOCK
33
06-Dec-16
LOGIC TO STOP THE CAT FROM
GOING THROUGH THE WALLS
REPEAT THIS FOREVER
IF (CAT TOUCHES WALL)
THEN
CANNOT MOVE
TAKE A GOOD GUESS
HOW TO CHANGE THIS TO BLOCK
LOGIC TO STOP THE CAT FROM
GOING THROUGH THE WALLS
REPEAT THIS FOREVER
IF ((CCAATT TTOOUUCCHHEESS WWAALLLL))
THEN
CCAANNNNOOTT MMOOVVEE
34
06-Dec-16
REPEAT THIS FOREVER QUESTIONS
IF (CAT TOUCHES WALL) WHY TOUCHING
THEN BLACK ?
CANNOT MOVE THIS IS BECAUSE THE WALL IS BLACK. IF
YOUR WALL IS A DIFFERENT COLOUR,
PLEASE CHANGE ACCORDINGLY
WHY MOVE -5 STEPS?
BECAUSE WHEN THE CAT IS CONTROLLED,
IT MOVES FORWARD 5 STEPS. IF THERE IS A
WALL THE CAT TAKES 5 STEP BACK
MEANING
-5 STEP.
MAKE A NEW SPRITE (GOAL)
CLICK HERE
TO DRAW
SPRITE
35
06-Dec-16
MAKE A RED CIRCLE TO BE THE GOAL
PLACE IT AT THE END OF MAZE
MAKE A RED CIRCLE TO BE THE GOAL
PLACE IT AT THE END OF MAZE
36
06-Dec-16
NOW MAKE SURE YOU PROGRAM
THE GOAL SPRITE
WHEN GREEN FLAG CLICKED
REPEAT FOREVER
IF TOUCHING CAT THEN
SAY WIN
TIPS: DIFFERENT COLOURS
REPRESENTS DIFFERENT
BLOCKS. TRY TO PROGRAM
THE GOAL YOURSELF
PLAY YOUR FRIENDS MAZE !!!!
PUT THIS CODE INSIDE
YOUR PROGRAM FOR A
TIMER
37
06-Dec-16
38