Give a word a name to use in the program using is. You can choose the name yourself.
Ask something with ask. Beware! You need to give the answer a name with is.
With sleep, you can let Hedy pause for a (couple of) second(s).
Give a number a name using is. You can choose the name yourself.
Introduction
is
Rock, paper, scissors
ask
Rock, paper, scissors 2
Haunted House
sleep
Parrot
Story
music
Restaurant
Turtle
Draw it!
debugging
Puzzle
Quiz
Congratulations! You've reached level 2. Hopefully you've already made some awesome codes!
In the first level you might've notice that the echo command can only save one bit of information at a time.
For example in the restaurant adventure, you could echo what the costumer wanted to eat, or what they wanted to drink, but not both in one sentence.
That changes in level 2. In level 2 you'll learn to work with variables, that allow you to save multiple pieces of information and print them in any place you want.
So let's go to the next tab!
Warning! This code does not work!
In Hedy commands will change sometimes. echo for example only works in level 1. In this level you'll learn a better way to echo answers back.
print Welcome at Hedy's
ask What would you like to eat?
echo So you want
ask what would you like to drink?
echo So you want
Variables
You can name a word with is. This is called a variable. In this example we made a variable called name and a variable called age. You can use the word name anywhere in your code and it will be replaced by Hedy, like this:
name is Hedy
age is 15
print name is age years old
Exercise
Time to make your own variables!
In the example code we made an example of the variable favorite_animal. In line 1 the variable is set, and in line 2 we used the variable in a print command.
Firstly, finish our example by filling in your favorite animal on the blank. Then make at least 3 of these codes yourself. Pick a variable, and set the variable with the is command. Then use it with a print command, just like we did.
favorite_animal is _
print I like favorite_animal
In this level you can practise using the variables, so that you can make the rock, paper, scissors game in the next level!
Exercise
Finish the code by filling in the variable on the blank.
This game is not very interactive, but no worries! In the next tab you'll learn how to use variables with the ask command to make your game interactive!
choice is rock
print I choose _
The ask command
Now that we can use variables in our codes, we no longer need the echo command.
We can use variables to store the answers to our questions and this way we can use the answer to multiple questions in our codes.
Check it out:
This way your code is becoming interactive!
name is ask What is your name?
print Hello name
age is ask How old are you?
print name is age years old.
Exercise
In the previous tab you have practised with setting variables with the is command.
You have created at least 3 variables and used them with a print command.
Now, instead of setting the variables we want you to make the variables interactive, like we did in our example.
Copy your code from the previous tab and make the variables interactive by using ask commands.
favorite_animal is ask What is your favorite animal?
print I like favorite_animal
Now that you have learned how to use the ask command, you can make your rock, paper, scissors code interactive too!
Exercise
Make the rock, paper, scissors code interactive by adding the ask command and a question to your rock, paper, scissors code.
choice is _
print I choose choice
In this haunted house you can choose your monsters with emojis. Of course you could also use words.
monster_1 is 👻
monster_2 is 🤡
monster_3 is 👶
print You enter the haunted house.
print Suddenly you see a monster_1
print You run into the other room...
print But a monster_2 is waiting there for you!
print Oh no! Quickly get to the kitchen.
print But as you enter monster_3 attacks you!
Exercise
In the example above the monsters are predetermined. So each time you run your code, the output is the same.
Can you add ask commands to make the haunted house interactive and have the players choose the monsters they come across?
monster_1 is _
monster_2 is _
monster_3 is _
print You enter the haunted house.
print Suddenly you see a monster_1
print You run into the other room...
print But a monster_2 is waiting there for you!
print Oh no! Quickly get to the kitchen.
print But as you enter monster_3 attacks you!
Another new command in this level is sleep, which pauses your program for a second. If you type a number behind the sleep command, the program pauses for that amount of seconds.
Exercise
Practise this new command by making a code of your own in which you use the sleep command at least 3 times. With each sleep command the pausing time should differ.
print My favorite colour is...
sleep 2
print green!
In the previous level you've made a parrot that will repeat after you. In this level we'll make the parrot interactive using a variable and ask command.
We will also make the parrot more life-like by adding sleep commands after something is said.
print Im Hedy the parrot
name _ _ what is your name?
print name
_
print squawk
_
print name
Exercise
Firstly, finish line 2 with an is and an ask command.
Then fill in a sleep command on line 4 and 6 to let the parrot stay quiet for a little bit.
Extra Can you make the parrot ask for more then only your name by adding more lines of code?
In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence.
You do have to program a little bit extra for that. You must now name your main character first.
You can then put that name anywhere in a sentence.
name is ask What is the name of the main character?
print name is now going to run in the woods
print name is a bit scared
print Suddenly she hears a crazy noise...
sleep
print name is afraid this is a haunted forest
Exercise
Now it's time to add variables to your own story that you've made in the previous level.
Go to 'My programs', look for your level 1 story adventure and copy the code. Paste the code in your input screen in this level.
This code won't work in this level, because you have not used variables yet.
Change the ask commands and echo commands in your code to the correct form that you've learned in this level.
Extra Add a sleep command to your code to build up tension in your story.
Exercise
Finish the songs! We have started the codes for some melodies.
print Old Mac Donald had a farm
play C5
play C5
play C5
play G4
play A4
play A4
play G4
As you can see, you can also use the sleep command to add a little pause in the song.
print Twinkle Twinkle Little Star
play C
play C
play G
play G
play A
play A
play G
sleep 1
play F
play F
In level 2 you could expand your restaurant by using variables. In level 1 Hedy could only echo the order once and only remember the last thing that was ordered.
Now you can use variables and Hedy can remember both the food and the toppings!
print Welcome to Hedy's restaurant!
print Today we're serving pizza or lasagna.
food is ask What would you like to eat?
print Great choice! The food is my favorite!
topping is ask Would you like meat or veggies on that?
print food with topping is on its way!
Exercise
Copy your own restaurant code from to previous level to the input screen below.
Fix the code by replacing the ask and echo commands and using variables, like you've learned in this level.
Now that your code is working again, it's time to add something more.
Look at the last line of the example code: print food with topping is on its way!
In this single line 2 variables have been used to create a summary of the order.
Now add your own summary of the food and drinks ordered by the customer.
Extra Now that you've learned how to use variables, you can use as many variables in one line as you'd like. Can you add more variables to your code, like eat in or take-away, cash or card, with or without a straw etc.?
In level 1 the turtle could only turn left or right. That is a bit boring!
In level 2 he can point his nose in all directions.
Use 90 degrees to turn a quarter, 180 to turn half, and a full circle is 360 degrees.
Exercise
This code now creates the letter T. Can you change it to make the letter B?
Extra Change the letter into a different letter, like the first one of your name.
You can also make multiple letters, by setting the color to colorwhite in between.
Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code.
That means that in these debugging adventures, we will give you a code that does not work yet.
You will have to figure out what's wrong and correct the mistakes.
Exercise
Debug this code. Good luck!
Warning! This code needs to be debugged!
destination ask Where are you going on holidays?
print The flight to dstination leaves at 3 pm.
ask Did you check in your luggage yet?
echo
print Let me print your boarding pass for you.
sleep
Here you go! Have a nice trip!