SlideShare a Scribd company logo
1 of 7
LOOPS
BEGINNER
PROGRAMMING
LESSONS
Lesson Objectives
1. Learn how to repeat an action
2. Learn how to use Loop Blocks
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 2
Repeating an Action
Let’s say we want the robot to repeat an
action over and over again.
Would you just copy the block multiple
times?
Sure, that could work!
What if I want to repeat that block forever?
Now what?
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 3
Loops
Loops make repeating a task multiple times easy
The added benefit is that a loop can end
whenever you want (a specific number of times,
run forever, a specific condition, etc)
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 4
LOOP CHALLENGE
Challenge: Write a program to go around a box once.
The simple way is to code it like this:
Use a loop to improve the code
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 5
Loop CHALLENGE Solution
© EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 6
Run 4
times
End of the lesson
7

More Related Content

Similar to Ap loops2 - Beginner

Design Patterns- Course for students .pptx
Design Patterns- Course for students  .pptxDesign Patterns- Course for students  .pptx
Design Patterns- Course for students .pptxkhaledmohamedadelkam
 
Solving OWASP MSTG CrackMe using Frida
Solving OWASP MSTG CrackMe using FridaSolving OWASP MSTG CrackMe using Frida
Solving OWASP MSTG CrackMe using FridaChandrapal Badshah
 
Explain the concept of two types of network intrusions What devic.docx
Explain the concept of two types of network intrusions What devic.docxExplain the concept of two types of network intrusions What devic.docx
Explain the concept of two types of network intrusions What devic.docxSANSKAR20
 
My works in gitub, etc.
My works in gitub, etc.My works in gitub, etc.
My works in gitub, etc.孝好 飯塚
 
Lessons learned maintaining Open Source ActionScript projects
Lessons learned maintaining Open Source ActionScript projectsLessons learned maintaining Open Source ActionScript projects
Lessons learned maintaining Open Source ActionScript projectsZeh Fernando
 
How to not suck at JavaScript
How to not suck at JavaScriptHow to not suck at JavaScript
How to not suck at JavaScripttmont
 
Getting Started with Robotics
Getting Started with RoboticsGetting Started with Robotics
Getting Started with Roboticss0133116
 
Bc0051 – system software
Bc0051 – system softwareBc0051 – system software
Bc0051 – system softwaresmumbahelp
 
Master class in modern Java
Master class in modern JavaMaster class in modern Java
Master class in modern JavaMiro Cupak
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principlesdeonpmeyer
 
Master class in Java in 2018
Master class in Java in 2018Master class in Java in 2018
Master class in Java in 2018Miro Cupak
 
Xopus Application Framework
Xopus Application FrameworkXopus Application Framework
Xopus Application FrameworkJady Yang
 
Introduction to Groovy Monkey
Introduction to Groovy MonkeyIntroduction to Groovy Monkey
Introduction to Groovy Monkeyjervin
 
Master class in modern Java
Master class in modern JavaMaster class in modern Java
Master class in modern JavaMiro Cupak
 

Similar to Ap loops2 - Beginner (18)

Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Design Patterns- Course for students .pptx
Design Patterns- Course for students  .pptxDesign Patterns- Course for students  .pptx
Design Patterns- Course for students .pptx
 
Solving OWASP MSTG CrackMe using Frida
Solving OWASP MSTG CrackMe using FridaSolving OWASP MSTG CrackMe using Frida
Solving OWASP MSTG CrackMe using Frida
 
Explain the concept of two types of network intrusions What devic.docx
Explain the concept of two types of network intrusions What devic.docxExplain the concept of two types of network intrusions What devic.docx
Explain the concept of two types of network intrusions What devic.docx
 
Apex design patterns
Apex design patternsApex design patterns
Apex design patterns
 
My works in gitub, etc.
My works in gitub, etc.My works in gitub, etc.
My works in gitub, etc.
 
Lessons learned maintaining Open Source ActionScript projects
Lessons learned maintaining Open Source ActionScript projectsLessons learned maintaining Open Source ActionScript projects
Lessons learned maintaining Open Source ActionScript projects
 
How to not suck at JavaScript
How to not suck at JavaScriptHow to not suck at JavaScript
How to not suck at JavaScript
 
Getting Started with Robotics
Getting Started with RoboticsGetting Started with Robotics
Getting Started with Robotics
 
Bc0051 – system software
Bc0051 – system softwareBc0051 – system software
Bc0051 – system software
 
Java
JavaJava
Java
 
Master class in modern Java
Master class in modern JavaMaster class in modern Java
Master class in modern Java
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
Master class in Java in 2018
Master class in Java in 2018Master class in Java in 2018
Master class in Java in 2018
 
Xopus Application Framework
Xopus Application FrameworkXopus Application Framework
Xopus Application Framework
 
Introduction to Groovy Monkey
Introduction to Groovy MonkeyIntroduction to Groovy Monkey
Introduction to Groovy Monkey
 
Ah pseudocode2 - Beginner
Ah   pseudocode2 - BeginnerAh   pseudocode2 - Beginner
Ah pseudocode2 - Beginner
 
Master class in modern Java
Master class in modern JavaMaster class in modern Java
Master class in modern Java
 

More from Romaric Saounde Tsopnang

More from Romaric Saounde Tsopnang (20)

Aq les conditionnelles - Débutant
Aq   les conditionnelles - DébutantAq   les conditionnelles - Débutant
Aq les conditionnelles - Débutant
 
Ap les boucles - Débutants
Ap   les boucles - DébutantsAp   les boucles - Débutants
Ap les boucles - Débutants
 
Ao light nxt2 - Beginner
Ao   light nxt2 - BeginnerAo   light nxt2 - Beginner
Ao light nxt2 - Beginner
 
An capteur de couleur - Débutant
An   capteur de couleur - DébutantAn   capteur de couleur - Débutant
An capteur de couleur - Débutant
 
An color Sensor - Beginner
An   color Sensor - BeginnerAn   color Sensor - Beginner
An color Sensor - Beginner
 
Al capteur tactile - Débutant
Al   capteur tactile - DébutantAl   capteur tactile - Débutant
Al capteur tactile - Débutant
 
Al touch2 - Beginner
Al   touch2 - BeginnerAl   touch2 - Beginner
Al touch2 - Beginner
 
Ak custom imagessounds2 - Beginner
Ak   custom imagessounds2 - BeginnerAk   custom imagessounds2 - Beginner
Ak custom imagessounds2 - Beginner
 
Ak image et son standard - Débutant
Ak   image et son standard - DébutantAk   image et son standard - Débutant
Ak image et son standard - Débutant
 
Aj display2 - Beginner
Aj   display2 - BeginnerAj   display2 - Beginner
Aj display2 - Beginner
 
Aj affichage - Débutant
Aj   affichage - DébutantAj   affichage - Débutant
Aj affichage - Débutant
 
Ai turning2 - Beginner
Ai   turning2 - BeginnerAi   turning2 - Beginner
Ai turning2 - Beginner
 
Ai virages - Débutant
Ai   virages - DébutantAi   virages - Débutant
Ai virages - Débutant
 
Ah pseudocode-fr - Débutant
Ah   pseudocode-fr - DébutantAh   pseudocode-fr - Débutant
Ah pseudocode-fr - Débutant
 
Ag moving straight2 - Beginner
Ag   moving straight2 - BeginnerAg   moving straight2 - Beginner
Ag moving straight2 - Beginner
 
Ag deplacement droit - Débutant
Ag   deplacement droit - DébutantAg   deplacement droit - Débutant
Ag deplacement droit - Débutant
 
Af port view2 - Beginner
Af   port view2 - BeginnerAf   port view2 - Beginner
Af port view2 - Beginner
 
Af vue des portes - Débutant
Af   vue des portes - DébutantAf   vue des portes - Débutant
Af vue des portes - Débutant
 
Ae common issues2 - Beginner
Ae   common issues2 - BeginnerAe   common issues2 - Beginner
Ae common issues2 - Beginner
 
Ae problemes frequents - Débutant
Ae   problemes frequents - DébutantAe   problemes frequents - Débutant
Ae problemes frequents - Débutant
 

Recently uploaded

Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
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 DiscoveryTrustArc
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 

Recently uploaded (20)

Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
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
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Ap loops2 - Beginner

  • 2. Lesson Objectives 1. Learn how to repeat an action 2. Learn how to use Loop Blocks © EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 2
  • 3. Repeating an Action Let’s say we want the robot to repeat an action over and over again. Would you just copy the block multiple times? Sure, that could work! What if I want to repeat that block forever? Now what? © EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 3
  • 4. Loops Loops make repeating a task multiple times easy The added benefit is that a loop can end whenever you want (a specific number of times, run forever, a specific condition, etc) © EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 4
  • 5. LOOP CHALLENGE Challenge: Write a program to go around a box once. The simple way is to code it like this: Use a loop to improve the code © EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 5
  • 6. Loop CHALLENGE Solution © EV3LESSONS.COM, 2016, (LAST EDIT: 7/26/2016) 6 Run 4 times
  • 7. End of the lesson 7