Print exactly using quotation marks
Give a name to some text and
Ask something with
In level 3
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
Most programming languages also use quotation marks when printing, so we are also getting a step closer to real programming!
You will find the commands on the left again, and assignments in the following tabs. The assignments are now getting more and more difficult in the successive tabs. So it is best to start on the left with the story, and work to the right, in order to be challenged more and more.
You may have noticed that there is still a problem in level 2. Did you try to print a sentence that contained the word name? You can solve that in level 3. You must use quotation marks for everything that you are going to print.
name is Hans print 'The name of the main character is' name print name 'is now going to walk in the woods' print name 'is a bit scared' animals is owl, hedgehog, armadillo print 'He hears the sound of an' animals at random print name 'is afraid this is a haunted forest'
In level 4 you have to use quotation marks with
ask. Also when drawing!
print 'Drawing figures' angle is 90 turn angle forward 25 turn angle forward 25
With quotation marks you can make your dishwashing planning more beautiful. This time the sample code is not quite complete.
Can you complete the code by filling the blanks? Every blank must be replaced with one word of symbol.
Tip: Don't forget the quotation marks!
people is mom, dad, Emma, Sophie print _ the dishes are done by _ print people at _
In level 3 we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code?
choices is 1, 2, 3, 4, 5, earthworm print _ you threw _ print _ _ _ <- here you have to program the choice
In level 3 we can further program rock, paper, scissors. But if you want to add text, you have to use quotation marks here too. Do you complete the code by entering the correct commands or characters on the underscores?
choices is rock, paper, scissors print _ The computer chose: _ _ at _
In level 3 you have to use quotation marks when using the
Be careful! In level 2 apostrophes were allowed in the text, but in level 3 Hedy will confuse them for quotation marks and the code will not work!
So instead of typing
print Today we're serving pizza , you should type
print 'Today we are serving pizza'
print 'Welcome to Hedys restaurant!' 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!'
Level 3 has no new functions, but allows you to practice with using the quotation marks. You can remake your level 2 code, and make sure to add the quotation marks in the right places!
Mind that in level 2, we couldn't use the word 'question' as both the name of the variable and a normal word that could be printed. The quotation marks in level 3 make this possible!
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 remove those apostrophes and change the spelling to Im or Whats.
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...' answers at random
In level 3 you learn how to use quotation marks in your games. Can you make your Haunted House level 3 proof?
In level 2 and 3 you've already learned to use
at random which made your games different every time you ran the code.
But it's not really interactive, the player doesn't have any influence on what happens in the game.
In level 4 you'll learn the
if command, that allows you to give different responses in your program. This way you can program a secret password for your computer for example.
So let's take a peak at level 4.
An error occurred.
An error occurred.