EU Code Week 2020 - Thursday - Track the Gems

hamburger menu
YouTube Join us LIVE now!

About this lesson

Today's Playground:
Learn to Code 2 playground
Learn to Code 2
Day six: track the gems playground image We'll use the Learn to Code 2 playground today and learn a bit about variables: a way for our app to remember important details.

In our case, with Byte and friends, we'll want to keep track of how many gems our character has collected.

Video

Recorded Thursday, October 15th, 2020:

Unplugged Activity

Just Dance variables

You will need:
  • A4 plain paper or download and print the 'Dance variables' sheet (link coming soon)
  • Pens or pencils
  • You can visit an example website: Just Dance Now website

Activity:

What's the name of your favourite dance? How many steps are in the dance? How many times do you repeat a set of moves? How long does the music last?

Today, we will be thinking about variables. The 'Dance variables' sheet has 8 panels on it or you can fold a plain piece of A4 paper (folded in half, folded in half and folded in half again, then opened out). We will write the variable names into the 8 panels and then describe our dance moves.
The Just Dance Now website has several dances you can choose or use the dances you created in our session yesterday.

Extend

Extra Playground:
Answers playground
Answers
From the Starting Points section of More Playgrounds, download the Answers playground.

In the Text page, write a simple program which will collect answers from friends or family and show them in the playground. This is an excellent use of variables that we learned about in today's lesson. Collect enough answers from somebody that you can print out a story about them that includes their favorite animal, color, their name, and what name they'd like to be called if they were a llama.

Here's a hint: the let keyword we see is just like the var one we used in the Keeping Track page. It means that this is a variable that we don't expect to change, once we get a value for it.