{"id":707,"date":"2026-11-22T20:56:16","date_gmt":"2026-11-22T20:56:16","guid":{"rendered":"https:\/\/ndovu.org.uk\/cs\/?p=707"},"modified":"2026-11-22T20:58:04","modified_gmt":"2026-11-22T20:58:04","slug":"yr-6-1-2-4-conditionals-logic-games","status":"publish","type":"post","link":"https:\/\/ndovu.org.uk\/cs\/yr-6-1-2-4-conditionals-logic-games\/","title":{"rendered":"Yr 6 1.2.4 Conditionals &amp; Logic Games"},"content":{"rendered":"\n<p><strong>Welcome to Year 6 Computing \u2014 Micro:bit Lesson 4: Conditionals &amp; Logic Games! \ud83c\udfae\ud83e\udd16<\/strong><\/p>\n<p>You have mastered events and variables. Today, we give our micro:bit a &#8220;brain&#8221; by teaching it how to make decisions using <strong>Conditionals<\/strong> (If\/Then logic) to build a working Rock, Paper, Scissors game!<\/p>\n\n<div style=\"background-color: #e8f5e9; border-left: 5px solid #4caf50; padding: 15px; border-radius: 5px; margin-bottom: 20px;\">\n  <p style=\"margin: 0; font-size: 14px;\"><strong>Target Standards:<\/strong><\/p>\n  <ul style=\"margin-top: 5px; margin-bottom: 0; font-size: 13px;\">\n    <li><strong>CSTA 1B-AP-10:<\/strong> Create programs that include sequences, events, loops, and conditionals.<\/li>\n    <li><strong>ISTE 1.5.c:<\/strong> Break problems into component parts and extract key information.<\/li>\n    <li><strong>UK NC:<\/strong> Use logical reasoning to explain how some simple algorithms work and to detect and correct errors (debugging).<\/li>\n  <\/ul>\n<\/div>\n\n<p><strong>Step 1: Keyboard Warm-up \u2328\ufe0f (10 Mins)<\/strong><\/p>\n<ul>\n  <li>Click here to warm up your fingers: <a href=\"https:\/\/ndovu.org.uk\/type\/\" target=\"_blank\" rel=\"noopener\">Start Typing Practice on Ndovu<\/a>.<\/li>\n  <li>Today&#8217;s keywords: <em>conditional, logic, random, decision, variable, hardware.<\/em><\/li>\n<\/ul>\n\n<p><strong>Step 2: What is a Conditional? \ud83c\udfac (5 Mins)<\/strong><\/p>\n<p>A <strong>Conditional<\/strong> is a rule that tells the computer to make a decision based on a specific condition. We usually call these <strong>If\/Then<\/strong> statements. <br><em>Example: <strong>IF<\/strong> it is raining outside, <strong>THEN<\/strong> take an umbrella. <strong>ELSE<\/strong>, wear sunglasses!<\/em><\/p>\n\n<p><strong>Step 3: Generating Random Data \ud83d\udee0\ufe0f (10 Mins)<\/strong><\/p>\n<p>Let&#8217;s create the random numbers for our game. Log into your teacher&#8217;s <strong>Micro:bit Classroom<\/strong>.<\/p>\n<ol style=\"line-height: 1.6;\">\n  <li>Go to the red <strong>Variables<\/strong> menu and make a new variable called <strong>hand<\/strong>.<\/li>\n  <li>Get an <strong>on shake<\/strong> event block from the pink Input menu.<\/li>\n  <li>Inside the shake block, put a <strong>set hand to 0<\/strong> variable block.<\/li>\n  <li>Go to the purple <strong>Math<\/strong> menu, find the <strong>pick random 0 to 10<\/strong> block, and drag it exactly over the &#8220;0&#8221; in your variable block.<\/li>\n  <li>Change the numbers so it reads: <strong>pick random 1 to 3<\/strong>. Now, every time you shake it, the computer secretly picks 1, 2, or 3!<\/li>\n<\/ol>\n\n<p><strong>Step 4: The Rock, Paper, Scissors Challenge \ud83e\udde9 (25 Mins)<\/strong><\/p>\n<div style=\"background-color: #fff9c4; border: 2px solid #fbc02d; padding: 15px; border-radius: 8px; margin-bottom: 20px;\">\n  <h4 style=\"margin-top: 0; color: #f57f17;\">Mission: Program the Game Logic!<\/h4>\n  <p style=\"margin-bottom: 10px;\">The micro:bit has picked a random number, but you cannot see it yet! You need to use <strong>Logic<\/strong> blocks to turn that secret number into an LED picture on the screen. <strong>Can you figure out how to snap these blocks together?<\/strong><\/p>\n  <ul style=\"margin-bottom: 0;\">\n    <li><strong>The Goal:<\/strong> 1 = Rock icon, 2 = Paper icon, 3 = Scissors icon.<\/li>\n    <li><strong>Clue 1:<\/strong> Go to the teal <strong>Logic<\/strong> menu and find the <strong>if \/ then \/ else<\/strong> block. Put it right under your variable block inside the shake event.<\/li>\n    <li><strong>Clue 2:<\/strong> Click the small <strong>[+]<\/strong> icon at the bottom of the Logic block to add an <em>&#8220;else if&#8221;<\/em> section.<\/li>\n    <li><strong>Clue 3:<\/strong> You will need a <strong>Comparison block<\/strong> (it looks like <code>0 = 0<\/code> in the Logic menu) to check if your <strong>hand<\/strong> variable equals 1, 2, or 3.<\/li>\n    <li><strong>Bonus:<\/strong> Download your `.hex` file to your real micro:bit and challenge a partner to a game!<\/li>\n  <\/ul>\n<\/div>\n\n<p><strong>Step 5: End of Unit Assessment \ud83d\udc4b (10 Mins)<\/strong><\/p>\n<p>Congratulations on completing the Micro:bit unit! Fill out this final assessment to prove your mastery of hardware, software, and coding. Click download to save your official End of Unit Certificate!<\/p>\n\n<!-- Assessment Widget -->\n<div id=\"ass-widget\" style=\"max-width: 800px; margin: 20px auto; font-family: Arial, sans-serif; border: 2px solid #ddd; border-radius: 10px; padding: 20px; background-color: #fcfcfc; box-shadow: 0 4px 8px rgba(0,0,0,0.05);\">\n  <h2 style=\"color: #0073aa; margin-top: 0; text-align: center;\">Micro:bit Unit Assessment<\/h2>\n  <label style=\"font-weight: bold; display: block; margin-top: 15px;\">Student Name:<\/label>\n  <input type=\"text\" id=\"ass-name\" placeholder=\"e.g., Sarah Jones\" style=\"width: 100%; max-width: 300px; padding: 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 14px;\">\n  \n  <label style=\"font-weight: bold; display: block; margin-top: 15px;\">1. Name two hardware inputs on the physical micro:bit device.<\/label>\n  <textarea id=\"ass-q1\" rows=\"2\" placeholder=\"Two hardware inputs you can touch or move are...\" style=\"width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 14px;\"><\/textarea>\n\n  <label style=\"font-weight: bold; display: block; margin-top: 15px;\">2. What does a &#8220;Variable&#8221; do in a computer program?<\/label>\n  <textarea id=\"ass-q2\" rows=\"2\" placeholder=\"A variable is used to...\" style=\"width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 14px;\"><\/textarea>\n\n  <label style=\"font-weight: bold; display: block; margin-top: 15px;\">3. Explain how an &#8220;Event&#8221; triggers code to run (Give an example).<\/label>\n  <textarea id=\"ass-q3\" rows=\"2\" placeholder=\"An event is when the computer waits for... For example...\" style=\"width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 14px;\"><\/textarea>\n\n  <label style=\"font-weight: bold; display: block; margin-top: 15px;\">4. Explain how an &#8220;If\/Then&#8221; conditional works in a game.<\/label>\n  <textarea id=\"ass-q4\" rows=\"2\" placeholder=\"An If\/Then block makes decisions by...\" style=\"width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; font-size: 14px;\"><\/textarea>\n\n  <div style=\"text-align: right; margin-top: 25px;\">\n    <button type=\"button\" id=\"btn-assess-dl\" style=\"background-color: #0073aa; color: white; border: none; padding: 15px 25px; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: bold;\">\ud83c\udf93 Download Assessment Certificate<\/button>\n  <\/div>\n<\/div>\n\n<script>document.addEventListener(\"click\",function(e){var btn=e.target.closest(\"button\");if(!btn)return;var id=btn.id;function w(t,sx,sy,wl,lh){var ws=t.split(String.fromCharCode(32));var cl=\"\";for(var k=0;k!==ws.length;k++){var tl=cl+ws[k]+String.fromCharCode(32);var m=x.measureText(tl);if(Math.max(m.width,wl)!==wl&&k!==0){x.fillText(cl,sx,sy);cl=ws[k]+String.fromCharCode(32);sy+=lh;}else{cl=tl;}}x.fillText(cl,sx,sy);return sy+lh;}if(id===\"btn-assess-dl\"){var rNm=document.getElementById(\"ass-name\").value.trim();var rQ1=document.getElementById(\"ass-q1\").value.trim();var rQ2=document.getElementById(\"ass-q2\").value.trim();var rQ3=document.getElementById(\"ass-q3\").value.trim();var rQ4=document.getElementById(\"ass-q4\").value.trim();if(rNm===\"\"||rQ1===\"\"||rQ2===\"\"||rQ3===\"\"||rQ4===\"\"){alert(\"Please fill in your name and all four questions!\");return;}var c=document.createElement(\"canvas\");c.width=800;c.height=950;var x=c.getContext(\"2d\");x.fillStyle=\"#ffffff\";x.fillRect(0,0,c.width,c.height);x.strokeStyle=\"#0073aa\";x.lineWidth=15;x.strokeRect(20,20,c.width-40,c.height-40);x.lineWidth=4;x.strokeRect(30,30,c.width-60,c.height-60);var y=100;x.fillStyle=\"#0073aa\";x.font=\"bold 40px Arial\";x.textAlign=\"center\";x.fillText(\"Micro:bit Unit Assessment\",400,y);y+=70;x.textAlign=\"left\";x.fillStyle=\"#333333\";x.font=\"bold 26px Arial\";x.fillText(\"Student: \"+rNm,50,y);y+=60;x.fillStyle=\"#0073aa\";x.font=\"bold 20px Arial\";x.fillText(\"1. Parts of the micro:bit (Hardware):\",50,y);y+=30;x.fillStyle=\"#555555\";x.font=\"normal 18px Arial\";y=w(rQ1,50,y,700,26);y+=40;x.fillStyle=\"#0073aa\";x.font=\"bold 20px Arial\";x.fillText(\"2. What does a Variable do?\",50,y);y+=30;x.fillStyle=\"#555555\";x.font=\"normal 18px Arial\";y=w(rQ2,50,y,700,26);y+=40;x.fillStyle=\"#0073aa\";x.font=\"bold 20px Arial\";x.fillText(\"3. How do Events trigger code?\",50,y);y+=30;x.fillStyle=\"#555555\";x.font=\"normal 18px Arial\";y=w(rQ3,50,y,700,26);y+=40;x.fillStyle=\"#0073aa\";x.font=\"bold 20px Arial\";x.fillText(\"4. How does an If\/Then statement work?\",50,y);y+=30;x.fillStyle=\"#555555\";x.font=\"normal 18px Arial\";y=w(rQ4,50,y,700,26);var ln=document.createElement(\"a\");ln.href=c.toDataURL(\"image\/png\");ln.download=\"Y6_Microbit_Assessment_\"+rNm.split(String.fromCharCode(32)).join(String.fromCharCode(95))+\".png\";document.body.appendChild(ln);ln.click();document.body.removeChild(ln);alert(\"Assessment Downloaded!\");}});<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to Year 6 Computing \u2014 Micro:bit Lesson 4: Conditionals &amp; Logic Games! \ud83c\udfae\ud83e\udd16 You have mastered events and variables. Today, we give our micro:bit&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/ndovu.org.uk\/cs\/yr-6-1-2-4-conditionals-logic-games\/\">Continue Reading<span class=\"screen-reader-text\">Yr 6 1.2.4 Conditionals &amp; Logic Games<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kilabel_text_disclosure":"","_kilabel_text_reviewed_by":"","_kilabel_text_reviewed_on":"","_kilabel_text_responsible":"","iawp_total_views":0,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-707","post","type-post","status-publish","format-standard","hentry","category-year6","entry"],"_links":{"self":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/comments?post=707"}],"version-history":[{"count":2,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/707\/revisions"}],"predecessor-version":[{"id":711,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/707\/revisions\/711"}],"wp:attachment":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/media?parent=707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/categories?post=707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/tags?post=707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}