Page 1

Kids, Code, and Computer Science 3D Printing You Can Wear!

n i a r B e u l B e t Th c e j o r P How t u O ing r u rks g o i F W n ggi o N r You

February 2018

$6.00 $6.00 USD

The Challenge of PyWeek

Going To the Dogs With WoofJS


beanz magazine February 2018 : Volume 5 Issue 4 Issue 34 (online) & 19 (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

Publisher’s Note Have you ever put on a play with family or friends? Creating this magazine is a lot like performing a play. We put together all the stories, as best we can, to create a one-time unique experience for readers. Each issue is a new performance! In this issue, for example, you can read about someone who wondered what the sun sounds like. He used sound to convey satellite data about the sun and learned the sun changes its tune before solar flares explode from its surface. The new tune? The sound of carbon, an element scientists who study solar flares had not discovered was involved in flares. This issue has lots of other discoveries for readers. There’s 3D printing jewelry, Morse code, Minecraft, Scratch, coding tic-tac-toe, creating an improved Operation game, Sphero, and Sketchup. You’ll also find an article about the Blue Brain Project, an attempt to create a computer model of a mouse brain, down to every last neuron. The model is used to learn how mouse brains work. The project also helps scientists learn how to build faster, better computers. There’s also a new animal in our zoo you can try to find, a smiley alligator! Hope you enjoy reading this issue and discover how people use technology in neat ways like listening to the sun. Be sure to try a few projects, too!

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. Flickr images are copyright their creators, as noted with each story both online and in print. Publisher/Editor/Webmaster: Tim Slavin Staff Writers: Simon Batt, Patricia Foster, Bonnie Roskes, Clarissa Littler, Jennifer Newell, Les Pounder, Paul Seal, Erin Winnick, Tim Slavin Contributors: David Dodge, Jay Silver, Jeremy Kubica, Colleen Graves, Daniel Fenjves, Ali Hagen, Emeline Swanson, Jean-Francois Nguyen, Madeleine Slavin, Tim McGuigan Back Office Magic: Wendy Garrison Copy Editors: Madeleine Slavin, Derek Lanuto Art Director: Kelley Lanuto Webmistress: Patricia Foster COVER IMAGE: JACKIE FINN-IRWIN, FLICKR

Tim Slavin Publisher beanz Magazine

beanz magazine (as Kids, Code, and Computer Science magazine, our earlier title) is a winner

Our Mission

of Parents’ Choice, Tillywig, and Academics’ Choice awards: http://beanzmag.com/awards

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.


February 2018

2 4 6 9 10 12 14

Make It Cover Story Creating Jewelry With 3D Printing Secret Codes dits and dahs Notebook Cover Story PyWeek Scratch Cover Story Going to the Dogs

24 tidbitz 25 Is Your Moon out Tonight?

25 Shaping Poems with Code 25 Brothers from Different Mothers???

JOAN DRAGONFLY, FLICKR

Robotics A Brave New World

Electronics Operation: Hack!

History What Time Is It?

Show and Tell Listen!

26

Notebook Hello Muddah, Hello Faddah!

15 16 19 20 22

Minecraft Taking Your Game Online SketchUp Thinking Outside the Box Languages Meet Julia History Cover Story Blue Brain Project Coding Modeling Tic-Tac-Toe

28

ParentTeacher Corner Resisting the Silo: Cognitive Skills in the STEM Classroom

contents

advanced

intermediate

beginner

scribe b u s / m ag.co m z n a e b http://


Show and Tell

2

! n e t s i L

BY AMY S. HANSEN

to g n i n Liste

Hmmmm. Hmmmm. Hmmmm. That’s the sound of the sun. Okay, the sun isn’t really making any noise that we can hear. Sound cannot travel across space. But that humming is the satellites’ data translated into sound. So now, scientists studying the sun can just listen. What they hear is mostly static, or humming. But every now and then, something changes. And for sonification experts, like Robert Alexander, that change is music to their ears. Sonification is the use of sound —or non-speech audio—to convey data. Wait, what? No, it’s not a new science, it is just a different way of presenting science. You already know about sonification. A heart monitor in a hospital keeps track of someone’s pulse. As long as doctors and nurses hear the ping, ping, ping, all is well. When it changes, they know something is wrong. Likewise, a Geiger counter clicks when it is near radiation. Robert Alexander is one of a hundred or so experts in the field of sonification. “I turn data into sounds,” he explained. While he was at the University of Michigan, he took the satellite data for the Sun and dumped that data into a computer program to make

ses s a p By n o i t ca fi i n o :S a t a D

it audible. "I was sitting in a coffee shop in Ann Arbor listening to this sonified data for the first time. I hit play and I heard an underlying hum, and there seemed to be a structure. The hum would rise and fall. It was amazing!” he said. He went back and checked the numbers, and realized that the pattern matched the 27 days it takes for the sun to spin. After finding this baseline, he listened harder. He found he could separate out the sound of individual gases and elements. He could hear the solar flares. Alexander, who is also a composer, worked with scientists who study the sun. The scientists wanted to have another way of studying their data, and they wanted to use sonification. So Alexander’s goal was to make a kind of celestial soundtrack. What he ended up with was a discovery. Alexander realized he heard the same sound just before each solar flare. He could identify that sound as the element carbon. However, none of the scientists who studied solar flares talked about carbon. They checked it out and indeed, carbon is important. It is an excellent indicator of where the solar wind originates on the surface of the sun.

This was something no one knew before! While this detail may not seem newsworthy, remember that many people had looked at the data before Alexander. To find something new is impressive! And that is one of the main concepts of sonification: we hear data differently than we see it. Sometimes that means we learn new things. Alexander has found he often does. Sonification also is helpful for people who are blind or visually impaired. It can be useful in teaching for people who have different learning styles, like people who learn better by hearing things instead of seeing them. While sonification is very useful, it does require training. Since Alexander is a composer, working with sounds came naturally. But Alexander had to spend time learning what solar wind sounded like. Then once he understood what was normal, he could listen for changes. “It’s about using your ear to pick out subtle differences,” he said. b


3

yes E e h t

IAN T. MCFARLAND, FLICKR


Robotics

4

BY JENNIFER NEWELL

Robots come in all shapes and sizes. Some have legs, others wheels, and yet others are stationary. But have you ever seen a spherical robot? In other words a ball that rolls on command? Sphero is precisely that. Why a Robotic Ball?

The idea of a robotic ball is fun. Most of us have seen cars controlled by remotes, and even drones being tested out at parks and other public spaces. In comparison, a ball seems mundane. But perhaps because of the familiarity of its shape, Sphero’s ability to move on command makes it as least as much of a novelty. Imagine climbing atop a play structure at the local park with a mobile phone hidden in your hand and Sphero on the ground below. A young child comes up to investigate in mysterious ball, and you push “Start”. To the child’s surprise, the ball rolls off, as if deciding on its own to make a run for it!

Even better than Sphero’s ability to roll off with the press of a button is its ability to be programmed. The makers of Sphero created a coding environment called Lightning Labs, in which blocks of code can be clicked together (or JavaScript can be written) to change the way the ball rolls. If you want Sphero to roll off in a straight line for 10 seconds, shining a purple light as it goes, you can write a simple program such as that shown below:

With a tap on the screen, you can see the same code written in JavaScript:

Or maybe you want sphero to roll off in a zigzag pattern. That can be done as well:

A Brave New World


5

Again, with just one click, we can view and edit this code in JavaScript as well:

Sphero can accelerate as it goes, stop and start again, make a variety of fun noises, and even perform some fancy calculations. Spherical Fun Facts

The science of the spherical shape is something to consider. Because all of the electronics, including its power source, are permanently sealed in a sphere, it is recharged through electrical induction via usb. In the transparent SPRK+ ball, all of the electronic and mechanical parts can be seen, giving it a super technical appearance. And because of a trusty seal and a good deal of air inside the sphere, Sphero floats and swims unharmed in water. By writing a quick program with the power set high, Sphero can take a swim in a lake or pool, or even splash around safely at the beach (but watch out for tides that might sweep it away). Resilient Robot

Sphero can be buried in wet sand, tossed into the pool, or rolled through the sand or snow just as well as it can roll across

your living room floor. As such, it is one of the most outdoor-friendly, household or classroom, robots available. A rough tumble onto a hard surface could crack the outer case, but otherwise Sphero is one tough robot that can be enjoyed as a toy just as well as a physical programming tool. b


BY LES POUNDER

Electronics

6

You'll Need: • • • • • • •

! k c a H

Operation:

A microbit Micro USB lead to connect micro:bit to computer An LED 6 x Crocodile Clips A 3.5mm Powered Speaker Metal Tweezers An Operation board game

In this project we'll reuse an old Operation board game, a game that was first sold in 1965. Look for this game in thrift stores or yard sales. Your parents may even have an old one! The game focuses on removing items from a patient using metal tweezers. These tweezers are connected to a battery and carry 3V of electricity (2xAA batteries). The “surgeon” has to be careful, because surrounding the “wounds” are metal frames connected to a circuit. If the surgeon touches the metal with the tweezers the circuit is completed and the buzzer goes off, which lights up the nose. This is fun, but we can make it even better! Using a micro:bit, we'll replace the buzzer with synthesized speech, and give the patient a new LED nose. We'll use crocodile clips to make our circuit, and we'll code the project using micro Python, a form of Python 3 for microcontrollers such as the micro:bit. This project is non-destructive, so our game can return to its pre-hacked state. We'll cover these concepts: • Importing libraries of pre-written code. • Using loops to repeat code indefinitely, and for a predetermined number of times.

• Synthesizing speech. • Using conditional logic. • Converting integers to strings.

connection goes to Pin 0 on the micro:bit, and the base of the connection goes to GND on the micro:bit.

Getting Started

Our first task is to connect the LED to the micro:bit. We'll need two crocodile clips and the LED. Connect the short leg of the LED to the GND pin of the micro:bit, and the long leg of the LED to Pin 1, using the crocodile clips. The crocodile clips for Pin 1 and GND must not touch each other, so tape around the Pin 1 crocodile clip. Then use modeling clay to secure the LED to the “nose” of the patient.

Our Operation game board is connected to Pin 2 of the micro:bit and we shall use this pin as an input later in our code.

Our last hardware connection is to connect our tweezers to the 3V pin on the micro:bit. Tidy up the wires so our game looks neat. Next, we write the code. Writing the Code

In order to hear the synthesized voice generated from the micro:bit, we need to connect our powered speaker using crocodile clips. The tip of the 3.5mm headphone

To code the micro:bit we used micro Python using the Mu editor. You can download a copy of Mu for your operating system by following the instructions on their website https://codewith.mu/ In Mu, start the code by importing two libraries of prewritten Python code. These are the


7 The code for this project and a high resolution circuit diagram can be found at https://github.com/lesp/Beanz-microbit-operation/archive/master.zip

micro:bit library, used to interface with the board, and the speech library, used to generate the synthesized speech. Add this code: from microbit import * import speech Next, create a variable called “lives” which will contain the number of lives our surgeon will have. In this case we set the value to 3, an integer (a number with no decimal point). Add this code: lives = 3 For our game to run continuously we need to use a loop that will run forever, and in Python this is called “while True.” Add this code: while True

You will now notice that the code inside the loop is indented. This is how Python identifies that the code belongs inside the loop. Typically indentation is either four spaces or one TAB key press, but never mix them up as it will cause errors. Inside the loop we have two lines, one which will scroll the number of lives that our surgeon has across the LED matrix on the front of our micro:bit. The second line will use speech synthesis to speak the information. The “speech. say” function can speak any string of text, but in order to join (concatenate) the number of lives stored in the “lives” variable into a sentence, we need to convert them from an integer to a string (str). Add

this code: display.scroll("You have "+str(lives)+" lives") speech.say("You have "+str(lives)+" lives to operate on the patient. Good luck") In order for our surgeon to have three attempts at removing the troublesome objects in the patient we need to create a loop that will only loop while the surgeon has more than zero lives. As we know from any video game, if you have zero lives, it’s game over! So this loop will continue as long as the variable “lives” contains an integer greater than 0. Add this code: while lives > 0: As we have created another loop, our Python code is indented once again to show that it belongs inside this new loop. We have created a loop within a loop, a nested loop. The first line inside this CONTINUED, NEXT PAGE

For info on Micro:bit go to https://microbit.org/resellers


8

CONTINUED FROM PREVIOUS PAGE

new loop is to write a conditional test. This will check the value of Pin 2. (Remember that is the pin connected to the patient on the operating table.) The default value of this pin is 0, so no power/current is flowing through it (Off). If we touch the metal with our tweezers, which are connected to 3V, then Pin 2 will receive 3V of power and it will change its value to 1, meaning “On”. If Pin2 is turned on (==1) then the code contained in the conditional test will run. Add the code: if pin2.read_digital() == 1 The code indents again, to show that this is the code which will run if the conditional test is proven to be True. In other words, if the surgeon touches the metal around the patient's wounds. The LED matrix on the micro:bit will show an angry face, as we have just hurt the patient! Then we'll turn on Pin 1 which is attached to the LED (our patient's nose). Next we'll use speech synthesis to have the micro:bit say “OUCH!”. We then pause for 200ms (1/5 of a second). Add the following code: display.show(Image.ANGRY) pin1.write_digital(1) speech.say("Ouch!") sleep(200) Still inside the conditional test, and still writing the code for when our surgeon hurts the patient, we now need to deduct a life from the surgeon. Now our “lives” variable is updated to deduct one life from the current value of the variable. We then use speech to tell the player how many lives they have left. We then turn off the LED connected at Pin 1, resetting the game for the next attempt, and reset the connection at Pin 2 so that our surgeon can try again. Add the following code: lives = lives -1 speech.say("You have "+str(lives)+" lives left.") pin1.write_digital(0)

Now write a second conditional test, but this time the test will be called “else”. This test will run when the surgeon has not touched the metal around the patient's wounds. In this case it will show a happy face on the micro:bit’s LED matrix. Add the following code: else: display.show(Image.HAPPY) We now come out of the conditional test, and the “while lives > 0” loop. Our code is still inside the main “while True:” loop, which means it is indented by four spaces from the left of the screen. This code will run when the surgeon loses all his or her lives. The micro:bit will speak “GAME OVER”, and then reset the “lives” variable to 3, giving the next player a chance to save the patient. Add the following code: speech.say("GAME OVER") lives = 3 That’s it! We have written the code that will control our game.

Test the Game

To test the game, write this code to the micro:bit. Plug in your micro:bit to your computer using the micro USB to USB lead. It will appear as a USB flash drive. In the Mu application click on “Flash” to write the code to the micro:bit. If you look at the micro:bit you will see a flashing yellow light on the back of the board. This means the information is being written. Once it stops flashing, the micro:bit will reset and your code will run! How Can We Take This Further?

The code for this project can also be used to create a buzz wire game, where the player must navigate a twisty maze of wire with a wand. If the wand touches the wire, a buzzer goes off. You need some stiff wire (a metal coat hanger is ideal), some modelling clay, and a study frame to hold the wires (cardboard is ideal but you can also use a piece of wood with holes drilled into it). b

display.show(Image.ANGRY) pin1.write_digital(1) //CODE PYTHON// speech.say("Ouch!") from microbit import * sleep(200) import speech lives = lives -1 lives = 3 speech.say("You have while True: "+str(lives)+" lives left.") display.scroll("You have pin1.write_digital(0) "+str(lives)+" lives") pin2.write_digital(0) speech.say("You have else: "+str(lives)+" lives to operate on display.show(Image.HAPPY) the patient. Good luck") speech.say("GAME OVER") while lives > 0: lives = 3 if pin2.read_digital() == 1: //CODE END// Here is the code for this project:

Our circuit is relatively simple to build. Just take each connection step-by-step.

b


Creating Jewelry Printing With I have always loved making things. I’ve built LEGO towers, folded origami dragons and sewn Hermione’s robes from Harry Potter. My love for making things inspired me to major in mechanical engineering in college. While in college I learned how to apply my love of making to everything from creating robots to creating tractor parts. My personal favorite technology is 3D printing. This technology allows us to create a 3D model of something on a computer, and just a short time later, produce that thing in real life. 3D printing is a new manufacturing tool that can be used by everyone: big companies making parts for airplanes, or you at home making a birthday gift for your friend. Being able to so quickly and easily hold the thing in my hand that I made in the digital world

fascinated me. So much so that I bought my own 3D printer with the money I earned from my summer engineering internship job. While learning to use my own printer, I found a way to combine my interests in fashion and technology by creating 3D printed jewelry. Plastic jewelry is perfect for making on a 3D printer because of its size and bright colors. Most desktop 3D printers use something called filament to create items. Filament comes in a huge range of colors and styles, letting you choose to make your jewelry anything from hot pink to glow-inthe-dark! 3D printing really lets you unleash your creativity and create jewelry inspired by anything. One of my first creations was a 3D printed necklace pendant shaped

9

Make It

BY ERIN WINNICK

like Bohr’s model of an atom. I was able to print small and large versions of it to match whatever style I was feeling that day. This experience inspired me to create my own company that creates 3D printed science and engineering inspired jewelry, Sci Chic. One of our first jewelry items for sale was that atom necklace! Want to try to create your own custom jewelry using 3D printing? Try out TinkerCad. Also, check out KiraKira for some great online classes on 3D modeling jewelry. After you create your model, if you don’t have access to your own 3D printer, with a parent, go to Shapeways to order your model 3D printed in the plastic of the color of your choice. b is cool How k out c e Ch this? the nk on the li r of cove back or sue f this is info! more


d n a s t di s h da

BY SIMON BATT

CHRIS PENNY, FLICKR

Secret Codes

10

For the past few issues, we’ve been exploring simple ciphers and breaking down how they’re created. Now that we’re all smartened up on how codes are made, it’s time we took a look at a real-world example that made a big splash in the history books: Morse Code. Despite its name, Morse Code

JOE HAUPT, FLICKR

Key

Example A

Example B

wasn’t designed to hide secret messages. It was invented by Samuel Morse in 1836, after whom the code is named. Back then, they were still figuring out how to convey messages via electrical charges. These days, we have the technology to convert charges into phone calls, but they didn’t have that luxury back then! What did they have? They could determine whether or not the electrical charge was there. If it was there, they could record how long the charge was there. It may sound very basic to you, but this new system was very revolutionary at the time! In 1844, Samuel Morse successfully transmitted the message “What hath God wrought” from Washington to Baltimore using this method. This lead to a new communications revolution throughout the US, where

lightning-fast communication spread across the country. It was so effective, the trustworthy Pony Express soon became redundant in the face of the new technology. Morse Code turns electrical charges into a decipherable message. The way this was done was translating short and long charges (or ‘dits’ and ‘dahs’ respectively) into letters. Each letter in the alphabet is assigned to a specific combination of dits and dahs. When you want to ‘type’ a letter, you do so by sending the correct number of dits and dahs as dictated. The key, lower left, shows how each letter is typed. A dot signals a dit, and a dash indicates a dah: You may recognize that this is very similar to the Pigpen cipher we covered in the October 2017 issue. We're taking the existing alphabet and assigning letters to special symbols. But this code was developed so the letters could be sent across telegraph wires, and to clearly communicate a message, not to confuse an eavesdropper. When all letters consist of several dots and dashes, things can get confusing. If you received a message with four dots, it could be four Es, two Ds, or a single H. As such, timing was key to make sure each letter got through correctly. After each letter, the sender would add a pause


11

Who Is This Guy?

Samuel F.B.Morse in 1840

RICHARD, FLICKR

smarts, Samuel would go on to develop a way to transmit messages via telegraph, as well as his code that made the messages possible. The original telegraph that Samuel invented, as well as his patent for it, can still be seen today in the Smithsonian Institution. b

American soldiers learning to use morse code, circa 1942 Morse Message answer: UNDER THE CARPET IN THE STUDY ANSWERS: WHERE IS THE KEY:

of three dots to show the letter has ended. After each word, they waited for seven dots. This made sure the message got through without letters being scrambled. Let’s create some morse code ourselves. Let’s say you and your friend have a locked box where you keep all your cool, secret stuff, and you frequently hide the key in a spot where both of you can get it. However, one day your friend hides the key and you don’t know where it is. You decide to write a message in Morse code to your friend, because while it wasn’t designed for secrecy, it’s still quite hard to read! Let’s send the message “WHERE IS THE KEY”. How would you assemble your Morse code so you can relay this to your friend? Don’t worry, you don’t need a Morse code transmitter to make your code. You can write down the dashes and dots you’d use in your code using the key. Put a space to represent a three-dot wait between each letter, and a slash (/) for each seven-dot wait between each word. For example, “I LIKE CAKE” is written like this (see example A, lower left). You get a message back from your friend that reads like this (see example B, lower left). Where is the key located? Translate the code back into English and find out the location! b

Samuel F.B. Morse was born on April 27, 1791 and died on April 2, 1872. Despite making one of the most famous codes in history, he didn’t start his life as an inventor! He started off as a painter. A wide variety of his paintings can still be seen at the Locust Grove house in New York, where he used to live. One day, while he was painting, he received a horsedelivered telegram from his father that stated that Samuel’s wife was recovering from an illness. The next day, however, another telegram arrived announcing her death. By the time Samuel had travelled to where his wife lived, her funeral had already taken place. Samuel was very sad that he was kept in the dark for so long about his wife’s illness and death, and decided to invent a way to transfer messages faster. With the help of the research of others alongside his own


Notebook

12

BY CLARISSA LITTLER

Check out th e link cover on the of this back issue fo r more info!

In August, as I was looking into game development engines that would be good for teaching programming, I remembered the existence of PyGame: Python's oldest and most mature library for writing games. After looking into PyGame for the first time in years, I discovered that not only was it still well-maintained and active, but that a game-making competition, a game jam, was coming up soon: the 24th PyWeek. I thought, "This is perfect! This’ll make me learn PyGame and actually finish a game for the first time in seven years." Once I actually wanted to be an indie game developer. I became a researcher and teacher instead, but there's always been a part of me that missed working on games. Maybe this would get me back into the swing of things. And, back in the day, I cut my teeth on a library called Simple DirectMedia Layer (SDL), which is what PyGame is based on! One thing to know is that PyGame isn't like Unity or Godot or GameMaker—there's no integrated development environment, tools for animation, or built-in physics. That definitely makes some things a lot more complicated! On the other hand, if you're someone who likes knowing how everything ticks, then I think something like SDL or PyGame is a very satisfying experience. You'll learn a lot about game engines. October 14th arrived and the

PyWeek theme is announced: "They're Behind Everything!". I had until the evening of October 21st to write a game based on that concept and turn it in. I planned out a design for a small game that's stripped down to very basic mechanics. It's a weird little story about endlessly reborn universes, created by beings searching for immortality. Little did I realize that even the few pages of design document I wrote would still be too ambitious for the time available. A week seems like a long time, but when you have school or a job, it goes fast. I did the thing I always advise students working on projects to do: start each day by writing out what you hope to get done by the end of the day. Doing that probably helped me get as much done as I could. I had also decided to try making my own art and music. I started with the music, using BeepBox to make small tracks. BeepBox is a great site that lets you make chiptuneslike songs. Here's an example of a background music piece I wrote: http://bit.ly/2y70lLa. Simple for sure, but good enough as incidental music. And here's a boss fight song that was meant to be messy and dissonant. http://bit.ly/2ySkZ0U I hadn't actually tried writing songs since I was a kid, but BeepBox made it really easy to start experimenting. On the coding front, I worked on making a small game engine that

PyWeek would resemble old role-playing games from the NES era: lots of menus with small turn-based battles. I started by figuring out how to make the pieces work, like menu systems, dialogue boxes, and combat. Unfortunately, I didn't get very far! By Friday night I was still getting game engine basics in place and I'd run out of time to do my own art! So instead, I took Friday night and Saturday before the deadline to put something together. I ended up cutting out a lot more than I put in: maze-like areas, complicated storytelling based on the order bosses were fought, a variety of moves in combat. I did end up making something with a beginning, middle, and end: https://pyweek.org/e/SoSorry/. My first temptation was to feel disappointed with my progress, but I realized something: this wasn't like the Olympics, it was like NaNoWriMo! The entire point is to get yourself working on something that you might not have done otherwise, to force you to stop sitting on game ideas like I had been and actually try making them. Did I make the game I wanted? Not really. Did I learn a ton and start building the foundation of a game I really want to finish? Definitely! By the time you're reading this, there's another PyWeek just around the corner. If you have any interest in Python or games writing, I absolutely recommend entering and seeing what you can make! b


13

ALEJANDRO J. CURA, FLICKR

MALCOLM TREDENNICK, FLICKR

ALEJANDRO J. CURA, FLICKR

Top: Clarissa's game concept, Above: the BeepBox interface, Left: a successful PyWeek game by Richard Jones, Below: scenes from PyWeek


Scratch

14

BY CLARISSA LITTLER

Going to the Dogs

The difference is where you make them. If you make them inside a function, they can only be seen inside a function. This is like making a variable visible only to a particular sprite. Loops

Looking for a general purpose programming language other than Scratch, or the next step beyond Scratch for a programmer? Look at http://woofjs.com. WoofJS is the name of the framework (dog-themed in reference to the cat mascot of Scratch). It was written by educators wanting to help students transition from Scratch to JavaScript. Go to the site and click on Start Coding, and you'll see this: TRCIA, FLICKR

which will likely look familiar! If you click on all of the blocks under "Documentation", you'll see how Scratch blocks, such as move 10 steps or set pen color to, are done in JavaScript with their library. Many Scratch blocks translate directly to a single line of JavaScript code in WoofJS. Some things that don't translate directly, like the color _ is touching _? block. One difference is that there's no message passing in JavaScript. The way different pieces of a JavaScript program communicate with each other is through function calls, which exist in Scratch but are greatly deemphasized from their place in most programming languages. There are also tutorial games. Variables

In Scratch, you make a variable from the variable menu and choose whether it can be seen by everyone or just by a particular sprite. In JavaScript, you make a variable by saying var level = 10 or var name = Bert. Most variables can be seen by everyone.

In Scratch you can do something n times with the repeat block. In JavaScript, it's for loop. In Scratch you can repeat an action until something changes with the repeat-until block and do something forever with the forever block. In JavaScript, these both become while loops. In Scratch, each sprite can have multiple forever blocks happening at the same time. You can have a forever that's handling your sprite moving, and another loop that's counting how many times the character has gotten hit, and so on. But for JavaScript, think of the code as one giant Scratch block that is running from the top of the code down to the bottom. If you write a while loop in JavaScript that runs forever, none of the code that comes after it will be seen! Functions and messages:

In Scratch, you rely on messages in order to make things happen. There really isn't anything like messages in JavaScript for the same reason you can't run multiple while loops in JavaScript: all your code is running linearly from the top of the code down. JavaScript does not have multiple agents, or multiple blocks of code, running at the same time. In JavaScript you control how code runs with functions. Functions in JavaScript are basically custom blocks from Scratch, but while you can do an awful lot in Scratch without making custom blocks, functions are absolutely one of the key building blocks in JavaScript. For more on woof.js and how to move from Scratch to JavaScript, check out the link on the back cover of this issue. Happy hacking! b

For info on Scratch go to https://scratch.mit.edu


For info on Minecraft go to https://minecraft.net

Taking Your Game Online In past issues, we’ve shown how to get Minecraft, make some tools, and take on some nasty monsters. If you want to share your adventures with others now that you’re up to speed with the base game, take your skills online. Minecraft has the ability to connect to servers around the world so that players can play on the same realm with one another. These servers focus on different things, from building servers to

player versus player (PVP)-oriented combat servers. Whether you’re an avid builder or a keen fighter, there’s a server for everyone. If you go to the main menu of Minecraft, you’ll find a Multiplayer button. Click on it, and it’ll begin looking for local servers. Local servers are servers created on the same network that you’re on right now. Unless someone on your local server also plays Minecraft, it's likely nothing will appear here. If you want to play with people around the world, you can do so by looking up a Minecraft server on a server list. This isn’t something that Minecraft provides, so you’re going to need to do some research. If you follow any Minecraft players

or communities online, check to see if they have a server set up for fans. Otherwise, look online at the servers on offer. Lots of sites list servers, such as TopG’s server list. When browsing, you’re looking for a server that suits your needs best. If you’re ready for a fight, look for a server tagged with “PVP”, “Arena”, or “Survival Game”. These servers will have combat heavy gameplay, with their own individual differences. Some will be simple fighting arenas, and others might mimic the arenas found in The Hunger Games books and movies. There are plenty of servers for builders, too. Look for servers that advertise building protection, so you can create to your heart’s content. If you’d like a challenge, a skyblock server tests your ingenuity by having everyone start on a tiny island floating in empty space. Use the scarce resources to expand, build, and thrive; but don’t fall off! If you’re going online, why not change your skin? There are many ways to get a skin, such as on Planet Minecraft’s skins section, which contains a way to search for the ideal one for you. Once you’ve found a skin you like, go to https:// minecraft.net/ profile and upload it. If you’re feeling creative, you can download the base model for the skin at https://help. mojang.com/ customer/

portal/articles/979200?ref=profile and customize your own. If you want to make your own server to play with your friends, but you don’t want to make a local server, you can set up your

computer to become a server. Or, consider Minecraft Realms, Mojang’s way of allowing people to rent out servers for a small monthly fee, so you don’t need to set anything up. Your friends don’t pay anything, so this is a great way to get them all online. Be careful when you’re going online! While there are a lot of people on servers who want to have a good time and help others, there are also those who want to cause trouble. Join friendly servers that are set up to protect you from harm. Also, NEVER give out any personal information to someone online, no matter how trustworthy they seem. b

BACKGROUND: MIKE PROSSER, FLICKR; INSET PHOTOS BY KEVIN JARRETT, FLICKR

15

Minecraft

BY SIMON BATT


SketchUp

16

BY BONNIE ROSKES

Thinking Outside the Box SketchUp is a free and fun program for 3D modeling. You can use SketchUp to design just about anything, from furniture to an entire city. For this project we'll model a box of cereal. There is a downloadable version called SketchUp Make, which you can get at www.sketchup.com. They also have a web-based version which works in your Internet browser, called my.sketchup, at www. my.sketchup.com. All you need for this project is a photo or two of the box you want to model. You also need its measurements. The left image shows the front and top of the box, and the right image shows the side.

If you use your own photos, save them in a folder you’ll remember. If you want to download photos, right-click on them and use one of the saving options. My cereal box measures 13” tall, 9 1/2” wide, and 2 5/8” deep. Let’s get this data in my.sketchup! First, make sure you're starting out with the correct units (inches). Click the Folder icon at the top left and choose New.

Choose the units template you want. I’m choosing “Feet and Inches.” The file opens, with Josh there. We don’t need him, so use the Eraser to

get rid of him.

Now we’ll start on the box, using its measurements. Start with the Rectangle tool (shortcut: R, or use the icon). To start the rectangle, click the origin—the point where the red, green, and blue axes meet. Release the mouse button (no dragging!), then move the mouse to where you think the other corner should be. Make one side longer than the other side. Click to complete the rectangle or just leave it as a preview.

This is when we make the rectangle the correct size. Look in the Dimensions field in the lower right corner. You’ll see two numbers: one larger than the other. What my rectangle should measure is 9 1/2” in the longer direction, and 2 5/8" in the shorter direction The shorter dimension is listed first (about 1’-1”) and the longer dimension listed second (about 2’-5”).

To keep the long and short directions the same, enter the short length first, then a comma, then the long length. SketchUp provides several ways for entering measurements. Here, I’m typing 2 5/8, 9.5. But I could also enter 2.625, 9 1/2. I don’t have to type the “ symbol, because the model units are already inches.

This is important: when you need to enter numbers in SketchUp, you never have to click in the Dimensions field. (In fact, if you do click in this field, you’ll end whatever operation you’re working on.) So just type, and the numbers will appear. Then press Enter. Now my first rectangle— the base of the cereal box—is exactly right. The next step is to pull up this rectangle to complete the box. This is done with the Push/Pull tool (shortcut: P) To pull up, click the rectangle, don’t keep the mouse button pressed, and move the mouse up. Like before, you can click to complete the pull at any height, or just leave it.

The box height should be 13”. So type 13 (or type 1’1) and press Enter. Now we have our blank cereal box, and we’re ready to "paint" it with the photos. I’ll paint the front first, using the photo that shows both the front and top of the box. Click the same folder icon we used before, and choose Insert.

Click the computer icon to browse for the photo. Browse to find your photo and click Open or press Enter.


There are two ways to insert a photo: as an image (a stand-alone, painted rectangle), or as a material. We want to directly paint a face with this photo, so choose Material.

The photo will attach to the cursor. Click anywhere on the front face of the box to start the material placement. Remember, don’t keep the mouse button pressed.

Move the mouse to size the photo to take up most of the face. We’ll fix the exact size later.

Here’s what you’ll likely see: a set of four pins surrounding one image, and each pin a different color.

These are “fixed pins,” which are useful for repeating materials like stone or brick, but not for a photo like this. Right-click on the face again, and choose Fixed Pins, in order to turn those off. They’ll be replaced with “Free Pins” - four identical white pins. One by one, click each pin to “lift” it off the image, and drop each pin at one corner of the box in the photo. The little circle at the lower left of each pin is the point you want to match to the photo.

the same photo, I’m going to start with the photo that’s already positioned on the front face. To “sample” the positioned photo, open the Paint fly-out icon and click the eyedropper. Click the painted front face to pick up its material, then click the top face to paint it with the same photo. Where the two faces meet, the photo is already positioned correctly. But the top of the photo needs some adjusting. Enter texture positioning like we did before, and this time the two lower pins are already in place.

So move the higher two pins into place on the photo. As soon as you click the second corner to complete the material placement, the photo gets painted onto the face. And it tiles—it repeats left to right, up and down.

To fix the photo to match the front of the box, right-click on the face and choose Texture / Position.

Click and drag each free pin to the correct corner of the box. To adjust your photo’s position, click to move a pin slightly, then drag it again. When it's good, right-click again and choose Done. This ends the texture positioning for the front face. Looks good so far. The photo I used just now also shows the top of the box. Rather than painting that face from scratch with

Then drag those pins into place.

Right-click and choose Done, and now two faces are painted. For the side face, I’m inserting the other photo and positioning it into place.

CONTINUED, NEXT PAGE

17


18

SketchUp in the “Real” World SketchUp and similar drawing and modeling programs are used by architects, package designers, film makers, stage designers, urban planners…almost anyone whose job it is to create a product. Whether that product is a golf course, a train station, or a video game, tools like SketchUp help professionals visualize what the final products will look like. These tools make their jobs much easier and can also help them see potential problems while it's still easy to fix them.

CONTINUED FROM PREVIOUS PAGE

What about the back face? I don’t have a picture of the back, but I can copy the front face to the back. Use the eyedropper to sample the front photo and click the back face to paint the same image, which comes out backwards.

CHARLES STRAWTER, FLICKR

This flips the photo to face the right way, but it’s probably moved out of position. This is another easy fix.

The pins are already in the right spots on the photo. But instead of dragging each pin to its corner, just drag to slide the entire image over to fit its rectangle

CREATIVE TOOLS, FLICKR

AARON AND CAROL, FLICKR

Not to worry, this is an easy fix. Right-click on the backward photo to position it, then right-click again and choose Flip/Left/Right.

Right-click and choose Done, and there you go! Try this technique with any sort of box you can find. You can even use the Free-Pin positioning to create a TV screen, or even an aquarium! b


Julia is a general purpose language, popular with people who are doing scientific computing, AI, data science, and complex systems theory. Julia's main strength is doing calculations fast. Better performance, but as easy as Python. Let's start by comparing the Python and Julia implementations of my favorite way of calculating pi. The method is described well at this very 1990's looking website here: http://mathfaculty.fullerton.edu/ mathews/n2003/montecarlopimod. html . This is an example of a common technique in scientific computing: the monte carlo method. If you're interested in physics, you're definitely going to come across this again! The basic idea? Calculate pi by using a square with a circle inside it, and then choosing random points, like throwing darts. If you take the number of darts that land inside the circle divided by the number of darts you threw then this is going to be equal to pi/4 . The very simple no-attemptto-be-fast implementation of this algorithm in Python is import random numTimes = 10000000 hits = 0 for i in range(numTimes): x = random.random() - 0.5 y = random.random() - 0.5 if (x**2 + y**2) <= 0.25: hits = hits + 1 print("pi is approximately: ", 4*hits/ numTimes) In Julia it looks like: hits = 0 numTimes = 10000000 for i in 0:numTimes

x = rand()-0.5 y = rand()-0.5 if (x^2 + y^2 <= 0.25) hits = hits + 1 end end @printf("pi is approximately: %f\n",(4 * hits / numTimes)) You can see that the syntax is almost the same between the two languages. Julia requires end after if and for, but doesn't require the : at the start of an indented block. Julia's ranges are slightly different looking than Python's ranges, with the range range(0,numTimes) written most naturally as 0:numTimes in Julia. What about the timing? Timing the Python version I get that pi is approximately: 3.1422708 real 0m7.817s and for the Julia version pi is approximately: 3.141588 real 0m2.005s So Julia is faster. For Python 100 million iterations gives us a program that runs in about 1m15s. For Julia, it took roughly 14s to finish. This gives us evidence that rewriting Python programs in Julia might make them run a lot more efficiently while still being very simple to write. While in a sense there's no such thing as a fast language or a slow language, just a fast implementation or slow implementation, it does make a big difference if the easy-to-use standard implementation for one language produces significantly more efficient code than the standard implementation of another. In the line @printf "pi is approximately: %f\n" (4 * hits / numTimes), the @ is used because printf isn't an ordinary function but a macro!

A macro is code that writes code. Macros take in code as arguments, transform the code, then spit out the code that should run. Macros mostly exist in the lisp family of languages: scheme, common lisp, clojure, etc. Julia has them too. In this case, @ printf is a function that takes in a "formatting string" and generates efficient code for inserting data into a string. You can write your own control structures like if or for and still have them work like they were always a part of the language. We can make a trinary if-statement that branches if its argument is positive, zero, or negative as macro tif(cond,pos,zer,neg) quote c = $cond if c > 0 return $pos elseif c == 0 return $zer else return $neg end end end @tif 2 println("greater than zero") println("equal to zero") println("less than zero)" this program will correctly only print "greater than zero", meanwhile if we'd written this as a function function tif(cond, pos, zer, neg) if cond > 0 return pos elseif cond == 0 return zer else return neg end end tif(2, println("greater than zero"), println("equal to zero"), println("less than zero")) it prints out all three messages, which is the wrong behavior. b If doing science with computers sounds cool, check out the links on the back cover of this issue for lots more on Julia.

19

Lanuages

Meet

BY CLARISSA LITTLER


BY PATRICIA FOSTER

History

20

Blue Brai In the digital world, developers can tweak and tinker and take their time to find the perfect design. After all, if your virtual rocket blows up you can just click a button and make a new one! Cheap, quick, and easy. But computer simulations are also limited: they only work if their model is accurate. If the developer doesn’t program physics correctly, or forgets a piece of the puzzle, then it’s game over. In 2005, when Professor Henry Markram started the Blue Brain Project (BBP), many scientists didn’t think it would work. The goal of the BBP was to create a detailed computer simulation of a mouse brain, down to every last neuron and synapse. It was an exciting idea. Neuroscience is a tricky field, since the object it studies—the brain—is hidden away inside our skulls. Even the most modern measuring technologies like EEGs and MRIs

only provide brief glimpses into what’s going on. Imagine seeing a shadow and trying to figure out what its owner looks like! As a result, creating new medicines and treating brain diseases is a game of trial and error. An accurate brain simulation could change that. But could that simulation ever be accurate?

you pet a kitty? How does the brain decide which neuron to change? Imagine watching an office building full of people speaking a language you don’t understand. You see that communications are happening, you might identify what each department is doing, but you can't predict how one employee’s actions influence another.

Background Info

Simulating a Car Race

Your brain is composed of neurons. Each neuron looks a bit like a tree, with roots and branches extending in many directions and connecting to dozens of other neurons. Together, they create a vast network—85 billion neurons altogether! But while scientists understand the basics of neurons, they don’t know many specifics. For example, the shape of a neuron helps store your memories, but how exactly does this shape change when you eat an ice cream? When

Let’s say you’re simulating a race between two cars. How to start? A computer works with numbers, so your first step is to represent real-life data using nothing but numbers. A car, for example, might be defined by its speed, size, and weight. For a race simulation it doesn’t matter how many doors a car has or what color it is—these won’t affect the outcome of the race. You also have to model the environment: the length and width of the track,


21

n Project the slipperiness of the asphalt, the strength of the wind. The second task is to write instructions that cover every possible action. What does a car do when the race starts? When the car arrives at a right turn? A left turn? What if it’s getting too close to another car? Notice that you’re only writing instructions for a single car—you’re not orchestrating the entire race. That would be way too complicated. Next, by changing a car’s speed or size, you can study the impact that these variables have on the outcome of the race. By tweaking more and more factors you’ll eventually find the right combination for the fastest possible car. Simulating the Brain

To be accurate, a simulation needs data. Lots of data. Researchers for the BBP start by dissecting mouse brains. They cut

each brain into thin slices, then use special clamps, microscopes, and electrodes to document the type, shape, and location of each neuron. By gathering enough data, researchers hope to discover the rules that govern interactions between neurons. Then they can plug all these rules into their simulation software. At this point, a single neuron is modeled using over 20,000 differential equations! Now imagine simulating 85 billion neurons talking to each other at the same time—definitely not something you can run on your home laptop! BBP uses the special Blue Gene supercomputer developed by IBM, which was also the inspiration behind the project’s name. Even with such a powerful computer, the simulation works 300 times slower than a real brain. That’s about 1 second of brain activity simulated

IMAGE FROM THE WEBSITE OF THE ÉCOLE POLYTECHNIQUE FÉDÉRALE DE LAUSANNE

every 5 minutes! Computer scientists for the BBP look for ways to make these calculations more efficient. Not only is the project improving our understanding of biology, it’s helping us get better at computing as well. Next Steps

The BBP is far from complete. Researchers can run selected experiments on it, but the grandiose initial vision of the project— developing new medicines, curing brain diseases—isn’t a reality yet. The BBP needs a lot more data and a lot more time. However, the model’s only going to get better through the years. And no matter what else it achieves—or doesn’t— the BBP represents a new step in scientific collaboration, with many different disciplines coming together to push the boundaries of what’s possible. b

To learn more, check out the link on the back cover of this issue.


BY PATRICIA FOSTER

Modeling Tic-Tac-Toe

Coding

22

To learn more, check out the link on the back cover of this issue.

Programming a computer game lets you create your own world with your own rules. And if you break everything down and tackle each piece one at a time, even the most complex games can be simple to write. Let’s start with a classic: tic-tac-toe. Brainstorming

Before we pull up the code editor, let’s think about the design of our tic-tac-toe board. In a professional setting you’d look at different graphics packages, colors, animations. For now let’s stick with something simple and text based. A good tic-tac-toe board could be:

_|_|_ _|_|_ _|_|_

Where Xs and Os are added like so:

X|_|O _|X|_ _|_|_

Open the Code Editor

Go to www.repl.it. In the ‘Search for a Language’ box, type ‘Python3’ (Don’t forget the ‘3’!) Select ‘Python3’. Your webpage should look like this: Modeling

There are two parts to creating a virtual game board. First, you have to decide how the information on the board is stored in your program. We call this the model. The code for the model is meant to be short and sweet. It usually doesn’t look like the real game because the computer doesn’t care about presentation—just facts. Users, on the other hand, care a lot about presentation, so you need a way to display the model’s information in a pretty, visual way. We call this the view. Here’s some sample code: board = ["_"] * 9 def print_board(): print(board[0] + "|" + board[1] + "|" + board[2]) print(board[3] + "|" + board[4] + "|" + board[5]) print(board[6] + "|" + board[7] + "|" + board[8]) print_board() When you hit the run button you should see the blank board displayed in the console:

Code In Depth

We create the model in a single line: board = [ “_” ] * 9. The square brackets signify that we’re creating a list. Since we multiply the list by 9, we get a list of 9 identical items. In this case, each item in the list is the underscore symbol: “_”. These are the values contained in the tic-tac-toe board: all empty for now. Next, we create a function to display the board in the console (lines 3-6).


In most programming languages, lists start at “0”, so the 1st item in a list is actually the ‘0th’ item! When creating our view, we assign each position in the list to a specific board tile. In this code we go horizontally, but we could have gone vertically as well. The computer doesn’t care. As long as you connect your model and your view properly it won’t matter! 0th | 1st | 2nd 3rd | 4th | 5th OR 6th | 7th | 8th HORIZONTAL

0th | 3rd | 6th 1st | 4th | 7th 2nd | 5th | 8th VERTICAL

Now, whenever we call the ‘display_board’ function, the program displays a representation of the the board onscreen. User Input

Next, we need to let the user place pieces on the board. Add the code: while True: x = input("Pick a number from 0-8") x = int(x) board[x] = "X" print_board() In line 11 we ask the user to pick one of the tiles by specifying a number. Then we transform their input into a number (line 12) and change the appropriate item in the list to the ‘X’ symbol (line 13). When you display the board it now contains the user’s piece:

Since lines 11-13 are inside an infinite ‘While loop’, the program keeps prompting the user until we manually stop it. What Comes Next?

We’ve finished creating our basic model and view! But there’s still lots to do to make this into a working tic-tac-toe game. If you’ve worked with Python before and you’re up for a challenge, see if you can figure out how to add one or more of the following: 1. There’s only nine spots on the board. What if the user types in ’11’, or ‘-1’, or ‘nachos’? How can we prevent these errors from happening? 2. In fact, getting a user to pick a tile by number isn’t a great system. Can you think of a better one? 3. We need to add player turns to the game. If the first piece is an X, then the second should be an O, and then an X, and on and on. 4. What if there’s already an X or an O on the tile chosen by the user? Should the program exit, give the user another chance, or skip their turn? 5. If three Xs or three Os are in a row, the game should declare the winner. If the board is filled, the game should declare a tie, and end. If you don’t want to tackle the code, think about solutions to these. Once you know what you want to do, the rest is just learning the right syntax! b PHOTOS TOP TO BOTTOM: MATTHEW PAUL ARGALL, FLICKR; TRAVIS GOODSPEED, FLICKR; PUBLICDOMAINPHOTOS, FLICKR; LARS PLOUGHMANN, FLICKR

23


History

24

What Time Is It?

BY TIM SLAVIN

You know the day and time when your classes begin, but have you thought about what time is? Why 24 hours, for example, or 7 days in a week not 5? Who decided? Keeping time is a technology. It was created by humans to solve problems. Mostly, time is used to keep people synchronized. We might agree to have breakfast when the sun rises but what about lunch? What about classes? Computers have a similar problem. Not only do they have to share data (and a standard way to describe data), but computers also need to manage time in order to perform tasks and work with other computers. Computers use Unix time. The start time is January 1, 1970 at 00:00:00 minus any leap seconds since then. From that moment, computers count forward in units of time that generate a long integer, or number, which can be translated into dates humans recognize. For example, this issue is released on February 1, 2018 which in Unix time is 1517443200. (That’s easy to remember, isn’t it? Sure it is!) Why 1970? Because the Unix operating system was under development from around 1969 to the early 1970s, and January 1, 1970 at midnight was an easy reference point. Of course, it’s not that easy. There are old 32-bit computers which will run out of digits to count Unix time at 2147483647, or what we call January 19, 2038 at 3:14:08 in the morning. Be sure to put that in your calendar if you happen to have an old computer. On Sunday, 4 December 292,277,026,596, 64-bit versions of the Unix time stamp would cease to work, as it will overflow the largest value that can be held in a signed 64-bit number. This is nearly 22 times the estimated current age of the universe, which is 1.37×1010 years (13.7 billion) Here is how the date 1/1/1970 is represented in other calendars:

Calendar

Date

Additional Information

Julian

19-December-1969

Fell on a Thursday

Hebrew

5730-Teveth-23

Embolismic deficient (383-day year)

Islamic

1389-Shawwal-22

Fell on a yawm al-khamis

Persian

1348 Dey 11

Fell on a Panjshanbeh (Thursday)

Mayan

12.17.16.7.5

Lord of the night was G1

Chinese

Yi-Chou (Ox), 24, 4667

Year Name was Ji You (Rooster)

ALEXANDRA BILHAM,FLICKR

b


tidbitz

tidbitz

25

Shaping Poems with Code

Is Your Moon out Tonight?

Check out the tidbitz link on the back cover to learn how to make this Moon Phases Calendar and Calculator, direct from NASA! It's a fun way to track the moon in 2018, which will be an amazing year. You’ve heard the expression "once in a blue moon?" Well, there will be a once-in-150-year blue blood super moon and lunar eclipse on January 31st! A blue moon means there are two full moons in a month instead of one. A blood moon happens when the earth is in the way of the sun and moon, with light filtered through the earth’s atmosphere reflected on to the moon, making the moon appear red. A super moon happens when the moon is closest to the earth and appears 30% larger. There also will be a second blue moon in March 2018! For more, go to NASA's moon website and the sky event calendar.

b

Brothers from Different Mothers???

After decades of friendship, two men in Hawaii recently learned they are half-brothers with the same biological mother. Each friend independently took a recreational DNA test. They grew up together, played on the same high school football team, and have stayed close friends. One friend, Alan Robinson, was adopted by his family. The other friend, Walter Macfarlane, discovered the DNA match when tests listed his friend as having identical X chromosomes which are passed by mothers to their children. Further research showed they had the same mother, something they never knew or even suspected. b —Adapted from a CNN story reported by Sandee LaMotte on 12/27/17

Paul Curzon at Teaching London Computing has developed a fun tutorial. It demonstrates how to use Python to shape any poem with line breaks, based on the Fibonacci number sequence. Do you have a favorite number sequence? The article shows how to write an application to apply your sequence to create line breaks for any poem, using programming concepts like generalization and currying. The Fibonacci number sequence is a set of numbers with each number created by adding the previous two numbers. This yields 1,1,2,3,5,8,13,21, and so on. This sequence appears often in nature, for example: the number of petals on flowers, bee breeding, and seashells. Using code to

set line breaks for poems is a fun way to experience poetry and make number sequences visibly real. b

PHOTOS FIBONNACCI SEQUENCE BY BENJAMIN CHAN, FLICKR; ALFRED, LORD TENNYSON FROM FLICKR


Hello Muddah, BY TIM SLAVIN

"Hello Muddah, hello Faddah! Here I am at Camp Grenada. Camp is very entertaining. And they say we'll have some fun if it stops raining." ALLAN SHERMAN / LOU BUSCH HELLO MUDDAH HELLO FADDUH LYRICS © GET SONGS DIRECT WARNER/CHAPPELL MUSIC, INC

ABOVE: KEVIN SMITH, FLICKR RIGHT: FORT GEORGE G. MEADE PUBLIC AFFAIRS OFFICE/ GEEK SQUAD CAMP, FLICKR

Notebook

26


Hello Faddah! It's the middle of winter in the northern hemisphere, but it's time to start thinking about technology summer camps if you're a kid or have kids. Summer camps have come a long way from the old "Camp Grenada" song days! The most popular tech camps close enrollment as early as February and March. Local groups like the YMCA will start forming their camp rosters this month too. Often you’ll hear of camps through family, friends, and teachers. Camps can be one or two week sessions, day camps, or residential ("sleep-away"). Look at groups like iD Tech and Digital Media Academy as well as local colleges and universities for summer tech camps. Tech Kids Unlimited, Black Girls Code, the coding club Coder Dojo are some other options. If your child learns differently or has special needs, some camps like Tech Kids Unlimited have additional staff and a low teacher to student ratio. For special needs kids, the ideal ratio should be two kids for each teacher or assistant. It's also important to know if the teacher has experience working with kids who are enthusiastic but may not keep up with the class.

Some questions you might ask:

How many years have they been in business?

The best have lots of repeat campers and have been around several years. Repeat campers and their families are great references. Always ask for references no matter how long a camp has operated. How do they handle discipline?

Time outs? Expulsions? It’s important to not only know how your child will be disciplined, but how conflicts with other campers will be handled. Will the camp transport kids from camp to other sites?

Will there be field trips? Are you okay with your child being transported by another, and, are you okay with your child being somewhere other than the designated camp location? What does a typical week of camp look like?

What should your student leave camp knowing? Is the length of time your child will spend at the camp enough? What is the camp’s registration process like?

The registration process doesn't have to be overly long and involved in order for the camp to be a

27

good one. But, if a camp only asks for names and phone numbers (while not asking about allergies, emergency contacts, etc.) that might raise a red flag. What payment options are available?

Summer tech camps can be pricey. Ask if they offer scholarships, sliding scale payment plans, or breaks based on income. Many camps also offer discounts for paying or registering early. The YMCA or Coder Dojo offer reasonable or zero cost tuition, depending on your situation. What are their emergency procedures?

Most camps never have a problem. But it’s important to know there's a plan in place if a building is evacuated or a child needs medical assistance. Also, consider the backgrounds of the teachers and the ratio of computers to child. One computer per two children is not bad if the camp does pair programming, for example, where two kids work together to learn coding. Also, ask about the background of the camp organizers, the people who make the camp run every day and solve all the little rainy-day glitches. Have fun at camp! b


Parents and Teachers

28

BY TIM McGUIGAN

Resisting the Silo: Cognitive Skills As the sixth grade class meanders into my computer lab and takes their seats, I begin working the room. Arms folded, I casually make small talk, but I also begin drilling the students on the concepts we have recently covered. What is decomposition again? An eager hand goes up. Hmmm… How does that work? Is it a list of steps? Explain what you meant there… Our robotics unit has many areas of focus, although the basics of Computational Thinking are some of the more valuable cognitive skills I teach. On this particular day, this information is quite fresh for these 11 and 12 year-olds, and I am pleased with their answers. However, as the unit progresses, the teacher voice in my head has a few nagging doubts about how well they are actually mastering decomposition. (Decomposition, in this case, means breaking down large problems into smaller and more manageable problems.) One of the higher-order skills that I look for in my students is application of knowledge. After presenting a new concept, asking students to practice the skill, and beginning the process of assessment, application is one of those mastery-level skills on Bloom’s Taxonomy for which teachers regularly aim. Application demonstrates that a student has internalized the lesson because they apply it to a new or unfamiliar situation. I have found what students do with a given problem holds more weight than what they say about it. While observing them handle a problem, I watch for subtle changes in behavior and habit.

For example, after a recent lesson on pattern recognition, I was delighted to see a student using her shoe as an ad hoc measurement tool on a tricky robotics maze. She identified a pattern in how the robot traveled in relation to her shoe, and used the shoe to make estimations before programming. One particular danger for teachers of technology is when students begin seeing the problemsolving techniques they learn and technology literacy they gain as limited to the Computer Science classroom. The information they learn becomes cognitively siloed, and as a result, they lose many benefits of technology education. To explain, I need go no further than the traditional classroom layout of many schools. I teach my classes in a computer lab filled with desktop computers, robots, computer parts, and an old Atari 2600 console. Students enter, class happens, and then they file out to other spaces meant for science labs or evidence-based essay writing. While many schools have begun to diversify the spaces and boundaries of the STEM classroom, my school is like many others in that we still have firm divisions between classrooms and curricula. In my eyes, problems begin to arise when these divided spaces mirror a division in the students’ understanding. This year I began fighting this habit, and worked more closely with my colleagues to integrate computational thinking methods into other disciplines. Decomposition was an easy place to start. Sixth grade is the year when

word problems begin to vex many students in the math classroom. However, using highlighters to decompose has helped many students organize the problem cognitively before solving it. In our English classrooms, students also begin the process of writing evidence-based analysis in their five-paragraph essays. After working with the English teachers, students found it helpful to apply decomposition methods to tease apart the elements of complex writing prompts. Along with the efforts in my classes to decompose using flowcharts, students ended up applying decomposition to a wide range of assignments, many of them new territory. What I am learning through these efforts is that the broad application of cognitive skills is mutually beneficial for both content area and technology teachers. Computational thinking lends itself easily to this kind of diversification, although there are other problem solving methods that also fit the bill. Understandably, not every teacher is ready to move towards a problem and solution based curriculum, and these changes do take the place of other content. However, when students practice these skills, they begin to develop a more robust understanding of the work of problem solving. The hope is that wherever they see a problem in their lives and work, they will have a general framework for approaching it. This goes quite a long way to help quiet that nagging teacher voice, although as an educator I know that following that voice can lead to novel approaches in the classroom. b


29

in the STEM Classroom

NEONBRAND ON UNSPLASH


“The computer is the most remarkable tool that we've ever come up with. It's the equivalent of a bicycle for our minds.” —Steve Jobs 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. Listen! http://beanzmag.com/ listen-to-data

Going to the Dogs http://beanzmag.com/ woofjs-scratch

What Time Is It? http://beanzmag.com/whattime-is-it

A Brave New World http://beanzmag.com/ introducing-sphero

Taking Your Game Online http://beanzmag.com/ minecraft-game-online

Tidbitz http://beanzmag.com/tidbitzfebruary-2018

Operation: Hack! http://beanzmag.com/ build-operation-game

Thinking Outside the Box http://beanzmag.com/ sketchup-cheerios-box

Creating Jewelry With 3D Printing http://beanzmag.com/ 3d-jewelry

Meet Julia http://beanzmag.com/julia

Hello Muddah, Hello Faddah! http://beanzmag.com/ summer-camps-2018

dits and dahs http://beanzmag.com/ morse-code

Blue Brain Project http://beanzmag.com/ blue-brain-project

Modeling Tic-Tac-Toe http://beanzmag.com/ PyWeek modeling-tic-tac-toe http://beanzmag.com/pyweekgame-jam

Resisting the Silo: Cognitive Skills in the STEM Classroom http://beanzmag.com/ breaking-steam-silo

om/ c . g a zm n a e b / http:/ribe Subscribe! subsc

Profile for beanz Magazine

beanz Magazine February 2018  

beanz Magazine February 2018  

Profile for beanzmag