EU Code Week 2020 - Day Six - Track the Gems
About this lesson
Recorded Thursday, October 15th, 2020:
Recorded Thursday, October 22nd, 2020:
Just Dance variablesYou 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.
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.
Code in this session:
moveForward() moveForward() collectGem() gemCounter = 1
Bump Up the Value
moveForward() collectGem() gemCounter = 1 moveForward() collectGem() gemCounter = 2 moveForward() collectGem() gemCounter = 3 moveForward() collectGem() gemCounter = 4 moveForward() collectGem() gemCounter = 5