SlideShare a Scribd company logo
Introduction to Programming



          Scratch
         Lesson 1
Goals

•   What is an algorithm?
•   Scratch Interface
•   Variables
•   Conditional Statements
•   Turtle Graphics
•   Repetition



                             2
What is an algorithm?

• A step by step process (Algorithm)
  – Instructions for making tea (Pseudocode)
     If no water in kettle:
         Put water in kettle

     Turn on kettle

     While water not boiling in kettle:
        Wait


     Put water in cup …




                                          3
Scratch user interface




                   4
Scratch stage




                5
Stage + Sprite

• Exercise:
  – Point your mouse to coordinate x=0, y=0
• Exercise:
  – Get a new sprite on the screen




                                     6
First scratch program




                  7
Variables

 Add a variable
 called “number”



Exercise:
Say a random number




                               8
Conditions

Exercise:
  – What does
    this code do?
  – What are the
    errors in the
    code?




                        9
Conditions

Exercise:
  – What does
    this code do?
  – What are the
    errors in the
    code?
  – What if
    “number” is
    equal to 5?
                        10
Motion statements

         •   Move Right
         •   Move Left
         •   Big Steps
         •   Small Steps
         •   Move Up
         •   Move Down
         •   Exercise:
             Double-click on the
             blocks to see what
             happens

                        11
More motion action

• Exercise
  – Make the sprite go to x=0, y=0
• Exercise
  – Make the sprite move 100 steps and turn 90 degrees
• Exercise
  – Make the sprite go in a square pattern
• Exercise
  – Make the sprite move when you hit a key




                                               12
Pen statements

      • Pen appears
        underneath sprite
      • Pen must be set to
        “down” before it will
        draw
      • Exercise:
        Draw a line after the
        sprite




                    13
Iteration

     • Repeat statements
     • Exercise:
       Guess what this
       code does
     • Test your guess




               14
Loop exercises
• Exercise: Draw this (10 diamonds)




• Exercise: Try to write your programs with as few statements as
  possible




                                                  15
More repeating exercises

•   Exercise: Draw this in any colour




•   Exercise: Change the colour of each square
•   Exercise: Draw a triangle, a pentagon a hexagon
    and a circle.

                                         16

More Related Content

PPT
Scratch for Second Life
PDF
Code Inspection
PPT
Advanced2
PPTX
Intro To Programming Cmp
PPTX
7th grade presentation cite2
PPTX
Scratch Syntax 2 Cmp
PPT
Advanced3
PPT
Advanced1
Scratch for Second Life
Code Inspection
Advanced2
Intro To Programming Cmp
7th grade presentation cite2
Scratch Syntax 2 Cmp
Advanced3
Advanced1

Viewers also liked (20)

PPT
Reason Lesson 3 - Adding Intrument Parts
PPT
Scratch Lesson 2 – Paint Editor
PPT
Reason Lesson 2 – Drum Samples
PPT
Scratch Lesson 3 - Interactivity
PPTX
Scratch Lesson 5
PPTX
Scratch Lesson 3
PPTX
Scratch Lesson 4
PPTX
Scratch Lesson 6
PPTX
Scratch Lesson 1
PPTX
Scratch Lesson 2
PPTX
An Urban Adventure in Project-Based Learning
PDF
Scratch2
KEY
Creative Teaching with Scratch 2010
PPTX
Programming with Scratch
PPTX
Citizenship Digital Age
PDF
Scratch project ideas
PPTX
Scratch Basics
PPTX
Programming in scratch
PDF
Scratch in the Classroom
PPT
Intro To Scratch
Reason Lesson 3 - Adding Intrument Parts
Scratch Lesson 2 – Paint Editor
Reason Lesson 2 – Drum Samples
Scratch Lesson 3 - Interactivity
Scratch Lesson 5
Scratch Lesson 3
Scratch Lesson 4
Scratch Lesson 6
Scratch Lesson 1
Scratch Lesson 2
An Urban Adventure in Project-Based Learning
Scratch2
Creative Teaching with Scratch 2010
Programming with Scratch
Citizenship Digital Age
Scratch project ideas
Scratch Basics
Programming in scratch
Scratch in the Classroom
Intro To Scratch
Ad

Similar to Lesson 1: scratch basics (20)

PPT
Lesson 1
PDF
How do I learn to code with Scratch in AEP
PDF
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...
PPT
Introduction
PPTX
Lesson one
PPTX
Day 1( magic camp)(1)
PDF
BGC2011Scratch-Rev1.pdf
PPTX
Lecture 1.pptx
PPTX
Learn to Code and Have Fun Doing It!
PDF
Scratch Animation
PPTX
Day 2( magic camp)1
PPTX
Day 2( magic camp)
PPTX
PDF
Modul mBlock 5 and arduino.pdf
KEY
Thinking Like a Programmer
PDF
Lessonplan
PPTX
Grade-5_Topic-5_Fun_With_Scratch(2024-25).pptx
PDF
From programming to software engineering: ICSE keynote slides available
PPTX
Grade-5 Topic-5 Fun with Scratch_Master.pptx
Lesson 1
How do I learn to code with Scratch in AEP
Blue Orange and Yellow Geometric Flat Shapes Scavenger Hunt Ice Breaker Class...
Introduction
Lesson one
Day 1( magic camp)(1)
BGC2011Scratch-Rev1.pdf
Lecture 1.pptx
Learn to Code and Have Fun Doing It!
Scratch Animation
Day 2( magic camp)1
Day 2( magic camp)
Modul mBlock 5 and arduino.pdf
Thinking Like a Programmer
Lessonplan
Grade-5_Topic-5_Fun_With_Scratch(2024-25).pptx
From programming to software engineering: ICSE keynote slides available
Grade-5 Topic-5 Fun with Scratch_Master.pptx
Ad

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation theory and applications.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Network Security Unit 5.pdf for BCA BBA.
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation_ Review paper, used for researhc scholars
Building Integrated photovoltaic BIPV_UPV.pdf
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation theory and applications.pdf
Approach and Philosophy of On baking technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Lesson 1: scratch basics

  • 1. Introduction to Programming Scratch Lesson 1
  • 2. Goals • What is an algorithm? • Scratch Interface • Variables • Conditional Statements • Turtle Graphics • Repetition 2
  • 3. What is an algorithm? • A step by step process (Algorithm) – Instructions for making tea (Pseudocode) If no water in kettle: Put water in kettle Turn on kettle While water not boiling in kettle: Wait Put water in cup … 3
  • 6. Stage + Sprite • Exercise: – Point your mouse to coordinate x=0, y=0 • Exercise: – Get a new sprite on the screen 6
  • 8. Variables Add a variable called “number” Exercise: Say a random number 8
  • 9. Conditions Exercise: – What does this code do? – What are the errors in the code? 9
  • 10. Conditions Exercise: – What does this code do? – What are the errors in the code? – What if “number” is equal to 5? 10
  • 11. Motion statements • Move Right • Move Left • Big Steps • Small Steps • Move Up • Move Down • Exercise: Double-click on the blocks to see what happens 11
  • 12. More motion action • Exercise – Make the sprite go to x=0, y=0 • Exercise – Make the sprite move 100 steps and turn 90 degrees • Exercise – Make the sprite go in a square pattern • Exercise – Make the sprite move when you hit a key 12
  • 13. Pen statements • Pen appears underneath sprite • Pen must be set to “down” before it will draw • Exercise: Draw a line after the sprite 13
  • 14. Iteration • Repeat statements • Exercise: Guess what this code does • Test your guess 14
  • 15. Loop exercises • Exercise: Draw this (10 diamonds) • Exercise: Try to write your programs with as few statements as possible 15
  • 16. More repeating exercises • Exercise: Draw this in any colour • Exercise: Change the colour of each square • Exercise: Draw a triangle, a pentagon a hexagon and a circle. 16

Editor's Notes

  • #6: 1
  • #15: Remember to hide the sprite from the screen