MakerS as innovaTors Chapter 1 Welcome to Blockly y ou might think your computer is pretty smart After all it can do all kinds of incredible things However a computer does only what a person tells it to do It can only do such amazing things thanks to the work of smart creative computer programmers In the past programmers had to learn their jobs the hard way They wrote line after line of code and told What’s going on here These words aren’t nonsense They’re computer code 44
Getting Specific When you tell a computer what to do you have to be very specific If you want a computer to draw a circle you have to tell it how big to make the circle and what color it should be You might also need to tell the computer how quickly to draw the circle and how many circles to draw before stopping If you’re not careful a computer could go on doing something forever in a never-ending loop computers how to do things like solve math problems Today there’s a more fun way to learn about com puter programming Using Blockly even beginners can create their own computer games and other cool programs Blockly is a language you can use to communi cate with a computer and tell it what to do Different languages are used to communicate with different people and things Languages can be written down or spoken aloud They can even use hand move ments or be drawn with pictures Languages used to communicate with computers are called program ming languages Most programming languages use a combination of words numbers and symbols They can be very complex and tough for beginners to learn Blockly uses blocks shaped like puzzle pieces 5 Blockly
MakerS as innovaTors Types of Blocks The blocks in Blockly are divided into groups based on the thing they can do These groups are organized by colors Purple action blocks tell the character on the screen what to do This can be turning moving or any other action You can make a character carry out one action after another by stacking purple blocks together Green blocks are loops They tell characters to do an action over and over until something specific happens You place other blocks inside the green blocks Blue blocks tell a character to check to see if something is true The character can then complete different actions depending on the situation For instance Is there a path to the right If yes turn right If no keep moving straight Most blocks have little drop-down menus so you can adjust the details of how they work Simply click on the arrow on a block to change the amount or style of what you want to do To move a connected group of blocks just select the highest block All of the blocks underneath will stay connected If you want to remove a block select it and move it to the side or back to where you selected it from You can simply combine these blocks into a list of instructions for a computer When you create a computer program you have to follow rules just like you do when forming sen tences in English There are many rules to follow when using English Following these rules when speaking 6
Blockly gives you a lot of hints to help you learn On the left side of the screen Blockly tells you how many more blocks it would take to complete your code The pop-up box with the bell reminds you what a certain block will do or writing makes it easier for people to make sense of what you are saying But if you make a small mis take people will probably still be able to understand what you meant This isn’t true for computers If you make a mistake when writing code the computer will not know what to do This could lead to your program working incorrectly or not working at all Because traditional programming languages are so complex it can be easy to make small mistakes 7 Blockly