{"id":7925,"date":"2022-03-14T08:18:15","date_gmt":"2022-03-14T07:18:15","guid":{"rendered":"https:\/\/www.smileandlearn.com\/programming-with-loops\/"},"modified":"2025-02-18T13:39:53","modified_gmt":"2025-02-18T12:39:53","slug":"programming-with-loops","status":"publish","type":"post","link":"https:\/\/www.smileandlearn.com\/en\/programming-with-loops\/","title":{"rendered":"Programming with loops"},"content":{"rendered":"<p>Hello! Today we are going to continue the series of blog posts about block programming, in particular, today we will discover block loops. Throughout the article we will be able to learn the properties of loops and the advantages they bring to programming. To do this, we will use the &#8220;Loops&#8221; activity from our Smile and Learn educational platform.<\/p>\n<p><span style=\"font-weight: 400;\">The <\/span><b>Smile and Learn educational platform<\/b><span style=\"font-weight: 400;\"> has more than 7,500 educational activities for students from 3 to 12 years of age. On our platform, children can learn in a dynamic way various contents related to the main educational subjects, either in the classroom or at home. We have curricular content as well as content focused on social and emotional development, in addition to family play activities.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you want to try it, you can request a demo of Smile and Learn for <\/span><b>30 days free of charge and without obligation<\/b> <a href=\"https:\/\/www.smileandlearn.com\/en\/how-to-start-learning\/\"><br \/>\n<span style=\"font-weight: 400;\">here<\/span><br \/>\n<span style=\"font-weight: 400;\">.<\/span><br \/>\n<\/a><\/p>\n<p><b>WHAT IS PROGRAMMING<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Have you ever wondered how a computer works? <\/span><span style=\"font-weight: 400;\">We might think that it is an incomprehensible machine but, in reality, it has a very simple operation.<\/span><\/p>\n<p><b>Programming is the language of technology and machines, but it is a very special language because we teach it to them.<\/b><span style=\"font-weight: 400;\">but it is a very special language because we teach it to them. <\/span> <span style=\"font-weight: 400;\">Imagine you build a robot, assemble its parts and put it on the floor, but it doesn&#8217;t move. That robot needs us to teach it how to work, so we have to program it, that is, <\/span><b>give you orders or instructions<\/b><span style=\"font-weight: 400;\">. <\/span><span style=\"font-weight: 400;\">To understand it better, read on!<\/span><\/p>\n<p><strong>LOOP BLOCKS<\/strong><\/p>\n<p>In the entry on block programming we learned that each block contains a different command, condition or event.<br \/>\nThis brings us to a new type of block: the loop. This block allows us to repeat an action until the condition we set is met. There are different types of loops, but in our activity we will use the &#8220;for loop&#8221;, which allows us to repeat a sequence of movements a certain number of times.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-36721\" src=\"http:\/\/www.smileandlearn.com\/wp-content\/uploads\/2022\/03\/BUCLES1.jpg\" alt=\"\" width=\"753\" height=\"422\" \/><\/p>\n<p><b>LOOPING ACTIVITY<\/b><\/p>\n<p>To understand it better, see in this example what happens to the girl when we send to the<strong>programming board a loop with a sequence of different movements<\/strong>.<\/p>\n<p>As you can see, when we create the loop we select how many times we want it to repeat. Then, we introduce the movements inside. Very useful, isn&#8217;t it?<\/p>\n<p>But we do not appear to have solved the activity, i.e., we have not met the programming objective. The girl has to mow the grass in the picture, let&#8217;s look at it more carefully.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-36726\" src=\"http:\/\/www.smileandlearn.com\/wp-content\/uploads\/2022\/03\/BUCLES2.jpg\" alt=\"\" width=\"742\" height=\"414\" \/><\/p>\n<p><span style=\"font-weight: 400;\">If you look, there are 5 blocks of grass in front of the girl. It would be as easy as inserting five forward blocks on the board, but there is only room for four blocks. <\/span><span style=\"font-weight: 400;\"><strong>Therefore, we need a loop, which counts as a single block<\/strong>. The correct answer then, would be to move forward 5 times.<\/span><\/p>\n<p><b>USEFULNESS FOR PROGRAMMING<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Loop blocks allow us to use fewer blocks on the programming boards, in addition to saving repeated block sequences. <\/span><span style=\"font-weight: 400;\">Using the least number of blocks when programming is very important because it helps us to avoid errors. In addition, being efficient is one of the keys to being a great programmer.<\/span><\/p>\n<p><b>WHAT ELSE CAN I LEARN?<\/b><\/p>\n<p><span style=\"font-weight: 400;\">If you liked the &#8220;Loops&#8221; activity, you can continue your learning with the next entries <\/span><b>next entries<\/b><span style=\"font-weight: 400;\"> of the blog on block programming. Specifically, we will learn about the <\/span><b>conditional blocks.<\/b><span style=\"font-weight: 400;\"> You will love it! <\/span><i><br \/>\n<span style=\"font-weight: 400;\">We remind you that you can try our <\/span><br \/>\n<\/i><b><br \/>\n<i>Smile and Learn educational platform<\/i><br \/>\n<\/b><i><br \/>\n<span style=\"font-weight: 400;\"> by requesting a <\/span><br \/>\n<\/i><b><br \/>\n<i>free demo <\/i><br \/>\n<\/b> <i><span style=\"font-weight: 400;\"> without commitment <a href=\"https:\/\/www.smileandlearn.com\/en\/how-to-start-learning\/\">here<\/a>. You will be able to discover all the activities, games and interactive stories it contains. We are waiting for you!<\/span><\/i><\/p>\n<p style=\"text-align: right;\"><strong>Sandra Fernandez<\/strong><\/p>\n<p style=\"text-align: right;\"><strong>Smile and Learn pedagogical team<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do children learn to program in a loop?  <\/p>\n","protected":false},"author":6,"featured_media":6954,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[57],"tags":[],"class_list":["post-7925","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sin-categorizar"],"_links":{"self":[{"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/posts\/7925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/comments?post=7925"}],"version-history":[{"count":0,"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/posts\/7925\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/media\/6954"}],"wp:attachment":[{"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/media?parent=7925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/categories?post=7925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.smileandlearn.com\/en\/wp-json\/wp\/v2\/tags?post=7925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}