Give a name to some text and print without quotation marks.
Ask something with ask.
Introduction
'quotation marks'
Rock, paper, scissors
Dice
Dishes?
Parrot
Turtle
Draw it!
clear
music
Story
Haunted House
Fortune teller
Restaurant
debugging
Puzzle
Quiz
In the previous levels you've been practising with variables, but you may have come across this problem.
You might have tried to run a code like this:
Of course you wanted to print
My name is Sophie
but Hedy prints
My Sophie is Sophie.
In this level this problem is fixed by using quotation marks.
name is Sophie
print My name is name
'Quotation marks'
In level 4 ask and print have changed.
You must put text that you want to print between quotation marks.
This is useful, because now you can print all the words you want. Also the words you used to store something with is.
Most programming languages also use quotation marks when printing, so we are also getting a step closer to real programming!
print 'You need to use quotation marks from now on!'
answer is ask 'What do we need to use from now on?'
print 'We need to use ' answer
Contractions
Important! Mind that now that we're using quotation marks, Hedy will get confused when you use the apostrophe for contractions like I'm or What's.
Make sure to use double quotes when you're using an apostrophe in you line!
Check out the example code to see the wrong way of using apostrophes.
_ This is the wrong way of using apostrophes _
print 'I'm babysitting my sister's kids'
print 'What's more fun than that?'
_ This is how you solve it _
print "I'm babysitting my sister's kids"
print "What's more fun than that?"
In this level we can further program rock, paper, scissors. But if you want to add text, you have to use quotation marks here too.
Exercise
Fill in quotation marks on the blanks. Mind that the variable choices should be outside the quotes.
choices is rock, paper, scissors
print _The computer chooses..._ choices at random
In this level you can also create dice. But this time you can try it yourself, without an example code!
Exercise
Make your own dice in this level.
Tip: If you have no idea how to make dice. Take a peek at your dice from the previous level, but don't forget to add quotation marks.
With quotation marks you can make your dishwashing program even better.
Exercise
First, fill in right symbols or commands on the blanks to make this example program work.
Did you get it? Great! Now copy your own code from the previous level and make it work in this level by adding quotation marks in the right spots.
people is mom, dad, Emma, Sophie
print _ the dishes are done by _
sleep
print people at _
In this level we have to use quotation marks with the commands ask and print.
Exercise
Complete the code by filling in quotation marks on the blanks.
words is squawk, Hedy
print _ Train your parrot! _
new_word is ask _ Which word do you want to teach them? _
add new_word to words
print _ 🧒 Say _ new_word _, Hedy!_
print _ 🦜 _ words at random
In level 4 you have to use quotation marks with print and ask. Also when drawing!
You can also change the color of the lines with the command color. Check out the example.
You can also use the command color white to make 'invisible' lines. You could use these white lines to move the turtle anywhere in the screen before you start drawing.
color white
forward -80
color green
forward 50
color yellow
forward 50
color red
forward 50
Exercise
Recreate the drawings with the turtle!
Colored Star
Rainbow
Nested squares
Extra Up for a real challenge? Make sure that the colors of these figures are selected randomly, so that each time you run your programs they'll look differently!
colors is red, orange, yellow, green, blue, purple, pink, brown, gray, black
color _
Time for a new command! With clear you can clear all the text from your output screen. This way you can prevent your screen getting too full of text.
Beware! If you are using a clear command, you might need to use a sleep above it. Otherwise Hedy will clear your screen without giving you the time to read as you can see in the example!
Use the clear command to create a karaoke machine!
Exercise
Finish the karaoke version of 'Mary had a little lamb'.
Then, create a karaoke version of any song you'd like!
print 'Mary had a little lamb'
play E
play D
play C
play D
play E
play E
play E
clear
print 'Little lamb, little lamb'
play D
play D
play D
play E
play E
play E
clear
print 'Mary had a little lamb'
play E
Exercise
Copy the example code and finish it by adding quotation marks on the blanks in lines 1 and 2.
The blanks in line 3 and 4 should not be replaced by quotation marks, but a sleep and a clear command. Can you make it work?
Exercise 2
Go back to the previous level and copy your story code. Make the code work in this level by adding quotation marks in the right spots.
Mind: The variables in your own story should be outside of the quotation marks. Just like the second line of the example code. In that line the variable name is placed outside of the quotation marks.
name is ask _ What is your name? _
print _ The main character is called _ name
_
_
print name _ is now going to walk in the woods _
print name _ is a bit scared _
animals is 🦔, 🐿, 🦉, 🦇
print _ He hears the sound of a _ animals at random
print name _ is afraid this is a haunted forest _
In this level you learn how to use quotation marks in your games.
Exercise
Can you make your Haunted House level 4 proof?
Exercise 2
Go back to the previous level and copy your haunted house code. Make the code work in this level by adding quotation marks in the right spots.
_ Add quotation marks to this code _
print Escape from the haunted house!
print There are 3 doors in front of you...
choice is ask Which door do you choose?
print You picked door ... choice
monsters is a zombie, a vampire, NOTHING YOUVE ESCAPED
print You see...
sleep
print monsters at random
Exercise
We have removed all the quotation marks from this example code, can you add them in all the right places?
Exercise 2
Go back to the previous level and copy your fortune teller code. Make the code work in this level by adding quotation marks in the right spots.
_ Add the quotation marks to this code _
print Im Hedy the fortune teller!
question is ask What do you want to know?
print This is your question: question
answers is yes, no, maybe
print My crystal ball says...
sleep 2
print answers at random
In the restaurant you have to use quotation marks too when using the print or ask command.
Exercise
Add the quotation marks to this code to make it work! Be careful: variables should not be in quotation marks.
Then, use the clear command to only show one line at a time in your output screen.
Exercise 2
Go back to the previous level and copy your restaurant code. Make the code work in this level by adding quotation marks in the right spots and add some clear commands.
_ Add the quotation marks to this code _
print Welcome to Restaurant Chez Hedy!
print Today we are 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!
drinks is ask What would you like to drink with that?
print Thank you for your order.
print Your food and drinks will be right there!
Exercise
Debug this code. Good luck!
Warning! This code needs to be debugged!
print 'Welcome to the online library!
ask What genre of books do you like?
print You like genre
author is ask 'Who's your favorite author?'
print 'author is your favorite author'
print Hmmm... i think you should try... books at random