October 8, 2016

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

Welcome to CoderDojoKC! Let’s get you started! If you haven’t when you arrived, please fill out our demographics survey!

Step One: Wifi

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

2. Can’t connect? Raise your hand and a mentor will get you a hotspot to connect to.

3. 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!

Today’s theme: Randomized Data & Mad Libs

Today we’re going to make our own MadLibs-like text generator using lists (in Scratch) or arrays (in JavaScript). See MadLibs for examples.

Concepts we’ll play with:

  • Lists / Arrays
  • Getting random items from Lists / Arrays
  • Combining Text

Lists and Arrays are collections of things that belong together. You might have a grocery list that lists things you need to buy at the grocery store, so you would expect to find things like “milk,” “butter,” “eggs,” & “bread” on that list but not “gym class.” Yet, on your list of school classes, you might find “gym,” “math,” and “art” on that list, but not “ground beef.” Getting an item looks like:

Scratch: (item 1 of "Grocery List")
JavaScript: GroceryList[0];

Getting a random item from a list involves using the “pick random” operator in Scratch and the “Math.random()” function in JavaScript. To pull a random item from your list or array, you need to mention that list/array twice: once as that list/array and once as the size (number of items) of that list/array. In Scratch, this looks like:

Random Selection from List in Scratch

In JavaScript, this looks like:
groceryList[Math.floor(Math.random() * groceryList.length)];
var randomNumber = Math.random() * groceryList.length;
var arrayItem = Math.floor(randomNumber);
return groceryList[arrayItem];

Combining text involves taking at least two pieces of text and combining them with some kind of join-operator. In Scratch, you would use the “join” operator to combine two items of text. In JavaScript, you would use the “+” to combine two pieces of text. In Scratch, it would look like (join "hello" "world") and in JavaScript, it would look like "hello" + "world". The problem with both of these examples, is that you end up without any spaces between the two words that you just joined, so you get “helloworld”. You have to use more than one join-operator to add a space or combine more than two words:

Scratch: (join (join "hello" " ") "world")
JavaScript: "hello" + " " + "world"

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!

Example Project:

Step Five: Show Off!

Did you create something awesome based off of one of these projects? Come present it on stage! Presentations will start at 11:00 am. Let a mentor know you want to show off your work. Scratch projects that will be presented will be added the CoderDojoKC Studio by Mentor Eric.

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