SlideShare a Scribd company logo
1 of 14
How do I program a
computer?
Three basic ideas
1. Variables
2. Branching
3. Looping
That’s all there is to it. We’ll explore
using a program called Scratch.
Sprites
• Sprites are little pictures
• We can animate them by changing the picture quickly
• We can move, rotate, scale, hide, flip …..
• This is how we create movement for our world.
This is sprite1,
it comes
already loaded
in the SPRITE
LIST and has
already been
placed on the
STAGE
Task: Right Click and delete sprite1 from
the SPRITE LIST
Task: Click on the insert new sprite button.
Task: Select the sprite called cat2 from the
animals folder.
Task: Rename the sprite and call it cat.
Remember to always call new sprites sensible
names!
Task: From the control menu, drag
and drop this rule into the SCRIPTS
AREA
Task: From the control menu, drag and drop
the forever rule into the SCRIPTS AREA and
join it together.
Compatible
rules can
be joined
together in
the
SCRIPTS
AREA
Task: From
the motion
menu, drag
and drop the
point towards
rule into the
SCRIPTS
AREA and join
it inside the
forever rule
Task: choose mouse pointer from the
drop down list.
Task: change number of steps to 3.
Task: From
the motion
menu, drag
and drop the
move 10
steps rule into
the SCRIPTS
AREA and join
it underneath
the point
towards rule.
Task: run your program by pressing the
green flag.
Notice how the co-ordinates change as
you move the mouse and sprite.

More Related Content

Similar to Program a Computer with Scratch: Variables, Branching & Looping

BGC2011Scratch-Rev1.pdf
BGC2011Scratch-Rev1.pdfBGC2011Scratch-Rev1.pdf
BGC2011Scratch-Rev1.pdfTNGanesan
 
Mode d’emploie delta force xtreme mission editor
Mode d’emploie delta force xtreme mission editorMode d’emploie delta force xtreme mission editor
Mode d’emploie delta force xtreme mission editorFabian Chailler
 
Scratch MIT Coding Basics
Scratch MIT Coding BasicsScratch MIT Coding Basics
Scratch MIT Coding BasicsProAryamanGamer
 
The Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
The Adventures of Mike, How to Use Scratch 2.0 to Program Your GameThe Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
The Adventures of Mike, How to Use Scratch 2.0 to Program Your GameUna Tao
 
Geogebra for physics
Geogebra for physicsGeogebra for physics
Geogebra for physicsLenore Horner
 
Basic exercises for photoshop
Basic exercises for photoshopBasic exercises for photoshop
Basic exercises for photoshopPauline Torion
 
Scratch - Lesson 2 - The Motion menu
Scratch - Lesson 2 - The Motion menuScratch - Lesson 2 - The Motion menu
Scratch - Lesson 2 - The Motion menuPiers Midwinter
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditBibekPandit2
 

Similar to Program a Computer with Scratch: Variables, Branching & Looping (15)

BGC2011Scratch-Rev1.pdf
BGC2011Scratch-Rev1.pdfBGC2011Scratch-Rev1.pdf
BGC2011Scratch-Rev1.pdf
 
Mode d’emploie delta force xtreme mission editor
Mode d’emploie delta force xtreme mission editorMode d’emploie delta force xtreme mission editor
Mode d’emploie delta force xtreme mission editor
 
Introducing Scratch
Introducing ScratchIntroducing Scratch
Introducing Scratch
 
Scratch MIT Coding Basics
Scratch MIT Coding BasicsScratch MIT Coding Basics
Scratch MIT Coding Basics
 
Kangaroo tutorial
Kangaroo tutorialKangaroo tutorial
Kangaroo tutorial
 
Bai5
Bai5Bai5
Bai5
 
The Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
The Adventures of Mike, How to Use Scratch 2.0 to Program Your GameThe Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
The Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
 
Geogebra for physics
Geogebra for physicsGeogebra for physics
Geogebra for physics
 
Scratch Lesson 2
Scratch Lesson 2Scratch Lesson 2
Scratch Lesson 2
 
Lesson 3 motion tween
Lesson 3 motion tweenLesson 3 motion tween
Lesson 3 motion tween
 
Basic exercises for photoshop
Basic exercises for photoshopBasic exercises for photoshop
Basic exercises for photoshop
 
Scratch - Lesson 2 - The Motion menu
Scratch - Lesson 2 - The Motion menuScratch - Lesson 2 - The Motion menu
Scratch - Lesson 2 - The Motion menu
 
Get the Picture
Get the PictureGet the Picture
Get the Picture
 
Writing ED material
Writing ED materialWriting ED material
Writing ED material
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek pandit
 

More from grahamwell

Excel =if function
Excel =if functionExcel =if function
Excel =if functiongrahamwell
 
Excel Min max-average
Excel Min max-average Excel Min max-average
Excel Min max-average grahamwell
 
What is binary and why do we use it?
What is binary and why do we use it?What is binary and why do we use it?
What is binary and why do we use it?grahamwell
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch developgrahamwell
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch developgrahamwell
 
The software story
The software storyThe software story
The software storygrahamwell
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphicsgrahamwell
 
Database field types
Database field typesDatabase field types
Database field typesgrahamwell
 
Pascal names and types
Pascal names and typesPascal names and types
Pascal names and typesgrahamwell
 
Python part two names and types
Python part two names and typesPython part two names and types
Python part two names and typesgrahamwell
 
Abstraction - Year 9
Abstraction - Year 9Abstraction - Year 9
Abstraction - Year 9grahamwell
 
Thinking about your project
Thinking about your projectThinking about your project
Thinking about your projectgrahamwell
 
The rail fence
The rail fenceThe rail fence
The rail fencegrahamwell
 
Rsa encryption
Rsa encryptionRsa encryption
Rsa encryptiongrahamwell
 
Server side scripts
Server side scriptsServer side scripts
Server side scriptsgrahamwell
 
Revision topic 1 sensors and control
Revision topic 1 sensors and controlRevision topic 1 sensors and control
Revision topic 1 sensors and controlgrahamwell
 

More from grahamwell (20)

Pseudocode
PseudocodePseudocode
Pseudocode
 
Excel =if function
Excel =if functionExcel =if function
Excel =if function
 
Excel Min max-average
Excel Min max-average Excel Min max-average
Excel Min max-average
 
What is binary and why do we use it?
What is binary and why do we use it?What is binary and why do we use it?
What is binary and why do we use it?
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
 
The software story
The software storyThe software story
The software story
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphics
 
Database field types
Database field typesDatabase field types
Database field types
 
Databases 101
Databases 101Databases 101
Databases 101
 
Kodu controls
Kodu controlsKodu controls
Kodu controls
 
Pascal names and types
Pascal names and typesPascal names and types
Pascal names and types
 
Python part two names and types
Python part two names and typesPython part two names and types
Python part two names and types
 
Abstraction - Year 9
Abstraction - Year 9Abstraction - Year 9
Abstraction - Year 9
 
Thinking about your project
Thinking about your projectThinking about your project
Thinking about your project
 
The rail fence
The rail fenceThe rail fence
The rail fence
 
Rsa encryption
Rsa encryptionRsa encryption
Rsa encryption
 
Server side scripts
Server side scriptsServer side scripts
Server side scripts
 
Revision topic 1 sensors and control
Revision topic 1 sensors and controlRevision topic 1 sensors and control
Revision topic 1 sensors and control
 
Mtslesson
MtslessonMtslesson
Mtslesson
 

Program a Computer with Scratch: Variables, Branching & Looping

  • 1. How do I program a computer?
  • 2. Three basic ideas 1. Variables 2. Branching 3. Looping That’s all there is to it. We’ll explore using a program called Scratch.
  • 3.
  • 4. Sprites • Sprites are little pictures • We can animate them by changing the picture quickly • We can move, rotate, scale, hide, flip ….. • This is how we create movement for our world.
  • 5. This is sprite1, it comes already loaded in the SPRITE LIST and has already been placed on the STAGE Task: Right Click and delete sprite1 from the SPRITE LIST
  • 6. Task: Click on the insert new sprite button.
  • 7. Task: Select the sprite called cat2 from the animals folder.
  • 8. Task: Rename the sprite and call it cat. Remember to always call new sprites sensible names!
  • 9. Task: From the control menu, drag and drop this rule into the SCRIPTS AREA
  • 10. Task: From the control menu, drag and drop the forever rule into the SCRIPTS AREA and join it together. Compatible rules can be joined together in the SCRIPTS AREA
  • 11. Task: From the motion menu, drag and drop the point towards rule into the SCRIPTS AREA and join it inside the forever rule Task: choose mouse pointer from the drop down list.
  • 12. Task: change number of steps to 3. Task: From the motion menu, drag and drop the move 10 steps rule into the SCRIPTS AREA and join it underneath the point towards rule.
  • 13. Task: run your program by pressing the green flag.
  • 14. Notice how the co-ordinates change as you move the mouse and sprite.