March 10, 2018

Get started at http://www.coderdojokc.com/today

Welcome to CoderDojoKC! Let’s get you started!

Looking for something to do? Practice your typing skills! Typing.io is a great way to keep your fingers nimble and learn where some of those tricky keys are located.

Step One: Wifi

1. Open up your internet connection and connect to “Fiber Public WiFi

2. Can’t connect? See if you can get to the wifi sign-in at http://google.com/fiber

3. Still can’t connect? Raise your hand and a mentor will get you a hotspot to connect to.

4. We recommend using the Google Chrome browser.

Step Two: Start Learning!

If you don’t know which programming language to start learning, we recommend Scratch (if Scratch is not to your speed, check out the typing.io link in the sidebar on the right).

You will need a parent or guardian’s help to create a Scratch login:

  1. Click “Join Scratch” in the upper right-hand corner of the Scratch site.
  2. Create a username that does not include your real name.
  3. Think of a password that you can remember easily. You should have your parent or guardian write this down and save it.
  4. Click “Next” and continue following the directions. You will need a valid email address (yours or your guardian’s) to continue.

Once you have a Scratch login, use the links below to build something awesome.

Step Three: Learn to Code

1. Are you brand new to coding? Start with Codecademy (recommended for 13 years & up) or Scratch (recommended for 12 years & under).  Want to try building your own phone application? Check out App Inventor! Be sure to create an account and write down your username and password so you won’t forget!

2. Do you have a little coding under your belt? Are you ready to learn more? Check out these fun games:

3. Were you working on a project from our last session? Feel free to continue on that, and ask mentors if you need any help!

4. Get started on the new project. We can’t wait to see what you create!

Step Four: Check Out the Projects

Mastery – Feeling masterful? Check out the requirements for our mastery badges. You can earn cool pins!

Previous Concepts:

Today’s concept: Arrays and Lists

Arrays are collections of things that belong together. Arrays are found all over math and science. We have collections of antennas, called “antenna arrays,” that are used for listening to things far away.

Large planar array antenna of a VHF Russian mobile air defense radar — By Vitaly V. Kuzmin – http://vitalykuzmin.net/?q=node/469, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=21027006

We have arrays of phone switches.

Array of telephone switches and their operators

We have arrays of circuits.

Relay Array

Kids who have worked with multiplication are introduced to arrays that look like this.

Math Array used for multiplication

In programming, we also have arrays. In Scratch, arrays are known as “lists.” Arrays are very useful for storing things that belong together.

  • I can have a list of movies:
    var movies = ["Black Panther", "Coco", "A Wrinkle in Time"];
    
  • I can have a list of great days:
    var greatDays = ["yesterday", "today", "tomorrow"];
    
  • I can have a list of classes I’m taking:
    var schoolClasses = [
      "algebra",
      "music",
      "English",
      "Spanish",
      "biology",
      "history",
      "gym"
    ];
    

The items in your array belong together. Think of your kitchen as a collection of arrays. The refrigerator is an array of things that need to stay cool. The freezer is an array of things that need to stay frozen. The pantry is an array of food that can be room temperature. You have an array of plates, an array of cups and glasses, an array of eating utensiles, an array of towels, an array of spices, etc.

Arrays also have a size. In my array of cereal, I have 4 boxes of cereal. In my array of silverware, I have arrays of forks (8), salad forks (8), tea spoons (8), soup spoons (7), butter knives (8), and steak knives (8).

In simple arrays like above, each item is in a numbered slot called a “key” or an “index.” In most programming languages, arrays start at zero (0) and count upward until you get to one less than the size of the array. So, for an array of 8 spoons, you would count them as “spoon 0, spoon 1, spoon 2, spoon 3, spoon 4, spoon 5, spoon 6, and spoon 7.” In a Scratch list, you start counting at 1. This can get confusing, but it’s important to understand if that’s how items are arranged in the programming language that you are using, because you get the item in a simple array by its key number.

var movies = [
  "Black Panther",
  "Coco",
  "A Wrinkle in Time"
];

// the first movie in this list, "Black Panther," is:
var firstMovie = movies[0];

We can also have an array of arrays. This is called a “multi-dimensional array.” Imagine a box of donuts. There are probably 12 donuts in that box of donuts. So, you might have:

var donuts = [
  "d1", "d2",  "d3",  "d4",
  "d5", "d6",  "d7",  "d8",
  "d9", "d10", "d11", "d12"
];

The third donut in that box is donuts[2] since we start counting in arrays at zero. But we know that we actually have 3 rows of 4 donuts in this box of donuts:

var donuts = [
  ["d1", "d2",  "d3",  "d4" ],
  ["d5", "d6",  "d7",  "d8" ],
  ["d9", "d10", "d11", "d12"]
];

Now, getting that third donut would require us to identify which row it’s in, too: donuts[0][2]

Question: how do I get the last donut?

// donuts[x][y]; what is "x"? what is "y"?

Bonus Question: if I had 10 boxes of 12 donuts, how would I get the last donut?

// donuts[x][y][z]; what is "x"? "y"? "z"?

Examples in Scratch

Step Five: Show Off!

Did you create something awesome based off of today’s theme/concept? Come present it on stage! Presentations will start at 11:30 am. At 11:00, come see Mentor Eric to get a place in line to present. Scratch projects that will be presented will be added the CoderDojoKC Studio by a mentor.

For today’s session, we want to see at least two things in order to be eligible for presenting to the group: list/array and getting an item from that list/array. Have fun!

**Presentations may not contain any politics, violence, gore, or bad words. (And we’re counting “sucks” as a bad word!)