Kids, Code, and Computer Science
m z n bea
e n i z aga
e d i 9 1 u 0 2 G t f the i G M A E T S
October 2019
$6.00$6.00 USD
Plus stories on Roblox, SketchUp, Happy Numbers, and more!
beanz magazine October 2019: Volume 7 Issue 2 Issue 434 (online) & 29 (print) ISSN: 2573-3966 (online) ISSN: 2573-3958 (print) beanz Magazine© is published bi-monthly, six times a year, online at http://beanzmag.com and in print. A print + online magazine subscription includes online access to all articles, with links to let you explore topics in more detail. SUBSCRIBE: visit http://beanzmag. com/subscribe or email us for checks/ invoices. We’re also available through EBSCO, Discount Magazine, WT Cox, Magazine PTP, and many other subscription services. ONLINE MAGAZINE ACCESS: send your email address to hello@beanzmag.com and we’ll set you up. Published by Owl Hill Media, LLC 378 Eastwood Rd, Woodmere, NY 11598 Email: hello@beanzmag.com Phone: (646) 553-3390 POSTMASTER: Send address changes to Owl Hill Media, LLC, 378 Eastwood Rd, Woodmere, NY 11598. Periodicals postage paid at Woodmere, NY and other mailing offices Copyright Owl Hill Media, LLC with all rights reserved except as noted. Images are copyrighted by their creators, as noted with each story both online and in print. Publisher/Editor: Tim Slavin Staff Writers: Erin Winnick, Amy S. Hansen, Les Pounder, Bonnie Roskes, Simon Batt, Patricia Foster, Clarissa Littler, Jennifer Newell, Tim McGuigan, Bianca Rivera, Tim Slavin Contributors: David Dodge, Jay Silver, Jeremy Kubica, Colleen Graves, Daniel Fenjves, Ali Hagen, Emeline Swanson, Jean-Francois Nguyen, Paul Seal, Madeleine Slavin Back Office Magic: Wendy Garrison Copy Editor: Eileen Seiler Art Director: Kelley Lanuto Webmistress: Patricia Foster COVER IMAGE: BACKGROUND/ORNAMENT TODD TRAPANI, UNSPLASH; TOY BY HELLO-I-AM-NIK, UNSPLASH; PHOTO COLLAGE BY KALANUTO DESIGN
Publisher’s Note In the six years publishing this magazine, I’ve heard mostly good things from readers, as well as parents, teachers, and librarians. Which is great: we work really hard to make every issue fun and interesting. Starting this issue, however, I want to do something different. I’d like future issues to include content from readers: how do you use the magazine? What do you like most? What topics do you want to read about? Have you tried a project and, if so, how did that go? Or, how do you use technology? What I like most about the magazine? The quirky stories. I loved learning Bluetooth technology is named after a Danish king with a blue tooth. And this issue shows how salt works in computer science and encryption. And you can learn about happy numbers. I also like the critters Kelley, our designer, creates for the magazine. They add humor to balance stories that might seem scary to people. The bird’s name is Brittany, after one of my daughter’s friends. You’re welcome to name the other critters, too. If you’re interested, definitely email us at cool@beanzmag.com to let us know what you think of the magazine, how you use it, and anything technology-related you’d like to share with other readers. Who knows, we might publish your thoughts and (if you got them) pictures! At the least, welcome to this issue and thank you so much for reading!
Tim Slavin, Publisher beanz Magazine beanz magazine (as Kids, Code, and Computer Science magazine, our earlier title) is a winner of Parents’ Choice, Tillywig, and Academics’ Choice awards: http://beanzmag.com/awards
Our Mission beanz magazine is a bi-monthly online and print magazine about learning to code, computer science, and how we use technology in our daily lives. The magazine includes hard-to-find information, for example, a list of 40+ programming languages for education, coding schools, summer tech camps, and more. While the magazine is written to help kids ages 8 and older learn about programming and computer science, many readers and subscribers are parents, teachers, and librarians who use the articles to learn alongside their young kids, students, or library patrons. The magazine strives to provide easy to understand how-to information, with a bit of quirky fun. Subscribers support the magazine. There is no advertising to distract readers. The magazine explores these topics: Basics of programming and where to learn more, Problem solving and collaboration, Mathematical foundations of computing and computer science, Computational thinking, Recognizing and selecting computer devices, and the Community, global, and ethical impacts of technology.
October 2019
2
Projects Say Hello to My Little Friend!
4 5 6 8 10 11 14
Puzzles Cover Story What Is a Happy Number? Concepts Cover Story Roblox Concepts Not a Birdbrain After All! Programming Totally Spaced Out Concepts The Tale of Lorem Ipsum Programming Hello, World! Programming Just Your Type
23
Cover Story
STEAM Gift Guide 2019
Cover Story
History History of 3D
15 16 18 20 22 29
Programming Searching for Closure Concepts Please Pass the Salt! SketchUp Cover Story SketchUp a Jack o' Lantern Electronics How Quick Are You? History A New Dimension in Space Travel Parents and Teachers Raising Problem Solvers
cool beanz! We've started something new, it’s called cool beanz! We want to hear from YOU, our beanz readers: What do you think of beanz? What’s your favorite story? Did you try a project? Send us a picture of something you created that’s inspired by your favorite magazine, beanz. We might just publish it and make you famous. Look here and online for your fellow beanz-ers and all the cool things they do. Send your thoughts, ideas, art, photos, poems, whatever, to cool@beanzmag.com.
contents
advanced
intermediate
beginner
scribe b u s / m mag.co z n a e b / https:/
Projects
2
BY BIANCA RIVERA
Say Hello to My Little
Programming Botley to catch up to his rodent friend, Colby
Botley will get a little loopy from this
Are you a kid between 5 and 8 years of age? Do you want to learn how to code? If so, meet Botley, the coding robot. Like his rodent cousin, Colby, Botley teaches the basics of sequencing and spatial concepts. And you can even learn about using loops and conditionals. Botley is programmed using a Remote Programmer (a remote control) to code his movements. The Remote Programmer has 4 directional command buttons. Forward and Reverse move Botley one step—each step equals about 8 inches. The Turn Left and Turn Right buttons rotate Botley 90 degrees. On top of the remote is a
Loops Botley can be programmed to move in the pattern of a shape using just 3 buttons. Every time the loop button is pressed, Botley will repeat that sequence. First, press Clear to delete the previous program. Next, enter the following sequence:
Transmit button that sends a program to Botley. There is a Clear button that deletes all previously programmed steps. The 2 advanced buttons include Object Detection (for If/Then) and Loop, which allows Botley to repeat a sequence. Sequencing Get to know basic sequencing by programming Botley to travel to a specific point. Notice the cards, which describe the code to be entered. In the following example, Botley is programmed to catch up to his friend, Colby the Mouse. To accomplish this, enter the following sequence: Forward, Forward, Forward, Left, Forward --> Transmit
Loop, Forward, Right, Loop, Loop, Loop --> Transmit Can you guess what shape will be created? If/Then You can use Botley’s object detection sensor to “see” objects in his path using If/Then. First, press Clear to delete the previous program. Next, place an
3
Friend!
program!
obstacle directly in front of Botley. Enter the following sequence: Forward, Forward, Forward --> Transmit Notice what happens. (Clue: there will be a crash!) To avoid this, take advantage of If/Then statements. Move Botley back to his starting position. Again, place the obstacle directly in Botley’s path. This time, do not press Clear to delete the previous program. We will add the following code to enable object detection. Object Detection Button, Right, Forward, Left --> Transmit Now Botley will know what to
Hello!
Botley using If/Then to avoid the pesky blocks and reach his target do when he “sees” an object in his path. Botley will execute the sequence. Now when Botley “sees” the obstacle, he will go around it and continue his path to complete the original program.
The Learning Resources company won its first ever “Innovative Toy of the Year (TOTY) Award” for Botley the Coding Robot. Learning Resources also created Code & Go Robot Mouse featuring Colby the Mouse.
Hidden Features Botley has some secret features that can be discovered by trying out different programs. The company has only shared a few of the secret codes. Here is one to try: Right, Right, Right, Right, Left, Left, Left, Left --> Transmit Cuteness alert! Botley will get very dizzy. What else can you discover?
b
https://www. learningresources.com/ botleyr-the-codingrobot
Languages Puzzles
4
a s i ? r t e a Wh y Numb p p a H
BY TIM SLAVIN
While numbers do not feel emotion, people do respond emotionally when numbers behave in surprising and amusing ways. Happy Numbers are numbers that can be reduced to 1 with a simple formula. Finding Happy Numbers can be a satisfying activity for a few minutes or a few hours. To determine if a number is happy, or not, follow these simple rules with any number: If the number is a single digit, square it (multiply it by itself). If the result or the original number has multiple digits, take each digit by itself and square the digit (multiply it by itself). Repeat until you get to the number 1. Let's try a few numbers: 1 times itself (1 x 1) equals 1 and is, therefore, a happy number. 2 times itself (2 x 2) equals 4. 4 squared (4 x 4) is 16 which, when split, becomes (1 x 1) + (6 x 6) or 1 + 36 equals 37. 37 split up becomes (3 x 3) + (7 x 7) or 9 + 49 equals 58. 58 split up becomes... Okay, let's stop to explain that if the numbers 4, 16, 37, 58, 89, 145, 42, 20, and 4 show up in this order, we know the number will never resolve to 1. Therefore, those numbers will never be happy. In fact, the numbers will repeat this cycle forever. That’s sad. Try other numbers, starting with 3 and with a sharp eye for the 4, 16, 37, and 58 results pattern to tell you the number is not happy. Then try the numbers 4, 5, 6, 7, and so on. So take out a sheet of paper, find something to write with, and see how many happy numbers you can find. Answers: Remember, don’t look until you’ve tried a few numbers to see if they’re happy! No cheating! :-) Here are answers to the math puzzle. Hopefully you tried to solve the problem instead of skipping down this page. These are the happy numbers from 1 to 1000. How many did you find? 1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100, 103, 109, 129, 130, 133, 139, 167, 176, 188, 190, 192, 193, 203, 208, 219, 226, 230, 236, 239, 262, 263, 280, 291, 293, 301, 302, 310, 313, 319, 320, 326, 329, 331, 338, 356, 362, 365, 367, 368, 376, 379, 383, 386, 391, 392, 397, 404, 409, 440, 446, 464, 469, 478, 487, 490, 496, 536, 556, 563, 565, 566, 608, 617, 622, 623, 632, 635, 637, 638, 644, 649, 653, 655, 656, 665, 671, 673, 680, 683, 694, 700, 709, 716, 736, 739, 748, 761, 763, 784, 790, 793, 802, 806, 818, 820, 833, 836, 847, 860, 863, 874, 881, 888, 899, 901, 904, 907, 910, 912, 913, 921, 923, 931, 932, 937, 940, 946, 964, 970, 973, 989, 998, 1000 For clever readers, do you notice something odd about the numbers that end in zero in this list? That would be: 10, 70, 100, 130, 190, 230, 280, 310, 320, 440, 490, 680, 700, 790 820, 860, 910, 940, 970, 1000. They are 10 times the first 20 numbers: 1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100. Happy Numbers are a pattern and include a pattern within them. Numbers can be beautiful, and sublime. b DENISE KREBS, FLICKR
Roblox Roblox is a platform for making 3D games with Lego-looking characters and can be used to create all sorts of free games to share. It's easy to pick up and play, but let's tackle getting started with coding. Go to https://www.roblox.com/ create to download Roblox Studio, the development platform for making Roblox games. Log in, and you'll see a series of options. Select the option for "Baseplate". This is the minimum environment in Roblox. A This is the development environment for Roblox. It shows you all the things you've put in the game as well as a bunch of menus and informational windows about all the objects in the game. To make things easier, click on the "View" tab, making it look like this: B This lets us have windows that list all the items in our game and the ways we can modify them. First, place some basic shapes by clicking on "Part". If you click on the little black arrow under the word "Part" you'll see that you can choose a few basic shapes to add into the game. Every time you add something you'll see a new thing be added to the Explorer window on the righthand side of the screen. If you click
5
Concepts
BY CLARISSA LITTLER
on it, you'll see the object's properties: color, what it's made of, and even its position and speed. Set the y-velocity of one of the objects you placed to a big number and start the game. Did you see it shoot into the air then fall down again? It happened really fast–how do we slow it down? How to code objects is missing from a lot of Roblox introductions. To start, click on the part you added in the Explorer tab and you should see a little + symbol that you can click on to add a child. Add a new script and replace the print("Hello, World!" with the following Lua code thing = script.Parent thing.Velocity = Vector3.new(0,0,0) wait(15) thing.Velocity = Vector3new(0,200,0)
• The script you made is a child of the part, so you can get access to the part itself with script.Parent. • Make sure the object is still at the beginning by giving it a velocity (which is like speed, but the speed in each direction is listed instead of a single number like 55 MPH) where each of the three components is 0. • We wait fifteen seconds. • Then we set the velocity of the part to go straight up.
Try your game again and stare at the part you put down. Wait for it… and pop it goes into the air. Now you can start playing with the building tools. I'm deemphasizing them here because the Roblox site has a number of tutorials that already cover how to place things. But you should play around with hinges in order to try out how to connect objects together. Now, let's make objects while the game is running. Go to the ServerScriptService item in the Explorer and add a new script, then add the following code inside it: C Here we defined a function to make new parts that returns a function, a closure actually (explained in a different article in this issue) that when called makes the part "jump". We make new jumpers by calling this function and, one by one, make all three new parts jump. This is a simple example but it shows how just a little bit of Lua code can go pretty far! Try Roblox, have fun and use it to sharpen your coding chops. And as always, there's lots more online. Check out the link for this article on the back cover of this issue. Happy hacking! b
B
A
C
Languages Concepts
6
BY PATRICIA FOSTER
Not a Birdbrain After All! Imagine that you live in the good ol’ days of yore, before the internet and the telephone, when people communicated by tying messages to the legs of homing pigeons and sending them back to their owners; a delivery system not unlike the owls in Harry Potter, but with a less majestic bird. Now imagine you’re in charge of your school’s pigeon coop. Today, you’ve received 11 pigeons, but there are only 10 pigeonholes. The solution? For now, you’ll have to put two pigeons in one hole. In mathematics, we call this the Pigeon Hole Principle and it can be used to prove all kinds of complex theories. A Closer Look at These Pigeons…
If you have “n” objects and “k” containers, and n > k, then at least one container will contain two objects. Or, to use a concrete example: if you have more pigeons than holes, a couple pigeons have to share. Now, the theorem doesn’t tell you which hole gets the two pigeons. It could be the first hole, the second hole, the last hole— doesn’t matter. Technically, you also could put all the pigeons in a single hole and leave the others empty. All we know is that it’s impossible for each pigeon to have their own space, and therefore one hole has at least two birds. Examples
To use the Pigeon Hole Principle, you have to identify your objects and your containers, and then compare the size of the two sets to draw interesting conclusions. 1) If you have 366 people, then at least 2 of them share a birthday.
In this example, the birthdays are “containers”, so k = 365. Your “objects” are people, so n = 366. Since n > 365, we can guarantee that one day of the year is going to feature at least two birthday cakes. Chances are there will be a lot more overlap—and days with no birthdays—but we can only guarantee one collision. 2) At least 2 people in New York have the exact same number of hairs on their heads. The average person has about 100,000 hairs on their head, with a maximum of about 500,000 hairs for really luscious locks. Let’s say k = 500,000 containers. The population of New York is over 8.6 million, which is way bigger! We don’t know what the exact number is—perhaps 2 people have 196,738 hairs each, or 10 people all have 100,000 hairs each—but we do know that at least two people share the same number of hairs on their head. Solving Problems With the Pigeon Hole Principle
Let’s say you own yellow and blue socks and you keep them in a big jumble in your drawer. One morning, you get dressed in the dark and you can’t see the color of your socks. (Maybe there’s a power outage?) How many socks should you pull out of the drawer to guarantee that you have a matching pair? If you pull out 2 socks, they might both be blue, they might both be yellow, or you might get one blue and one yellow. It’s a risk. But if you pick 3 socks, you’re set! In this example, our containers are the different sock colors (blue
and yellow) so k = 2. Our objects are the socks themselves. To guarantee 2 objects in a single container, we need to pick n > k. So as long as we take 3 socks or more, either the blue container or the yellow container will have more than one sock. We’re guaranteed to be fashionable! A More General Principle
If we have “n” objects and “k” containers, and n > k, then at least one container must have ceiling (n / k) objects. The “ceiling” function simply rounds up decimal numbers. Even ceil (6.0001) = 7. Meet Bob, a Martian creature with 7 legs who owns green, pink, and orange socks. If Bob gets dressed in the dark, how many socks should he remove from his dresser to make sure his 7 legs match? In this example, we don’t need 2 objects in a container—we need 7. There are three sock colors, so k = 3. Therefore, we need to pick an “n” so that ceiling (n / k) = 7, which means n / k must be greater than 6. The answer? Bob needs to pick 19 socks to ensure maximal style. 19 / 3 = 6.33, which rounds up to 7. Don't Underestimate Pigeons!
It might seem strange a little frivolous, but the Pigeon Hole Principle has lots of applications in mathematics and computer science. At the end of the day, even the most complicated science is built on simple, intuitive truths. b
7
I'm smarter than you think!
VIKTOR FORGACS, UNSPLASH
Programming
8
BY PATRICIA FOSTER
Totally Spaced Out
Are you ready to write some code that’s out of this world? Using Python with Turtle, we’re going to create our own mini solar system, with an earth that orbits the sun and a moon that orbits the earth. Setup
Navigate to http://repl.it/ languages/python_turtle (that’s “python_turtle”) First, we need to import some stuff from library packages. Type this code: from turtle import Turtle, Screen from math import sin, cos, pi, radians Next, we need to set up a “Screen” object, which represents the empty void of space. We’re also going to create three “Turtle” objects, one for each celestial body. We could leave them as little triangles, but to make our solar system more elegant, let’s use the shape function to transform the sun, moon, and earth into circles. Finally, the penup function prevents our orbiting objects from scribbling all over our nice spatial void. screen = Screen() sun = Turtle() sun.shape('circle') earth = Turtle() earth.shape('circle')
earth.penup() moon = Turtle() moon.shape('circle') moon.penup() The Earth Orbits the Sun
The sun sits at the center of our solar system, and the planets spin around it in ellipses. To simplify the math, we’re going to pretend the earth’s orbit is a perfect circle. So no matter what season it is—winter, spring, summer, or autumn—the earth is a fixed distance from the sun. Let’s add some variables to the code:
reaches (-200, 0) and at 270° it hits (0, -200). But what about all the angles in between? To figure that out, you start by transforming every point on the circle’s circumference into a rightangled triangle:
earth_distance = 200 earth_angle = 0 Our planet starts at angle 0, and every day it inches almost 1° along its orbit, completing the full circle at 365 days / 360°. To make our code work, we need to figure out how to determine the exact position of the earth on any particular day. A Little Trigonometry
Let’s put the earth on a cartesian graph. At the beginning, the earth starts 200 units to the right of the sun, otherwise known as the coordinates (200, 0). After circling around for 90°, our spunky little planet is directly above the sun at position (0, 200). Then, at 180° it
Original graph by https://www.symbolab. com/graphing-calculator
The radius of the circle becomes each triangle’s hypotenuse. And since we have right-angled triangles, we can use trigonometry! At its heart, trig is about relationships between lengths. We know that the hypotenuse is always the longest side of a right-angled triangle. If the angle between the base and the hypotenuse is very big, then the opposite side is also very big. If that angle is very small, then the opposite side is very small. With trig, we can figure out exactly how big or small.
bean z NATHAN ANDERSON, UNSPLASH
9
y = hypotenuse length * cos(base angle) Every time the angle increases by one degree, we get a new x and y position. The Orbit Code
The sine function takes in the base angle and compares the opposite side with the hypotenuse. Let’s say our angle is 30°. sin(30) = 0.5, which means our opposite side is exactly 50% the length of the hypotenuse. If your hypotenuse is 8cm, then the opposite side is 4cm. The cosine function does the same thing, but for the adjacent side. cos(30) = 0.866, so our adjacent side is roughly 87% the length of the hypotenuse (6.9cm).
There are many different units we use to measure length. When you measure a piece of paper, you might use centimeters or inches. If you measure distance you probably want kilometers or miles. Similarly, there are different units we use to measure angles. The most common is degrees, but there’s another system called radians, which is more suitable for trig. To keep things simple, we can use the radians function to automatically convert our degrees into the appropriate units. All together, the code for our solar system goes like this: from turtle import Turtle, Screen from math import sin, cos, pi, radians screen = Screen()
For any point on the circle’s circumference, the x and y coordinates are defined as follows: x = hypotenuse length * sin(base angle)
sun = Turtle() sun.shape('circle') earth = Turtle() earth.shape('circle') earth.penup()
moon = Turtle() moon.shape('circle') moon.penup() earth_distance = 200 earth_angle = 0 while earth_angle <= radians(360): earth_x = earth_distance * cos(earth_angle) earth_y = earth_distance * sin(earth_angle) earth.setpos(earth_x, earth_y) earth_angle += radians(1) The setpos function places the earth at position (x, y), where the x and y coordinates are defined by our sin and cos functions. Every time we run the while loop, earth_ angle is increased by one degree, until it completes the orbit. Hit the green “run” button at the top of the screen to try it out! To add the moon, be sure to read this article online. Look for the link for this article on the back cover. b
d the ou fin nz Can y n "Bea ellatio e h t const in inus" Sublim ove? b a photo
Concepts
10
BY TIM SLAVIN
The Tale of Lorem Ipsum No discussion of design is complete without the history of lorem ipsum, also called lipsum. This is the mumbo jumbo that designers use as "placeholder" text... saving the space for where the real text will go in a design. But why do designers use this fake text? Why not just use the actual text? The placeholder text is used in cases where actual real content would distract people from the design. If you are designing a website or a book for a client and you show your first rough designs, a client will often fixate on text in your design if the text is real and has meaning. They ignore all your hard work on the layout of information and images. They start to edit your text! Designers also exclude color from the initial designs for the same reason. Clients are odd this way, focusing on small details like content and color, instead of the critical foundation of a design, the layout and organization of information and images. It's better to get the general idea of a design agreed upon first, and worry about the minor details later. Lorem ipsum is a way around this problem.
In addition, for printers especially, lorem ipsum text is close enough to English and some European languages to serve as a placeholder to size text for different parts of a page layout. Long, medium, and short words abound in lorem ipsum. Sentence length is similar to English, too. Using this text is much easier than generating fake text any other way. Interestingly, the Latin text for lorem ipsum is actual writing from the Roman era about poverty and suffering, two things many designers are too familiar with. The formal title is, De finibus bonorum et malorum, or in English, About the Ends of Good and Evil. Lipsum text is from the first part of Cicero’s book, text about the dangers of hedonism, published in 45 BCE. Here are a few quotes in translation from Google Translate, first the Latin: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut id est eu dui fermentum eleifend ut a augue. Etiam hendrerit, sem ac vulputate volutpat, erat mi adipiscing lorem, in dictum odio
urna sed arcu. Nullam hendrerit vitae orci eget pretium. Nullam dui massa, consectetur non iaculis sit amet, commodo in ante. And here is Google’s translation of Latin to English, for your amusement: This page is required to post a comment. That being said, feel good warm-up in Japan is football so that from the company. Even the Bureau of older and see the Olympic downtown, I had enough storage, the Internet, has been said to hate urna but in the bow. Here’s the price of the development of the United States Bureau of life. Check out the online version of this article which links to the Loeb version, with the Latin on the left side of each page and a careful accurate translation into English on the right side of each page. There are a number of lipsum generators on the internet. There’s even a cupcake lipsum generator, although they cheat by adding words clients will recognize and, therefore, critique while ignoring your beautiful design. So be careful what lipsum generator you use! b
U.S. GEOLOGICAL SURVEY, FLICKR
When most people learn a software language, one of their first tasks is to learn how to output the phrase, “Hello World!” It might seem silly, but it teaches you how to output data in the simplest way possible. The first example of a Hello World! program dates back to 1978 and a book, The C Programming Language, by Kernighan and Ritchie. Here's the phrase in a few programming languages.
initial type of process or function. • PrintE(“Hello World!”) tells the programming language to print the phrase Hello World! • RETURN tells the language to return the value of PrintE, specifically, the phrase Hello World! The word return in computing used to mean literally return to the start of the next line of text on a computer screen. Today, return in a programming language means return the results of any commands.
Action! For the first example, we’ll start with the letter A and the Action! language used for Atari programs around 1983:
Scala The next example highlights features common in several modern languages. Here’s the program “Hello World! in the Scala language, an excellent first language for beginner coders:
; Hello world in Action! programming language for the Atari 8-Bit computers PROC Main() PrintE("Hello World!") RETURN Note some things in this code, common to many programming languages: • The semi-colon in the first line tells the programming language the text that follows is a comment and is not to be processed. • The PROC bit stands for “process” and in this case the process is called Main(). Presumably, as in many coding languages, Main() is a process called by default when a program runs. Any actions that must run when the program is started are placed in this
// Hello World in Scala object HelloWorld with Application { Console.println("Hello world!"); } This code has a taste of both old time coding and modern coding. Here’s a quick explanation of the code: • As with the other examples, the first line is a comment to tell the Scala language interpreter to not process this line of code. In Scala, comments are preceded by a double forward-slash. This also applies to other languages, for example, PHP. • Remember how Action! defines
11
Programming
, o l Hel ! d l r o W
BY TIM SLAVIN
a process with PROC? With Scala, the language creates an object called HelloWorld and the with Application direction tells the language to call this object and run it when the application starts. • See the { and } on the object HelloWorld line and the last line? These are called curly quotes. If you look closely, you’ll notice the first curly quote is a left bracket which opens (starts) the definition of the object. And the last curly quote is a right bracket to close (end) the definition. • Console and println are ancient terms in computer languages. Years ago, software programs wrote to computer screens, called consoles, that acted as front end terminals to control a computer. Output was generated line by line. So this line, Console.println, tells the Scala interpreter to print out the specified text in the brackets and double quotes, using older terms like console and print line. • Finally, on the Console.println line, notice the line ends with a semi-colon. This conveys to Scala the end of the specific line and any command on the given line. Many languages use both curly quotes to mark the start and end of a process or object and semi-colons to mark the end of lines of code within these process or object containers. Look at the online version of this article for many more examples! b
History
12
History of 3D History of 3D History of 3D
BY SIMON BATT
If you’re an avid gamer, you’ll know that games come in one of two graphical styles: a flat 2D game, or a larger 3D game. Sometimes, there are “2.5D” games, which use 3D graphics but only allow the characters to move as if they were in a 2D game. Did you know, however, that 3D games weren’t always around? There was a period where consoles and computers struggled very hard to render 3D games, to the point where it was best to stick with 2D graphics instead. This is because 2D games only need two methods of movement in order to function properly. They only need to handle moving up and down (when your character jumps) and left and right (when your character walks to the left or right). 3D games, however, require another plane which handles movement going toward and back (when your character runs towards or away from you). Really smart people call these the “X-axis,” “Y-axis,” and “Z-axis,” respectively. The thing is, while old consoles and computers weren’t powerful enough to use a Z-axis, developers had ways to play with the X-axis and Y-axis to make it look like there was one. This gave the illusion of a 3D image, even though it was still only in 2D. One trick is called parallax scrolling. It’s a lot easier than it sounds! Usually, 2D games would have one background image that would move as your character moved. A parallax scrolling background would have one background on top of another. The ‘top’ background would then scroll faster than the ‘bottom’ one. This gives the illusion of 3D, as the foreground elements move faster than the back. 2D artists could also get smart with how they drew their images to make them appear 3D. For example, one of the early Sonic the Hedgehog games, Sonic 3, featured a bonus level called “Blue Sphere.” To the players, it appeared as if Sonic was walking on a 3D sphere. In actual fact, the sphere was 2D and drawn in a way where the perspective was skewed, giving the appearance of 3D. The game then looped the graphics so it appeared as if Sonic was walking across a rolling plane when in actual fact it was repeating seamlessly. Some games even performed live calculations for the 3D effect! This was the case for the old game Mickey Mania, where one scene has Mickey fleeing from a moose on a “3D” plane. What was actually happening was the game drew an image of the floor in a distorted perspective, so it looked like the floor was wrapped around the cylinder. Then, the game moved the colors upward and looped it, so it looked like the cylinder was rolling. Then they just had to put Mickey Mouse on the top, and tada!—a pseudo-3D effect! If you’d like a blast from the past, take a look at some old games and see how they provide 3D effects before “real” 3D was possible. Just because the developers were limited in their scope, doesn’t mean they couldn't be smart with their tricks! b
13 An audience watching an early 3D movie, 1950's England
NATIONAL ARCHIVES, UK, WIKIMEDIA COMMONS
Programming
14
BY CLARISSA LITTLER
Just Your Type In the last few issues, we've discussed typed languages, like Rust or Idris. These are languages that have a way to classify, or type, the data that's in them. These types can be checked by the language to prevent errors or even help you write code. What about all those untyped languages? The Pythons, Rubys, and JavasScripts of the world. Well, enterprising programmers have invented methods to add types to untyped languages, and they do it in a few different ways. We'll talk a bit about some of them and give examples of how types are added to the three languages we named above. Namely, weâ&#x20AC;&#x2122;ll be talking about Sorbet for Ruby, TypeScript for JavaScript, and pytype for Python. First, keep in mind every untyped language can be seen as a typed language with only one type. We can call this lone type Any like TypeScript does, or Untyped like Sorbet does, but the point is the same: if you give everything in the language the type Untyped then everything type checks. After all, you're always checking that Untyped equals Untyped. That can't fail! Once we know we can give every term in an untyped language a dummy type that always passes type checking, this means that we can gradually add in more informative
MARKUS SPISKE, UNSPLASH
types like "boolean" or "integer" to bits of code. We can start expressing ideas like "the address argument to the web server response function needs to be a string" or "collision code for the hit boxes needs to take only integers" in the code bit by bit. This is, no surprise, called gradual typing. It's really useful for programmers working in big teams with bigger code bases because gradually adding types works like adding comments to the code that can be checked to see if the code is being used correctly. Sorbet is a gradual type system for Ruby and TypeScript is basically a gradual type system for JavaScript. The reason why I say "basically" is because, technically speaking, TypeScript is a gradually typed language that compiles to JavaScript but isn't JavaScript. Python has a cool project that's a little different than the gradual typing approach: pytype, which uses type inference. Type inference is related to type checking, but it's a two-step process: first the type checker tries to figure out the types of everything not explicitly labeled with a type, and then checks them. What does "figure out the types" mean? As an example, if you see something like aVariable + anotherVar then, assuming that this is Python code, what do you know
about the kinds of data in the variables? You know that they have either numbers or strings. If you instead see aVariable + str(anotherVar) then you know that aVariable must be a string but anotherVar could have literally anything in it. Type inference is this process of looking at how data is used to figure out exactly what it is, but the inference phase of type checking is way more complicated than just the simple rules we thought about here. Once types have been inferred then the typechecker tests to see if the inferences it made combine together to make a sensible program. This is exactly what pytype does. It looks at your code to figure out what the types are and whether they make sense. You can also add "annotations" of what the types of functions should be to help the type inference algorithm along. So that's just a little taste of the ways that the power of typed languages can be combined with the flexibility of untyped languages. If you have a favorite untyped language, try searching for "[your fave language here] gradual typing" or "[your fave language here] optional type system" and see what you can find. There are so many cool things language nerds do! b
Searching for Closure There's a feature hidden inside a bunch of languages, one that you've used without knowing: closures. Any language that has: • variables, (a way to name and store data to use later) or • first-class functions (functions that you can return as values or bind to variables) has closures. First, we need to talk about variable scope. The scope of a variable defines where the variable is well-defined and how you figure out, if there are multiple variables in a program with the same name, which piece of data you-the-programmer are trying to use. So for example, if you have a Lua program that reads as x = 10 function doofyFun(x) local x = 20 return x end print(doofyFun(30)) print(x) you have three different uses of the variable x. Can you name them all? Which one actually gets returned by doofyFun and printed out? Here's another question for you: what value is going to be printed by the last line? The answer to the first question is that the return x is going to only see the most recently defined x, the one closest to it. In this case, that's the x made in the line local x = 20. This is an example of what we call shadowing. The answer to the second question gives us an interesting twist. When we change an x inside doofyFun it can't affect the x declared at the beginning. It starts the program with a 10 inside
it and it ends the program with a 10 inside it. This tells us that data defined inside functions are in some sense invisible to the rest of the program. But what happens to these variables when the function has run and is done? Well, normally they're garbage collected—a concept that we've touched on a couple of times in past issues. This means that because no other code can reference these variables anymore, in other words they're not in scope for anything else in the program, then the language implementation knows it can just free up those containers of data to be recycled for other variables the program might make later. What if, though, you have something like the following program function newCounter() local c = 0 return function () c=c+1 return c end end counter = newCounter() print(counter()) print(counter()) print(counter()) This is doing something kinda neat! We have a function newCounter that first defines a new variable, c, and sets it to 0. Then it returns a function. What does this function do? Well, every time it's run it adds one to the variable c and then returns the value inside c. We then make a counter with the newCounter function and call it inside three calls to print. Can you
guess what this does? Try it yourself, or try the equivalent Python code at the repl.it website if that's more convenient. def newCounter(): c=0 def inner(): nonlocal c c = c+1 return c return inner counter = newCounter() print(counter()) print(counter()) print(counter()) The cool trick here is that since you're referencing the variable c inside the "inner" function then it can't get garbage collected, but it's visible to only the inner function. In other words, the inner function has "closed" over these variables that no one else can see or use. That's why the inner function is called a closure! You can test this by making two different counters with the newCounter function. If you increment each of these counters you'll see that they increase separately: two different c variables each visible to exactly one counter. Okay, that's a neat trick but what's it good for? Well, it's common in a lot of programming. JavaScript libraries in particular are famous for using closures everywhere, but you'll notice it all over the place once you've seen the pattern once. If you haven't read it yet, try reading the Roblox article in this issue and see if you can spot some places where I snuck in closures to make the code easier. b
15
Programming
BY CLARISSA LITTLER
Concepts
16
BY PATRICIA FOSTER
Please Pass When it comes to storing passwords on websites, the process should resemble a delicious potato dish: hashed, then sprinkled with a little salt and pepper. Anything less makes your password easy to steal! Plaintext Potatoes
Ever wondered why websites make you reset your password? If servers stored passwords in plaintext, and a hacker broke into their system, the thief would be able to snatch a full list of usernames and passwords right out of the database. Many people reuse passwords, so that a single hack can result in dozens of compromised accounts. To minimize the fallout from database leaks, websites don’t keep your plaintext password. They only keep its hash. What Is Hashing?
A “hashing algorithm” (or hash function) is a sequence of mathematical operations that transform a piece of plaintext into a string of gibberish. The output of a hash function has a fixed length, usually somewhere between 128 and 512 bits. Needless to say, the bitstring doesn’t look anything like its original password. If a hacker steals a hash, they won’t be able to reverseengineer it. To be an effective algorithm, every tiny change in the original plaintext should produce a big change in the hash. If the hashes of "password123" and "password124" are similar, that’s an important clue the hacker can use to guess your password. MD5 is an example of an old, broken hash algorithm. SHA-1 was the next contender, and it’s also considered unsafe, followed by the modern SHA-2 and SHA-3. When you log into your account, the website hashes your password and compares the output to the hash in its database. If they match — bingo! You’re logged in. This means that hash functions need to be reliable, and they must always output the same hash for the same text input. Breaking a Hash Function
While it’s impossible to reverse a hash, the algorithm used to generate the hash is accessible to everyone. All a hacker has to do is try every single password combination one at a time (aaaaaa, aaaaab, aaaaac). They feed the guesses through the MD5 or SHA-1 or SHA-2 algorithm and compare the result to the stolen hash until they find a match. If you’ve ever cracked a 4-digit combination lock by hand, you know that this "brute force” approach is gruelling work. Even a 6-letter password has almost 750 billion possibilities! But a good GPU can do up to 10 billion guesses per second, which exhausts all those possibilities in 75 seconds. If a
17
the Salt! hacker uses a refined strategy like a “dictionary attack” the process might go even faster. Another tool that hackers use are databases called “rainbow tables”, which store gigabytes of billions of common passwords next to their pre-computed hashes. If your password happens to be in a rainbow table, it only takes a few milliseconds to crack! Salts
A “salt” is a long, randomly-generated string of characters that is automatically added to the end of your password. So if your original password was "bumblebee12" and your salt is "6h7jk!2", then the website treats your password as "bumblee126h7jk!2" when it hashes it. The salt is stored inside the web database alongside your other personal info, so if a hacker breaks in, brute forcing your password isn’t longer or more complicated. However, rainbow tables are no longer an option! "Bumblebee12" might be in a rainbow table, but "bumblee126h7jk!2" definitely isn’t. Peppers
A pepper is a different type of randomly-generated character sequence that’s added onto your password. Peppers are much shorter than salts — maybe 64 bits instead of 256. There are two ways to use them. In the first, the pepper isn’t stored at all. The hashing algorithm tries out your password with all possible combinations of peppers, and if one of them matches, you’re in. Now, even an 8-bit pepper has 256 possibilities. That means hashing 256 different passwords, and possibly taking 256 times as long to log in! It only gets worse as peppers get longer. If it only takes the website a few milliseconds to authenticate, then slowing the process down won’t be noticeable to humans. But it will make lengthy brute force attacks exponentially longer. In the second pepper method, the pepper is stored in a file separate from the database — like a configuration file — so that it won’t be affected by leaks. The same pepper is used for all passwords on the website. While this method is significantly faster, it’s still possible for the pepper to be stolen, in which case we’re back to square one. Bon Appetit!
Hashes, salts, and peppers are password culinary techniques for website severs to worry about — not you! But it’s important to understand that even the best security systems have loopholes. As a user, make sure that you use strong passwords and that you don’t reuse passwords. After all, if your password is "password123", no seasoning in the world will save you. b
IMAGES: POTATO BY WILLIS LAM, FLICKER: SALT BY KAI SCHREIBER, FLICKR; PEPPER BY ERIK FORSBERG, FLICKR
SketchUp
18
BY BONNIE ROSKES
SketchUp a Jack o' Lantern With Halloween around the corner, let’s model a jack o’lantern! This project has two parts: modeling the pumpkin, and adding the face. When you start, you'll see Helen standing on the ground. She isn’t needed, so press E for the Eraser, and click on any of Helen’s edges. Press C for the Circle tool, click the origin (where the three axes meet) to place the center, and draw a circle of any size on the “ground.” We need one more circle. While still in the Circle tool, tap (don’t hold) the Left or Right arrow, which orients the circle to be vertical For this circle, place its center at the origin as before, and make this circle a bit larger than the first one. We’ll use these two circles to make a sphere. Press the Spacebar for the Select tool, and click the smaller circle to select it. Open the Push/Pull flyout toolbar. Click the Follow Me icon. Click the larger, vertical circle. Follow Me spins one circle around the other, producing a sphere. This sphere will be copied several times, and all copies need to be identical. Components are perfect for this— when you make changes to one component, you change all of
them the same way. So with the Select tool active (Spacebar), triple-click (yes, three times quickly) the sphere. Then right-click on the sphere and choose Make Component. Give the component a name, and click OK. Now the entire component is a single object, with a blue bounding box surrounding it. This sphere will be used for rotate-copying. Keep the sphere selected, and press Q for the Rotate tool. Move the protractor along the red axis, not too far from the sphere, and click to place it. Now tap the Ctrl key (PC) or Option (Mac), so that copies will be made. Move the mouse away from the protractor, and click anywhere to set the “zero” angle. Then start to pull out the copy, and type the number 45. This degree value appears in the Angle field at the lower right corner. You never have to click inside this field—just type and the numbers appear. Press Enter to complete the first copy. To get copies all the way around, type 7x and press Enter. Now the spheres have to be moved closer together, and
their overlapping outer faces will form the outside of the pumpkin. With the Select tool, double-click either of the two spheres that sit along the red axis. This opens the component for editing. Then click the sphere, to select it. Press M for the Move tool. The move direction can be set by clicking anywhere for the first point, then move your mouse in the red direction. Whatever you do to the sphere being edited is done to the other components as well. So as all of the spheres move inward, click to finish when the overlap looks something like this (right): Go back to the Select tool, and click anywhere in blank space to finish the component editing. Erase the first circle. The eight sphere components no longer need to be components. While in the Select tool again, press Ctrl + A (PC) or Cmd + A (Mac) to select everything. Then right-click on any selected sphere and choose Explode. It may take a few seconds to
complete, but after exploding, the spheres are all selected. Leave them selected. Open the Materials window with the icon on the right side. Click the Browse icon (the magnifying glass) to open the material collections, and open Colors. Find an orange color you like (or whatever color you want your pumpkin to be), and click any selected face of the spheres. All selected faces get painted at once. Now it’s time to add the face. We’ll first create a box on which we’ll draw the facial features. So orbit your view so that you’re looking straight down at the top of the pumpkin. Press R for the Rectangle tool and draw a rectangle on the ground that’s approximately the same width as the pumpkin. The rectangle is at the middle of the pumpkin, so it needs to be pulled up and down. Press P for the Push/Pull tool, and click the rectangle. Click again anywhere on the top of the pumpkin. Then orbit to see the bottom of the box, and pull down the bottom to the level of the bottom of the pumpkin. The front of this box is more or less the same size as the front of the pumpkin. So with the Line tool (press L), draw triangles for the
eyes, and some jagged lines for the mouth. Be sure that all three shapes are closed loops. Now erase all parts of the box except for the three shapes. With Push/ Pull, pull each shape back toward the pumpkin, stopping anywhere inside the pumpkin. The goal now is to get intersection edges where these three shapes meet the front of the pumpkin. Using Select, draw a selection window going from right to left. As long as this selection rectangle includes all of the front faces and any parts of the side
faces, all of the necessary faces will be selected. Rightclick on any selected face and choose Intersect Faces/With Model. This might take a few seconds to process— lots of geometry here! After erasing all of the white faces that stick out of the pumpkin, what should remain are edges along the front of the pumpkin. Find a dark color, and paint all of the bits of these small faces. Done! b
SketchUp is a free program for 3D modeling. There is a downloadable version called SketchUp Make, which you can get at https://www.sketchup.com/download/ all. The free, web-based version of SketchUp can be found online at https://app.sketchup.com/app.
19
20
Electronics
BY LES POUNDER
How Quick Are You? CircuitPython is marvelous. It enables anyone to write code which will run hardware projects both big and small. The best way to learn more is to create a simple game and go through each part of the game step by step. A "reaction" game is the simplest game for this purpose. The Circuit Playground Express board from Adafruit has everything we need: two buttons for user input and 10 Neopixel LEDs which can be any color that we wish. We'll make a two player reaction game, where the red team is assigned button A, and the green team button B. When the Neopixels change to blue, the fastest player will turn the LEDs to their team color to win the round. Along the way, you'll learn how to write CircuitPython code, how to use the Circuit Playground Express board, how to control Neopixels, and how to handle user input. Let's write this project using CircuitPython, a version of Python for microcontrollers maintained by Adafruit. If you can already write Python, then you can write CircuitPython. But if you are new to Python, fear not! We shall go through this project step by step.
Connect your Circuit Playground Express (CPX) to your computer using a good quality micro USB cable. Start Mu and it should automatically detect your CPX board.
If not then click on Mode and select Adafruit CircuitPython. We start our CircuitPython code with five library imports. These enable extra functions in our code. Time is used to create a delay in the code. Board enables our code to use components, such as Neopixel LEDs on the board. Digitalio enables the use of buttons A and B on the board. Neopixel is a special library to control the 10 multicolor LEDs on the board. Finally random is a special library used to add a little chaos to our game! import time import board import digitalio import neopixel import random We need to tell the code where the buttons are, and what they will do. We create an object called “button_a” and in there we tell the code where to find that button, which is “board. BUTTON_A” a button on the CPX. Then we tell the code that this will be an input, and that it’s resting state (when untouched) is DOWN, which means off.
We also create a similar object for “button_b”. button_a = digitalio. DigitalInOut(board.BUTTON_A) button_a.direction = digitalio. Direction.INPUT button_a.pull = digitalio.Pull. DOWN button_b = digitalio. DigitalInOut(board.BUTTON_B) button_b.direction = digitalio. Direction.INPUT button_b.pull = digitalio.Pull. DOWN To control the Neopixels, the 10 multi colored LEDs around the CPX, we need to tell the code where to find them and what to do. So creating an object called “pixels” we then call the “neopixel.NeoPixel” function and pass it a number of instructions. The first of these instructions tells the function that we are using the Neopixels on the CPX board. Then we tell the function how many Neopixels there are (10) on the board, and that their brightness should be 0.2, quite low but clearly visible. The next instruction tells the code that any changes should not be automatically written to the Neopixels. Lastly the Neopixels on the CPX use Green, Red, Blue as the order for their colors. This is one long line of code: pixels = neopixel. NeoPixel(board.NEOPIXEL, 10, brightness=0.2, auto_write=False, pixel_order=neopixel.GRB) To make controlling the Neopixels a little easier, we shall create our own function. A function is a block of code which can be
l You'l : Need
• An Adafruit Circuit Playground Express (CPX) • A computer running Windows, macOS, or Linux • Mu installed on your computer (https://codewith.mu/)
run when its name is used. Here we use the name “neo” for our function and pass an argument (an extra instruction) which will be the color that we wish the Neopixels to be. Inside the function, if the color argument is “red”, then all of the Neopixels are set to red using the numbers 255,0,0. In order to see this change we must then show it. The same process applies for the colors green and blue. def neo(color): if color == "red": pixels.fill((255, 0, 0)) pixels.show() elif color == "green": pixels.fill((0, 255, 0)) pixels.show() elif color == "blue": pixels.fill((0, 0, 255)) pixels.show() We are now finished writing the code for the function, and we are now back in the main code. We create a variable called “delay” and in there we store a randomly generated
number between 3 and 6. But why 3 and 6? Because this generates a random delay for our game, with 6 seconds being the maximum time and 3 as the minimum. The “random. uniform” function will pick the number as a float, so the delay could be 3.11145, 5.67 etc. This is then stored in the variable, which is then used on the next line with the “time. sleep” function. This will pause the code for that random time, before calling our “neo()” function with the color blue, signifying that the players should press their button. delay = random.uniform(3,6) time.sleep(delay) neo("blue") Here is where the players' reaction is checked in a while True loop so that we constantly run a conditional statement made up of two if’s. If the fastest player was red team, button A, then the value of button A goes from 0 (unpressed) to 1 (pressed) and if that happens then the “neo()” is called and we tell the
21 Neopixels to light up red. The code then pauses for 3 seconds to enable the players to see the winner. Lastly the code ends using “break” to stop the loop. The second if conditional test is for the green team on button B. while True: if button_a.value == 1: neo("red") time.sleep(3) break if button_b.value == 1: neo("green") time.sleep(3) break With all of the code completed, now we can save the code to the CPX as “main.py”. Luckily Mu is great for working with CPX and CircuitPython devices. Once the file is saved the CPX will reset and run the code. Get ready, because as soon as the Neopixels turn blue, you will have to press your button first to win! To replay the game just press the reset button and the code will run once again. Well done! You have made your own reaction game using CircuitPython on Adafruit’s Circuit Playground Express. b
History
22
BY ERIN WINICK
A New Dimension in Space Travel , ton s u Ho end s a up ch! n wre
Roge r it's o that, n way its !
3D printing is everywhere these days. But did you know it’s even in outer space? Yes, there is a 3D printer on the International Space Station (ISS). 3D printing, also known as additive manufacturing, builds up parts and shapes one layer at a time. The plastic printers usually feed in a thin plastic wire which melts. The printer then moves according to a pre-programmed pattern. 3D printing is helpful for astronauts because they must use whatever they brought with them or whatever can be sent to them on newly launched rockets. But by having a 3D printer on board, astronauts can print what they need, when they need it. This could also be helpful on longer spaceflights in the future, so that equipment can be made in flight and astronauts can adapt to new situations.
The first 3D-printed part was made in space in 2014, by a company named Made In Space. Since then, they've helped to produce more than 100 parts and tools on board the ISS. There’s now even a printer called the Refabricator that can turn old 3D printed parts into new ones. Through 3D design challenges, earthbound students have been able to submit models they think would be useful to humans living on the space station. The selected winners were printed in space! A multipurpose tool and a satellite launcher have been printed on the ISS. NASA recently finished its 3D printed habitat challenge where college students and professional teams designed and 3D printed prototype homes that could house future astronauts on our planetary neighbor. The winning design looked a bit like a beehive.
IMAGES: BACKGROUND BY NASA JOHNSON, ASTRONAUT SCOTT TINGLE, FLICKR; WRENCH BY COLD STORAGE, FLICKR
Other recently announced projects plan to take steps towards 3D printing a spacecraft in orbit around Earth, as well as 3D printing human organs in microgravity. Both are a long way off from actually happening, but it’s important for scientists to experiment first to help make it a reality. Do you want to explore space 3D printing? Check out NASA’s resource page. There you can find 3D models of everything from Mars rovers to satellites to sections of the moon on which humans have walked. They are fun prints you can test out on your own earth-based 3D printer. You can even find a model of the first item 3D printed in space to meet the needs of an astronaut: a wrench. And keep your eye on NASA’s websites. You never know when they might have another contest open that could let you send your own 3D model to space! b
beanz STEAM Gift Guide 2019
23
Sink teet your h in this! to
https:// beanzmag.com/ steam-tools This resource lists all kinds of STEAM tools for kids, organized by grade level. PETFUL.COM, FLICKR
24
STEAM Books Super Cool Scientists Coloring Book By Sara MacSorley This book highlights women working in fields ranging from marine biology to technology. https://www.amazon.com/SuperCool-Scientists-Sara-MacSorley/ dp/1534662235/
How Technology Works By Dorling Kindersley Publishing This amazing book explains visually how almost every human technology works, https:// www.dk.com/us/ book/9780 241356289-howtechnology-works/
Rosie Revere, Engineer By Andrea Beaty Rosie loves making things. Her great-great-aunt Rose helps her keep going and become an incredible engineer. https://www.amazon.com/RosieRevere-Engineer-Andrea-Beaty/ dp/1419708457
The Computer Science Activity Book By Christine Liu and Tera Johnson 24 projects let you explore everything from circuits to neural networks, no computer required. https://www.amazon.com/ComputerScience-Activity-Book-Paper/ dp/1593279108
Great Barrier Thief
Magic Tree House: Midnight on the Moon
By Dr. Suzie Starfish This picture book for the younger crowd was written by an Australian marine scientist and artist. https://drsuepillans.com/books/thegreat-barrier-reef/
By Mary Pope Osborne Number eight in this book series follows Jack and Annie on a trip through time and space. https://www.magictreehouse.com/ books/125151/midnight-on-the-moon
Robots
Lift-the-Flap Computers and Coding Learn how computers and programming work. Great for all ages! https://usborne. com/browse-books/catalogue/ product/1/9570/lift-the-flapcomputers-and-coding/
Ada Lace Series By Emily Calandrelli Five books follow the marvelous Ada Lace, a third-grade scientist, powerhouse inventor, and awesome student. https://www. simonandschuster.com/books/Ada-Laceon-the-Case/Emily-Calandrelli/An-AdaLace-Adventure/9781481485982
Scratch Coding Cards While not technically a book, this set of 75 cards has a number of projects, from beginner to advanced, that teach all parts of Scratch. Ages 8+ https://nostarch.com/scratchcards
Robo Wunderkind
Botly For children as young as 5. Botley will have kids coding in minutes. 100% screen-free, the only coding robot that includes a 45-piece set! https://www.learningresources.com/botleyr-the-coding-robot Little Robot Friends An easy way to get kids interested in coding and electronics. Each has their own personality. https://littlerobotfriends.com/ Sphero RVR RVR is drivable right out of the box, packed with a diverse suite of sensors, and built for customization. You can connect 3rd party hardware like Raspberry Pi, Arduino, micro:bit, and more. Available fall 2019. Check out Sphero Bolt, too. https://www.sphero.com/rvr
Robo Wunderkind This modular robot from Austria snaps together to make simple to complex robots, from a flashlight to a rolling vehicle that solves mazes. Includes free apps to program their robots. https://robowunderkind.com/ DJI RoboMaster S1 Includes 40+ components that lets you explore science, physics, artificial intelligence (AI), and more. https://www.dji.com/robomaster-s1 Dash and Dot Dash and Dot robots can be programmed with Blockly, a fairly easy language to master. Also check out their Cue robot! https://www.makewonder.com/robots/dash/
https://www.makewonder.com/robots/cue/
LEGO Mindstorms Take the LEGO ideaâ&#x20AC;&#x201D;easy to snap together parts to build thingsâ&#x20AC;&#x201D;and add icon-based programming, wheels, legs, and other mobile pieces. Also includes an active online community with lots of ideas to try. https://www.lego.com/en-us/mindstorms Cubetto Program the Cubetto robot with touch, pressing down block shapes in order to tell the robot what to do. Geared towards young kids. https://www.primotoys.com/
Code-a-Pillar Kids develop problem solving, planning, and critical thinking skills as they change the caterpillar's segments to make it go. https://fisher-price.mattel.com/shop/en-us/fp/think-learn/think-learn-code-a-pillar-dkt39
Ozobot
Two small robots, Evo and Bit, provide a deceptive amount of learning opportunities, creativity, and fun.
Apps Bitsbox Kids learn to code by making games on the Bitsbox.com website, and then play them on their phone or tablet. The games are quite clever with fun, bright graphics. And it’s easy for kids to adapt the code once they figure out the game, while learning and becoming Bitsbox comfortable with code. A new box of games arrives each month. Ages 5+. http://bitsbox.com
Erase All Kittens! A gentle introduction to professional coding languages, enabling children to play and learn on their own—or alongside parents and teachers. Mario-style gameplay for this online game to make learning these languages fun for complete beginners. Ages 8+. It’s a blast to play (and learn!). https://eraseallkittens.com/
Codea Codea is an iPad app to create games. Adapt existing code or create from scratch. The app has lots of game functionality with few limits on what you can create. Ages 10+. https://codea.io/ Hopscotch This iPhone and iPad app uses blocks you drag and drop to create effects. It has a strong community of kids who often come up with creative ways to have fun. Ages 5+ http://gethopscotch.com Tynker Many US kids are familiar with Tynker from their classrooms. Tynker is a block language, meaning you drag and drop blocks and configure them. It’s easy and fun to move blocks around, find sprite images, and make the blocks do things. Ages 5+ https://www.tynker.com/
Move the Turtle Little kids can move a “turtle” around the screen by setting direction and the number of steps in order to create artwork and solve problems. Teaches basic coding ideas and prepares kids for block languages like Scratch, Hopscotch, and Tynker. http://movetheturtle.com Coding Is Good, Swiftie, Touch Lua, Python 3.4 Learn how to code with Swift (Swiftie), Lua (Touch Lua), and Python (Python for iOS and Coding Is Good). SoloLearn has a number of apps and languages. Find them in the App Store and Google Play. Another option: find Python projects in books or online with the Repl.it website.
Run Marco! A coding adventure game in English and 26 other languages. Kids use conditional logic and critical thinking skills to help Marco get through his adventures. https://allcancode.com/runmarco The Foos This iPhone and iPad app helps kids ages 5-10+ work through levels where they can play and learn basic programming and computer science skills. https://thefoos.com/
Maker and Electronics Kits KiwiCo Created by a team of educators, makers, engineers, and rocket scientists (yes, for real), they deliver monthly crates (kits) with projects geared towards humans ages 0 to 104. Their goal is to inspire kids interested in science, art, and making things. https://www.kiwico.com/ KiwiCo
Labo by Nintendo While not electronic, Labo is a game and construction toy created by Nintendo. If you have a Switch console, Labo lets you create all kinds of neat projects and things from cardboard and your console. https://labo.nintendo.com/ Adafruit Laboratories You can find all things electronics on their site, as well as tutorials and fun projects like blinking unicorn horns (who doesn’t need those?). https://www. adafruit.com/ Piper Follow real engineering blueprints to build your own computer, and then use Pipercraft, a Minecraft mod, to configure it. You also can build gadgets with electronic boards. Includes wood case. https:// playpiper.com/ Kano This is a very simple snap together computer kit. The brains are powered by a Raspberry Pi and Kano includes an excellent operating system designed for kids. Also includes an online community to share ideas. https://kano.me
Jewelbots Create friendship bracelets with functionality kids can code. http://jewelbots.com/ https://techwillsaveus.com Hopscotch
25
26
littleBits Easy snap-together
Redfern They sell their Crumble
electronic pieces make a large number of different kits, and make it fun to invent things. http://littlebits.cc/
board with robot kits with motors, LEDs, and sensors. All programmable with a Scratch-like drag and drop language. https://redfernelectronics. co.uk/shop/
Snap Circuits A collection of snap together circuit projects to teach kids the basics of electronics. Includes a kit with coding projects. https://www.elenco.com/brand/snapcircuits/
LABO by Nintendo
Tech Will Save Us Educational tech toys that are kits kids can build to mix building, craft, science, tech, coding, and fun. Their Mover Kit is like a DIY Jewelbots. https://techwillsaveus.com
Secret Codes Kits and Books Scientific Explorer Secret Codes Decoder Kit This kit has fun tools such as invisible ink, while also containing info cards about some ciphers and codes, including Pigpen (which we covered in an earlier issue). https://www. alexbrands.com/product/sciencelearning/science-learning-sciencekits/fun-lab-secret-codes/
Redfern Crumble Starter Kit
Telegraph Kit: The Science Cube We covered Morse Code in an earlier issue, so why not let the kids make their own machine? Definitely a cool gift idea for anyone who wants something physical to engineer. https://www.amazon.com/ Telegraph-Kit-The-Science-Cube/dp/ B0082CRY7A
Secret Decoder Deluxe Activity Set: ON the GO A little less focused on established codes, but has three workbooks which kids can delve into and crack the mystery as they go! https://www.melissaanddoug.com/ secret-decoder-deluxe-activity-set--on-the-go/5238.html
Cracking Codes with Python This book combines two fun experiences: Python, which is easy to code, and secret codes. All kinds of ciphers are covered with details about how to use Python to break them. A fun, engrossing source book for someone interested in solving puzzles with code. https://nostarch.com/crackingcodes
Top Secret: A Handbook of Codes, Ciphers, and Secret Writing This takes a slight turn away from the â&#x20AC;&#x2DC;fun kitsâ&#x20AC;&#x2122;, but it does cover a lot of the codes used throughout history, and gives some test codes to break. https://www.publishersweekly. com/978-0-7636-0971-9
Scientific Explorer Secret Codes Decoder Kit
Secret Decoder Deluxe Activity Set
27
Board Games Some of the best ways to learn about programming are through board and card games. You donâ&#x20AC;&#x2122;t need electricity or a computer. Here are fun games for little kids, bigger kids, and families. Playing these games as a family with younger kids also can help them more quickly understand the games, more than if they were to play the games by themselves.
Robot Turtles Robot Turtles is a great board game with an online community where you can create your own game boards. These games sometimes let you replace the object you direct with a favorite person, adding another level of fun and engagement. http://thinkfun.com/robotturtles/
Code Master
Turing Tumble While not exactly a board game, it is a hands on game that uses the original idea of computers as switches to teach the basic ideas behind computing and programming. https://www.turingtumble.com/
Code Master This single player game, from the makers of Robot Turtles, has 60 levels you work through to learn programming logic. Only one path leads to the crystal and wins the game. http://thinkfun.com/codemaster
Bits and Bytes This card game teaches basic computing skills: logic, problem solving, and critical thinking. The game is absorbing and flexible. No need for a computer. http://bitsandbytes.cards/
littlecodr This deceptively simple card game for kids 4-8 lets them lay out a series of steps for others to follow. When they master the basic game, they can add more advanced cards. http://littlecodr.com/
Giggle Chips A set of creative game cards created by a mom and her young, doodling daughter that teach computer science concepts in a fun, visual way. http://gigglechips.bigcartel.com/
Notable Women in Computing Card Deck
Robot Turtles Board Game
A traditional 52-card deck featuring women who have contributed to technology can be used to play any classic card game. The makers also offer cards with women from the Middle East and Africa, and posters for both sets. Download the poster and cards to print locally! http://notabletechnicalwomen.org/
Bits & Bytes
28 28
Virtual Reality There are several ways to evaluate what virtual reality (VR) headset makes the most sense. If you only want to try out VR, for example, Google Cardboard and Labo VR are comparatively low cost. If you want the full immersive experience, and cost isn’t a concern, then the issue to consider is wireless versus wired.
MAURICIO PESCE, FLICKR
Google Cardboard For $20-$30 USD you can buy a cardboard headset then slide in a modern smartphone and use VR apps. While not as immersive as the HTC Vive, the experience is as amazing as more expensive options. https://vr.google.com/cardboard/
Nintendo Labo VR Kit If you have the Labo kit, which allows you to create all sorts of technology projects, there is a virtual reality kit that can extend the Labo system. It’s more expensive than Google Cardboard but much less than the Oculus Go. The kit is a mix of DIY fun, pass-and-play multiplayer, and family-friendly play with simple, shareable VR gaming. Includes a programming tool to create VR games and experiences. https://labo.nintendo.com/kits/vr-kit/
Oculus Quest and Rift S The Quest is an all-in-one gaming system built for virtual reality. Now you can play almost anywhere with just a VR headset and two controllers. You don’t need a computer or wires. There’s also a decent range of games to play. The Rift S is a new version that requires a powerful computer. https://www.oculus.com/quest/ https://www.oculus.com/rift-s/
Oculus Go The Go is a basic version of the Quest, at a lower price, with similar features but optimized for more than games. There’s one controller, not two. But you don’t need a computer or wires. And the Go has the same or similar sound quality and lenses. https://www.oculus.com/go/
HTC Vive While this is the most elaborate VR setup, the use of base stations to fix your position can provide more space to move around. You’ll also need a powerful computer. At the least, definitely find a Microsoft store with an HTC Vive setup and then try it out. It’s amazing! There’s also the HTC Vive Pro which is expensive but includes high end equipment and features. https://www.vive.com/us/
Playstation VR The Playstation platform has added virtual reality to its games. You need a Playstation 4, but if yours is an older model or you don’t have one and want to buy, the VR version of the platform could be lots of fun. https://www.playstation.com/en-us/explore/ playstation-vr/
Samsung Gear VR
Samsung Gear VR A combination headset with smartphone, like the Google Cardboard, the Samsung Gear VR headset experience is more immersive. A controller also adds to the experience. https://www.samsung.com/global/galaxy/gear-vr/
b
HTC Vive
Raising Problem Solvers Over the summer, as I revisited my 6th grade Computer Science curriculum, I took a few minutes to think about this year’s group of incoming students. Similar to the Beloit College Mindset List, I thought about these eleven year olds, their life experiences, and their futures. Students in this class most likely were born in 2008, which means they have always lived in a world where iPhones, Bitcoin, and Spotify all have existed. As well, if all goes according to plan, these students will graduate college and enter the workforce in the Spring of 2030. Getting a sense of the world they will inherit eleven years from now is a tough task to accomplish, although one thing is certain. This generation will face extreme challenges in their lifetimes. However, some educators are rethinking how the educational system is preparing these 6th graders to meet this future. The age-old model of presenting content, mastering knowledge, and applying concepts has been the pillar on which nearly all modern education has been constructed. It has helped one generation disseminate the worlds of art, science, technology, and humanities to the next generation through a progressive cycle of growth. However, the stark truth is that world of lectures and direct instruction that has served many generations does little to equip students facing uncertain challenges. My incoming 6th-grade students will face a drastically different world in 2030 than the one in which my fellow teachers and I graduated. While teachers of many eras could make this claim, the immense
challenges that this generation will have to solve in their lifetimes dwarf many of the past. From climate change to the proliferation of plastic to the acidification of the ocean, the young people of this world will most likely be inheriting large, existential problems that will require them to think critically and solve large, thorny problems. So, how do teachers prepare tomorrow’s scientists, engineers, poets, and leaders for a future with uncertain challenges? One idea that is gaining traction is the refocusing of curricula on the process of solving open-ended problems. While it is certainly not a new approach, Problem-Based Learning (PBL) is a student-centered model that restructures the normal rhythm of a classroom. Students are given large, realworld problems to solve and through the process of finding a solution, they learn content alongside devising solutions. Rather than acquiring content solely from lectures, books, or apps, students create their own understanding by encountering problems and learning how to solve them. Working in teams with a common goal, they pool knowledge and understanding while repeating the process as many times as necessary. This approach teaches students iterative processes, decomposition, data processing, and resourcefulness among other skills. One proponent of this modern style of education was the philosopher and educator John Dewey. A philosophy professor turned educator, Dewey founded the University of Chicago Laboratory School in 1896 and shaped a whole generation of teachers at Columbia
Teachers College. The quintessential progressive, Dewey was a vocal proponent of first-hand experience in education, and he believed the road to understanding should be anything but smooth. In his masterwork, How We Think (1910), Dewey defined the concept of Reflective Inquiry where the experience of problem solving plays a pivotal role. He believed that “demand for the solution of a perplexity is the steadying and guiding factor in the entire process of reflection.” Through the process of encountering and solving problems, students construct their own understanding and gain a more robust, high-definition knowledge of a subject. In his books, Dewey compared the role of the learner to that of an explorer mapping an unknown territory. As my young students begin a new year, they have a lot in common with Dewey’s explorer. Similar to looking at a blank spot on a map, these students will face future challenges that are difficult to grasp at the moment. Reorienting subjects as diverse as Science and the Humanities towards problem solving could help students think creatively and be resourceful. However, this change is not an easy leap for many teachers to take. The positive news is that organizations such as Harvard University’s Project Zero, the Buck Institute’s PBLWorks and others are engaging teachers world-wide in this venture. Hopefully, many more take on the challenge in the near future. It is one of the best ways we can equip our explorers and give these students the cognitive tools they will need in the 2030s. b
29
Parents and Teachers
BY TIM MCGUIGAN
â&#x20AC;&#x153;To achieve great things, two things are needed: a plan and not quite enough time."
â&#x20AC;&#x201D;Leonard Bernstein
Thank you for reading this issue of beanz ! Check out the links below to read stories from this issue online with links to learn more. Say Hello to My Little Friend! https://beanzmag.com/ botley-coding-robot What Is a Happy Number? https://beanzmag.com/ happy-numbers Roblox https://beanzmag.com/ roblox-studio Not a Birdbrain After All! https://beanzmag.com/ pigeon-hole-principle Totally Spaced Out https://beanzmag.com/ python-turtle-constellation
The Tale of Lorem Ipsum SketchUp a Jack o' Lantern https://beanzmag.com/ https://beanzmag.com/ a-short-history-of-lorem-ipsum sketchup-jack-o-lantern Hello, World! https://beanzmag.com/ hello-world-in-100-languages
How Quick Are You? https://beanzmag.com/ cpx-reaction-game
History of 3D https://beanzmag.com/ 2d-3d-games
A New Dimension in Space Travel https://beanzmag.com/ 3d-in-space
Just Your Type https://beanzmag.com/ types-untyped-languages Searching for Closure https://beanzmag.com/ closures Please Pass the Salt! https://beanzmag.com/ hash-salt-passwords
STEAM Gift Guide 2019 https://beanzmag.com/ steam-gift-guide-2019 Raising Problem Solvers https://beanzmag.com/ raise-problem-solvers ribe! Subsc
https://beanzmag.com/subscribe