April 14, 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: Loops and Repeating Things

2015 had 12 months: January, February, March, April, May, June, July, August, September, October, November, December
2016 had 12 months: January, February, March, April, May, June, July, August, September, October, November, December
2017 had 12 months: January, February, March, April, May, June, July, August, September, October, November, December
2018 had 4 months: January, February, March, April, … what months are coming?

Spin around and count each spin until you are dizzy. How many times could you spin around?

These are examples of loops. What are we doing with a loop? We are repeating things over and over again.

Your day could be condensed to “Wake up, do stuff, go to bed.”

while (alive) {
    me.wakeUp();
    me.doStuff();
    me.goToBed();
}

In Scratch, this could look like:

(repeat until (not alive)
    (wakeUp)
    (doStuff)
    (goToBed)
)

You’ll notice that even though these loops appear to go on forever, they have a conditional for when they can exit the loop. You want to have an “exit condition” to ensure that you don’t have an endless loop in your program.

In JavaScript, the school year could be written as:

for (i = 0; i < 40; i++) {
    console.log("Let's go to school this week!");
}
// Let's go to school this week!
// Let's go to school this week!
// Let's go to school this week!
// Let's go to school this week!
// Let's go to school this week!
// ...

Here, the exit condition is that it has looped 40 times. It cannot loop 41 times.

You can also do something with the variables that are part of that loop.

var weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

for (i = 0; i < weekdays.length; i++ ) {
    console.log(weekdays[i]);
}

// Sunday
// Monday
// Tuesday
// Wednesday
// Thursday
// Friday
// Saturday
// Sunday

This could be rewritten using a special type of array loop called a `foreach`:

weekdays.forEach(function(day) {
    console.log(day);
});

What are some things that you can loop over? You can loop over items in a list, like repeating back the list of items you are supposed to get at the store.

You can also use a loop to repeat an action. For instance, what if I want to have a character walk across the screen? I could say:

me.move(10);
me.useNextCostume();
pause(1);

me.move(10);
me.useNextCostume();
pause(1);

me.move(10);
me.useNextCostume();
pause(1);

me.move(10);
me.useNextCostume();
pause(1);

me.move(10);
me.useNextCostume();
pause(1);

Or, I could put those actions in a loop:

(repeat(5)
    me.move(10)
    me.useNextCostume();
    pause(1);
)

Your assignment today is to build something awesome that uses at least one loop.

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.

Your assignment today is to build something awesome that uses at least one loop. Have fun!

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