{"id":20545,"date":"2020-03-26T10:38:08","date_gmt":"2020-03-26T17:38:08","guid":{"rendered":"https:\/\/www.tynker.com\/blog\/?p=20545"},"modified":"2023-09-18T13:22:36","modified_gmt":"2023-09-18T20:22:36","slug":"tynker-toolbox-code-block-tricks","status":"publish","type":"post","link":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/","title":{"rendered":"Tynker Toolbox: Code Block Tricks"},"content":{"rendered":"\n<p>Think you know everything about Tynker Code Blocks?<\/p>\n\n\n\n<p>Let\u2019s see about that. Explore some cool hidden features with this code blocks tutorials and become a Tynker ninja! Open up Tynker workshop (<strong>Projects &gt; +Create a New Project &gt; Blank Block Project<\/strong>) and follow along!<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_69_1 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69d79513e0774\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #206be5;color:#206be5\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #206be5;color:#206be5\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69d79513e0774\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#Disconnecting_Blocks\" title=\"Disconnecting Blocks\">Disconnecting Blocks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#Find_Blocks_Fast\" title=\"Find Blocks Fast\">Find Blocks Fast<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#Help_Is_a_Click_Away\" title=\"Help Is a Click Away\">Help Is a Click Away<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#Save_Code_with_The_Backpack\" title=\"Save Code with The Backpack\">Save Code with The Backpack<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#Special_Locations_and_Stage_Properties\" title=\"Special Locations and Stage Properties\">Special Locations and Stage Properties<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#Get_and_Set_Actor_Properties\" title=\"Get and Set Actor Properties\">Get and Set Actor Properties<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#The_Actor_Properties_Flyout\" title=\"The Actor Properties Flyout\">The Actor Properties Flyout<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#True-and-False_Are_Diamond-Shaped\" title=\"True-and-False Are Diamond-Shaped\">True-and-False Are Diamond-Shaped<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#Expand_Blocks\" title=\"Expand Blocks&nbsp;\">Expand Blocks&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#Ready_to_Learn_More\" title=\"Ready to Learn More?&nbsp;\">Ready to Learn More?&nbsp;<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Disconnecting_Blocks\"><\/span>Disconnecting Blocks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>With <strong>block based coding<\/strong>, you\u2019ll often have to rearrange code and experiment with the sequence of your code. Tynker code blocks have \u201chandles\u201d on their left and right side that make moving blocks easy.<\/p>\n\n\n\n<p>If you drag a block from the <strong><em>left <\/em><\/strong>side, you\u2019ll grab the whole code stack below.&nbsp;<\/p>\n\n\n\n<p>If you drag a block from the <strong><em>right<\/em> <\/strong>side, you\u2019ll \u201cpeel off\u201d just a single block. Take a look!<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081508\/code-handles.gif\" alt=\"An animation showing Tynker drag behavior: Dragging from the left grabs the whole stack. Dragging from the right &quot;peels off&quot; a single block \" class=\"wp-image-20546\" width=\"423\" height=\"313\"\/><\/figure><\/div>\n\n\n<p><\/p>\n\n\n\n<p>Try it yourself! Experiment with a long code stack to see how it behaves, depending on which handle you use.&nbsp;<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Find_Blocks_Fast\"><\/span>Find Blocks Fast<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Use the <strong>Search <\/strong>\ud83d\udd0e feature in the Code Palette to find the code block you need fast.&nbsp;<br><\/p>\n\n\n\n<p><strong>Search <\/strong>also finds places in your project where you\u2019re already using the code block! Notice the arrows \u25c0&nbsp; \u25b6 beside the text \u201c<strong>2 blocks in code<\/strong>\u201d \u2014 click this button to switch to those scripts, and your search term is highlighted in yellow, too! Convenient.&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081640\/search-blocks.gif\" alt=\"Animation showing block search feature\" class=\"wp-image-20547\" width=\"732\" height=\"444\"\/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Help_Is_a_Click_Away\"><\/span>Help Is a Click Away<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Find an unfamiliar block? Click on any <strong>coding block<\/strong> to get a description of its behavior. Click on More Help to get a longer description and code examples that you can drag right into your project.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081655\/help.gif\" alt=\"Click on any block in the palette to get contextual help \" class=\"wp-image-20548\" width=\"198\" height=\"184\"\/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Save_Code_with_The_Backpack\"><\/span>Save Code with The Backpack<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Do you want to share code among different projects? Or just need to try a quick experiment? You can use the Backpack feature to save Actors or Scripts.&nbsp;<br><\/p>\n\n\n\n<p>First, click the <strong>Backpack <\/strong>icon.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082632\/icon-backpack-gray%402x.png\" alt=\"Tynker's backpack icon \" class=\"wp-image-20557\"\/><\/figure><\/div>\n\n\n<p>Then drag Actors or Scripts to the Backpack area. You can then open up the Backpack in a new project and use your saved scripts or actors.&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081758\/backpack.gif\" alt=\"Animation showing how to save scripts and actors in the Backpack \" class=\"wp-image-20549\" width=\"431\" height=\"432\"\/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Special_Locations_and_Stage_Properties\"><\/span>Special Locations and Stage Properties<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let\u2019s take a closer look at some of the stage blocks.&nbsp;<br><\/p>\n\n\n\n<p>While you can use the coordinate system to place actors, you can also place them relative to the screen itself, using blocks like <strong>screen left <\/strong>and <strong>screen top<\/strong>.&nbsp;<br><\/p>\n\n\n\n<p>For example, this will place an actor in the top-left corner:&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081835\/top-left.png\" alt=\"A program to place an object in the upper right\" class=\"wp-image-20550\" width=\"244\" height=\"102\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081835\/top-left.png 488w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081835\/top-left-150x63.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081835\/top-left-300x125.png 300w\" sizes=\"auto, (max-width: 244px) 100vw, 244px\" \/><\/figure><\/div>\n\n\n<p>You can even nest these special blocks within the <strong>pick random<\/strong> block to choose a location between the two extremes:&nbsp;<br><br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081901\/random-location.png\" alt=\"Using the pick random block with screen left, to choose a location between two extremes\" class=\"wp-image-20551\" width=\"443\" height=\"112\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081901\/random-location.png 886w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081901\/random-location-150x38.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081901\/random-location-300x76.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081901\/random-location-768x194.png 768w\" sizes=\"auto, (max-width: 443px) 100vw, 443px\" \/><\/figure><\/div>\n\n\n<p>You can also use the <strong>stage properties <\/strong>block, which reports the Stage\u2019s width or height. Here\u2019s code that will draw a rectangle 1\/3rd of the size of the <strong>height <\/strong>and <strong>width <\/strong>of the stage:&nbsp;<br><br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081926\/stage-properties-1024x174.png\" alt=\"The stage property block in action \" class=\"wp-image-20552\" width=\"512\" height=\"87\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081926\/stage-properties-1024x174.png 1024w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081926\/stage-properties-150x25.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081926\/stage-properties-300x51.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081926\/stage-properties-768x130.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081926\/stage-properties-1280x217.png 1280w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081926\/stage-properties.png 1322w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Get_and_Set_Actor_Properties\"><\/span>Get and Set Actor Properties<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Working with actor properties is like a Tynker superpower, once you get the hang of it. Here\u2019s how you can use the <strong>Actor Properties<\/strong> block, which returns a value.&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081957\/get-property-1024x142.png\" alt=\"The get actor properties block \" class=\"wp-image-20553\" width=\"256\" height=\"36\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081957\/get-property-1024x142.png 1024w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081957\/get-property-150x21.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081957\/get-property-300x42.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081957\/get-property-768x106.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081957\/get-property-1280x180.png 1280w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326081957\/get-property.png 1301w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/figure><\/div>\n\n\n<p>It has two parameters:&nbsp;<br><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The <strong>Property <\/strong>you want to retrieve. This can be information like the Actor\u2019s current <em>x position<\/em>, <em>costume name<\/em>, <em>density<\/em>, and so on. Click the dropdown menu in the block to see all the options.&nbsp;<\/li>\n\n\n\n<li>The <strong>Actor <\/strong>whose property you want to retrieve. In addition to working with actors, you can retrieve the properties of the screen edges and the mouse-pointer.<\/li>\n<\/ol>\n\n\n\n<p>If you try to retrieve a property that does not exist or doesn\u2019t \u201cmake sense\u201d (for example, the volume of the mouse-pointer), this block returns nothing.&nbsp;<br><\/p>\n\n\n\n<p>In the same way, you can use the <strong>set property <\/strong>block to <strong><em>change <\/em><\/strong>an actor\u2019s properties:&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082041\/setproperty-1024x159.png\" alt=\"The set actor properties block \" class=\"wp-image-20554\" width=\"256\" height=\"40\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082041\/setproperty-1024x159.png 1024w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082041\/setproperty-150x23.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082041\/setproperty-300x47.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082041\/setproperty-768x120.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082041\/setproperty-1280x199.png 1280w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082041\/setproperty.png 1772w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Actor_Properties_Flyout\"><\/span>The Actor Properties Flyout<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can be forgiven if you never noticed the tiny \u25b6 button next to your current actor\u2019s name at the top of the Coding Area. Click it and watch what happens:&nbsp;<br><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/isE_DH67LefJfgyChx_r0uo1Qt2i8HnpkpdC2dniqDY2ixS4E7ri0ruIB_2PUvdIpyRMI5iKtx0WRPRA7Jb7FTTYFWfeuZDj8k90eWM66PHB7KOevCdoafxRj4Za94v5kZMXtzhV\" alt=\"The actor properties flyout \"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>An editable view of the actor\u2019s position, size, and direction appear. Enter new values, press <strong>Enter<\/strong>, and watch your actor change immediately in response!&nbsp;<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"True-and-False_Are_Diamond-Shaped\"><\/span>True-and-False Are Diamond-Shaped<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Have you noticed that the blocks\u2019 shapes give you a hint about the kind of data they return? True-and-false values in Tynker take a diamond shape. These true-and-false values are also called <strong><em>booleans<\/em><\/strong>.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"59\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082753\/1-1024x59.png\" alt=\"Boolean values in Tynker take a diamond shape. These can only return one of two values: True or False!\" class=\"wp-image-20558\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082753\/1-1024x59.png 1024w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082753\/1-150x9.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082753\/1-300x17.png 300w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082753\/1-768x44.png 768w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082753\/1.png 1040w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>True-and-false expressions are the only conditions you can use in if-else blocks. Notice how the shape matches!<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082808\/2.png\" alt=\"If-else statements have an empty, diamond-shaped hole that perfectly matches the green boolean blocks\" class=\"wp-image-20559\" width=\"398\" height=\"188\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082808\/2.png 530w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082808\/2-150x71.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082808\/2-300x142.png 300w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/figure><\/div>\n\n\n<p>In contrast, numbers will have a rounded shape and cannot be used as conditions alone. Their shape hints at what you can do with them!<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082826\/3.png\" alt=\"Variables with a round shape are numbers\" class=\"wp-image-20560\" width=\"308\" height=\"46\" srcset=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082826\/3.png 410w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082826\/3-150x22.png 150w, https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326082826\/3-300x45.png 300w\" sizes=\"auto, (max-width: 308px) 100vw, 308px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Expand_Blocks\"><\/span>Expand Blocks&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Several code blocks, like <strong>if-else <\/strong>and <strong>join<\/strong>, can be expanded. You can use the <strong>(+) <\/strong>button to add more branches or inputs. Then use <strong>(-)<\/strong> to remove them.&nbsp;<br><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"264\" src=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20221025173040\/expanding-if-else.gif\" alt=\"Demonstrating how the (+) button lets you click to expand the if-else block and the join block\" class=\"wp-image-30762\"\/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ready_to_Learn_More\"><\/span>Ready to Learn More?&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Looking for more activities? Check out the <strong><a href=\"https:\/\/www.tynker.com\/parents\">Course Catalog<\/a>!<\/strong>&nbsp;And read the rest of our free tutorials in the <strong>Tynker Toolbox<\/strong> series:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-workshop-basics\/\"><strong>Tynker Workshop Basics<\/strong><\/a> \u2014 Learn about coordinates and start coding with Tynker.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/animation-tool\/\"><strong>The Animation Tool<\/strong><\/a> \u2014 Learn about frame-based animation and other animation tips.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-character-creator\/\"><strong>The Character Creator<\/strong><\/a> \u2014 Take control of custom rigs using the Animation blocks.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/text-tricks\/\"><strong>Text Tricks<\/strong><\/a> \u2014 Work with speech bubbles and more. Tell your own stories, put on a play, or make a computer write poetry!<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-sound-blocks\/\"><strong>The Sound Blocks<\/strong><\/a> \u2014 Play music with code! Add custom sound effects, too. Tynker\u2019s brand new music tool supports MIDI and MP3.&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/the-synth-blocks\/\"><strong>The Synth Blocks<\/strong><\/a> \u2014 Create your own sound effects and instruments! You can create crunchy dubstep drops, glitchy chiptunes, or instruments from any style of music you can imagine!&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-pen-blocks\/\"><strong>The Pen Blocks<\/strong><\/a><span style=\"color: initial;\"> \u2014 Make your actors draw as they move. Create patterns, draw geometric shapes, and more.<\/span><\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-physics-blocks\/\"><strong>The Physics Blocks<\/strong><\/a> \u2014 Create games or simulations with gravity, collisions, and more. Think: <em>Angry Birds<\/em> and <em>Marble Madness<\/em>.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/the-ar-blocks\/\"><strong>The Augmented Reality (AR) Blocks<\/strong><\/a> \u2014 Want to use video or photos in your programs? Try the AR Blocks, which let you code your own selfie!&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-ai-blocks\/\"><strong>The Artificial Intelligence (AI) Blocks<\/strong><\/a> \u2014 Take your AR projects to the next level with face-, hand-, and pose-tracking. Explore what makes AI special.&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/debugger\/\"><strong>The Debugger<\/strong><\/a><span style=\"color: initial;\"> \u2014 Learn about Tynker\u2019s data debugger and get bug-fixing tips.<\/span><\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-tutorial-builder\/\"><strong>The Tutorial Builder<\/strong><\/a> \u2014 Did you ever make a really cool Tynker Block project and wish you could teach the whole world exactly how you did it? Now you can!<\/li>\n\n\n\n<li><a href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-the-python-editor\/\"><strong>The Python Editor<\/strong><\/a> \u2014 Looking for a challenge? Ready for your next step on your coding journey? Learn Python with Tynker too, and take the plunge into text-based coding.<\/li>\n<\/ul>\n\n\n\n<p>Did we forget your favorite block-coding tip? Share your tricks with us at community@tynker.com<br><\/p>\n\n\n\n<p class=\"has-text-align-center\"> <br><a class=\"sf-button large accent standard \" href=\"https:\/\/www.tynker.com\" target=\"_blank\"><span class=\"text\">GET STARTED FOR FREE<\/span><\/a>  <br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Think you know everything about Tynker Code Blocks? Let\u2019s see about that. Explore some cool hidden features with this code blocks tutorials and become a Tynker ninja! Open up Tynker workshop (Projects &gt; +Create a New Project &gt; Blank Block Project) and follow along! Disconnecting Blocks With block based coding, you\u2019ll often have to rearrange code and experiment with the [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":20590,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[510,12,123],"tags":[433,443,429],"class_list":["post-20545","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-block-coding","category-ideas-and-tips","category-new-tynker-features","tag-tricks","tag-tips","tag-tynker-toolbox"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tynker Toolbox: Code Block Tricks - Tynker Blog<\/title>\n<meta name=\"description\" content=\"Enhance your coding skills and explore creative coding projects with Tynker&#039;s code block tricks. Take your Tynker projects to the next level!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tynker Toolbox: Code Block Tricks - Tynker Blog\" \/>\n<meta property=\"og:description\" content=\"Enhance your coding skills and explore creative coding projects with Tynker&#039;s code block tricks. Take your Tynker projects to the next level!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/\" \/>\n<meta property=\"og:site_name\" content=\"Tynker Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Gotynker\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-26T17:38:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-18T20:22:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326102846\/blog-71.png\" \/>\n\t<meta property=\"og:image:width\" content=\"996\" \/>\n\t<meta property=\"og:image:height\" content=\"450\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tynker Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@gotynker\" \/>\n<meta name=\"twitter:site\" content=\"@gotynker\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tynker Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tynker Toolbox: Code Block Tricks - Tynker Blog","description":"Enhance your coding skills and explore creative coding projects with Tynker's code block tricks. Take your Tynker projects to the next level!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/","og_locale":"en_US","og_type":"article","og_title":"Tynker Toolbox: Code Block Tricks - Tynker Blog","og_description":"Enhance your coding skills and explore creative coding projects with Tynker's code block tricks. Take your Tynker projects to the next level!","og_url":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/","og_site_name":"Tynker Blog","article_publisher":"https:\/\/www.facebook.com\/Gotynker\/","article_published_time":"2020-03-26T17:38:08+00:00","article_modified_time":"2023-09-18T20:22:36+00:00","og_image":[{"width":996,"height":450,"url":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326102846\/blog-71.png","type":"image\/png"}],"author":"Tynker Team","twitter_card":"summary_large_image","twitter_creator":"@gotynker","twitter_site":"@gotynker","twitter_misc":{"Written by":"Tynker Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#article","isPartOf":{"@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/"},"author":{"name":"Tynker Team","@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/person\/934d769f4839cb9df678306ee728f671"},"headline":"Tynker Toolbox: Code Block Tricks","datePublished":"2020-03-26T17:38:08+00:00","dateModified":"2023-09-18T20:22:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/"},"wordCount":1088,"publisher":{"@id":"https:\/\/www.tynker.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#primaryimage"},"thumbnailUrl":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326102846\/blog-71.png","keywords":["Tricks","Tynker Tips","Tynker Toolbox"],"articleSection":["Block Coding","Ideas and Tips","New Tynker Features"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/","url":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/","name":"Tynker Toolbox: Code Block Tricks - Tynker Blog","isPartOf":{"@id":"https:\/\/www.tynker.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#primaryimage"},"image":{"@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#primaryimage"},"thumbnailUrl":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326102846\/blog-71.png","datePublished":"2020-03-26T17:38:08+00:00","dateModified":"2023-09-18T20:22:36+00:00","description":"Enhance your coding skills and explore creative coding projects with Tynker's code block tricks. Take your Tynker projects to the next level!","breadcrumb":{"@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#primaryimage","url":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326102846\/blog-71.png","contentUrl":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20200326102846\/blog-71.png","width":996,"height":450},{"@type":"BreadcrumbList","@id":"https:\/\/www.tynker.com\/blog\/tynker-toolbox-code-block-tricks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Coding for Kids","item":"https:\/\/www.tynker.com\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/www.tynker.com\/blog\/"},{"@type":"ListItem","position":3,"name":"Tynker Toolbox: Code Block Tricks"}]},{"@type":"WebSite","@id":"https:\/\/www.tynker.com\/blog\/#website","url":"https:\/\/www.tynker.com\/blog\/","name":"Tynker Blog","description":"Tynker makes it fun and easy to learn computer programming. Get started today with Tynker&#039;s easy-to-learn, visual programming courses designed for young learners in grades K-12.","publisher":{"@id":"https:\/\/www.tynker.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tynker.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.tynker.com\/blog\/#organization","name":"Tynker - Coding for Kids","url":"https:\/\/www.tynker.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20220713063303\/appicon-120.png","contentUrl":"https:\/\/images.tynker.com\/blog\/wp-content\/uploads\/20220713063303\/appicon-120.png","width":120,"height":120,"caption":"Tynker - Coding for Kids"},"image":{"@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Gotynker\/","https:\/\/x.com\/gotynker","https:\/\/www.instagram.com\/tynkercoding\/","https:\/\/www.pinterest.com\/gotynker\/","https:\/\/www.linkedin.com\/company\/tynker"]},{"@type":"Person","@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/person\/934d769f4839cb9df678306ee728f671","name":"Tynker Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tynker.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0c99790faad86022606c21f06600125a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0c99790faad86022606c21f06600125a?s=96&d=mm&r=g","caption":"Tynker Team"},"url":"https:\/\/www.tynker.com\/blog\/author\/lpateltynker-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/posts\/20545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/comments?post=20545"}],"version-history":[{"count":28,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/posts\/20545\/revisions"}],"predecessor-version":[{"id":36112,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/posts\/20545\/revisions\/36112"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/media\/20590"}],"wp:attachment":[{"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/media?parent=20545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/categories?post=20545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tynker.com\/blog\/wp-json\/wp\/v2\/tags?post=20545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}