SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Último

Último (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
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...
 
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
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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

Notas do Editor

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