SlideShare une entreprise Scribd logo
1  sur  16
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

Contenu connexe

En vedette

Reason Lesson 3 - Adding Intrument Parts
Reason Lesson 3 - Adding Intrument PartsReason Lesson 3 - Adding Intrument Parts
Reason Lesson 3 - Adding Intrument Parts
David Oromaner
 
Reason Lesson 2 – Drum Samples
Reason Lesson 2 – Drum SamplesReason Lesson 2 – Drum Samples
Reason Lesson 2 – Drum Samples
David Oromaner
 
Scratch Lesson 3 - Interactivity
Scratch Lesson 3 -  InteractivityScratch Lesson 3 -  Interactivity
Scratch Lesson 3 - Interactivity
David Oromaner
 

En vedette (20)

Reason Lesson 3 - Adding Intrument Parts
Reason Lesson 3 - Adding Intrument PartsReason Lesson 3 - Adding Intrument Parts
Reason Lesson 3 - Adding Intrument Parts
 
Scratch Lesson 2 – Paint Editor
Scratch Lesson 2 – Paint EditorScratch Lesson 2 – Paint Editor
Scratch Lesson 2 – Paint Editor
 
Reason Lesson 2 – Drum Samples
Reason Lesson 2 – Drum SamplesReason Lesson 2 – Drum Samples
Reason Lesson 2 – Drum Samples
 
Scratch Lesson 3 - Interactivity
Scratch Lesson 3 -  InteractivityScratch Lesson 3 -  Interactivity
Scratch Lesson 3 - Interactivity
 
Scratch Lesson 5
Scratch Lesson 5Scratch Lesson 5
Scratch Lesson 5
 
Scratch Lesson 3
Scratch Lesson 3Scratch Lesson 3
Scratch Lesson 3
 
Scratch Lesson 4
Scratch Lesson 4Scratch Lesson 4
Scratch Lesson 4
 
Scratch Lesson 6
Scratch Lesson 6Scratch Lesson 6
Scratch Lesson 6
 
Scratch Lesson 1
Scratch Lesson 1Scratch Lesson 1
Scratch Lesson 1
 
Scratch Lesson 2
Scratch Lesson 2Scratch Lesson 2
Scratch Lesson 2
 
An Urban Adventure in Project-Based Learning
An Urban Adventure in Project-Based LearningAn Urban Adventure in Project-Based Learning
An Urban Adventure in Project-Based Learning
 
Scratch2
Scratch2Scratch2
Scratch2
 
Creative Teaching with Scratch 2010
Creative Teaching with Scratch 2010Creative Teaching with Scratch 2010
Creative Teaching with Scratch 2010
 
Programming with Scratch
Programming with ScratchProgramming with Scratch
Programming with Scratch
 
Citizenship Digital Age
Citizenship Digital AgeCitizenship Digital Age
Citizenship Digital Age
 
Scratch project ideas
Scratch project ideasScratch project ideas
Scratch project ideas
 
Scratch Basics
Scratch BasicsScratch Basics
Scratch Basics
 
Programming in scratch
Programming in scratchProgramming in scratch
Programming in scratch
 
Scratch in the Classroom
Scratch in the ClassroomScratch in the Classroom
Scratch in the Classroom
 
Intro To Scratch
Intro To ScratchIntro To Scratch
Intro To Scratch
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

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

Notes de l'éditeur

  1. 1
  2. Remember to hide the sprite from the screen