From fc065a223d12ea7fe94418ebf3e68a342a585c72 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 22:39:37 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- content/achievements/mi.yaml | 218 +- content/adventures/ca.yaml | 76 +- content/adventures/en.yaml | 96 +- content/adventures/fr.yaml | 76 +- content/adventures/mi.yaml | 5670 ++++++++++++++++++++++++++----- content/adventures/tr.yaml | 76 +- content/adventures/zh_Hans.yaml | 80 +- content/cheatsheets/mi.yaml | 512 ++- content/client-messages/mi.yaml | 36 +- content/keywords/mi.yaml | 102 +- content/pages/mi.yaml | 1382 +++++--- content/parsons/mi.yaml | 296 +- content/quizzes/fr.yaml | 55 +- content/quizzes/mi.yaml | 5503 +++++++++++++++++++----------- content/quizzes/zh_Hans.yaml | 27 +- content/slides/mi.yaml | 938 +++-- content/tutorials/mi.yaml | 94 +- 17 files changed, 10829 insertions(+), 4408 deletions(-) diff --git a/content/achievements/mi.yaml b/content/achievements/mi.yaml index 39e0e60338a..fc0a0958ff1 100644 --- a/content/achievements/mi.yaml +++ b/content/achievements/mi.yaml @@ -1,139 +1,139 @@ achievements: - my_class_my_rules: - text: Customize a class - title: My Class, my Rules - hedy-ious: - text: Print 10 times the same string without using a loop - title: Hedy-ious + adventure_is_worthwhile: + title: Adventure is Worthwhile + text: Store a program from an adventure + deadline_daredevil_I: + title: Deadline Daredevil I + text: Submit 1 Hedy program + deadline_daredevil_II: + title: Deadline Daredevil II + text: Submit 3 Hedy programs + deadline_daredevil_III: + title: Deadline Daredevil III + text: Submit 10 Hedy programs + detention: + title: Detention! + text: Remove a student from a class + did_you_say_please: + title: Did you say please? + text: Create a program with the 'ask' command + do_you_have_copy: + title: Do you have a copy? + text: Delete a saved program + double_check: + title: Double-check + text: Get a duplicate program name warning + end_of_semester: + title: End of Semester + text: Delete a class + epic_education: + title: Epic Education + text: Join a class + error_or_empty: + title: Error or empty? + text: Create a program that has no output + fresh_look: + title: Fresh Look + text: Change your profile picture + full_house: + title: Full House + text: Have a class with more than 20 students getting_started_I: title: Getting Started I text: Run 5 Hedy programs getting_started_II: - text: Run 10 Hedy programs title: Getting Started II - quiz_master: - text: Get the maximum score on a quiz - title: Quiz Master + text: Run 10 Hedy programs + getting_started_III: + title: Getting Started III + text: Run 50 Hedy programs getting_started_IV: title: Getting Started IV text: Run 200 Hedy programs - detention: - title: Detention! - text: Remove a student from a class - ring_the_bell: - text: Finish the teacher tutorial - title: Ring the Bell - programming_panic: - title: Programming Panic - text: Try to run a faulty program 3 times in a row - fresh_look: - title: Fresh Look - text: Change your profile picture - indiana_jones: - title: Indiana Jones - text: Search within the explore page - deadline_daredevil_II: - title: Deadline Daredevil II - text: Submit 3 Hedy programs - hedy_hacking: - text: Create a timeout due to your program running too long - title: Hedy Hacking + getting_started_V: + title: Getting Started V + text: Run 500 Hedy programs + go_live: + title: Let's Go Live + text: Create a public profile + hedy-ious: + title: Hedy-ious + text: Print 10 times the same string without using a loop hedy_certificate: title: Hedy Certificate of Completion text: Hedy Certificate of Completion - adventure_is_worthwhile: - text: Store a program from an adventure - title: Adventure is Worthwhile + hedy_hacking: + title: Hedy Hacking + text: Create a timeout due to your program running too long hedy_honor: title: Hedy Honor text: Run a program that prints the text 'Hedy' - one_to_remember_III: - text: Save 10 Hedy programs - title: One to Remember III - one_for_money: - text: Duplicate a class - title: One for the Money, Two for the Show - did_you_say_please: - text: Create a program with the 'ask' command - title: Did you say please? + indiana_jones: + title: Indiana Jones + text: Search within the explore page lets_focus: title: Let's Focus text: Turn on the programmers mode make_some_noise: - text: Let your program be read aloud title: Make Some Noise - one_to_remember_IV: - text: Save 25 Hedy programs - title: One to Remember IV - double_check: - text: Get a duplicate program name warning - title: Double-check - deadline_daredevil_I: - text: Submit 1 Hedy program - title: Deadline Daredevil I - one_to_remember_I: - text: Save 1 Hedy program - title: One to Remember I - one_to_remember_V: - text: Save 50 Hedy programs - title: One to Remember V - getting_started_V: - title: Getting Started V - text: Run 500 Hedy programs - deadline_daredevil_III: - title: Deadline Daredevil III - text: Submit 10 Hedy programs - epic_education: - title: Epic Education - text: Join a class - talk-talk-talk: - text: Create a program with a least 5 ask keywords - title: Talk-talk-talk + text: Let your program be read aloud + my_class_my_rules: + title: My Class, my Rules + text: Customize a class + next_question: + title: Next Question... + text: Finish a Hedy quiz + ninja_turtle: + title: Ninja Turtle + text: Create a program with the turtle on_second_thoughts: - text: Rename a class title: On Second Thoughts - do_you_have_copy: - title: Do you have a copy? - text: Delete a saved program - well_begun_is_half_done: - text: Finish the Hedy tutorial - title: Well begun is half done - trying_is_key: - text: Use all Hedy commands at least once - title: Gotta Use Them All - getting_started_III: - title: Getting Started III - text: Run 50 Hedy programs - watch_out: - text: Create a program that results in a (non-empty) warning - title: Watch out! + text: Rename a class + one_for_money: + title: One for the Money, Two for the Show + text: Duplicate a class + one_to_remember_I: + title: One to Remember I + text: Save 1 Hedy program one_to_remember_II: - text: Save 5 Hedy programs title: One to Remember II - end_of_semester: - text: Delete a class - title: End of Semester + text: Save 5 Hedy programs + one_to_remember_III: + title: One to Remember III + text: Save 10 Hedy programs + one_to_remember_IV: + title: One to Remember IV + text: Save 25 Hedy programs + one_to_remember_V: + title: One to Remember V + text: Save 50 Hedy programs + programming_panic: + title: Programming Panic + text: Try to run a faulty program 3 times in a row + programming_protagonist: + title: Programming Protagonist + text: Run a successful program after an error + quiz_master: + title: Quiz Master + text: Get the maximum score on a quiz ready_set_education: title: Ready, Set, Education! text: Create a class - ninja_turtle: - title: Ninja Turtle - text: Create a program with the turtle + ring_the_bell: + title: Ring the Bell + text: Finish the teacher tutorial sharing_is_caring: title: Sharing is Caring text: Share a saved program - programming_protagonist: - text: Run a successful program after an error - title: Programming Protagonist - error_or_empty: - title: Error or empty? - text: Create a program that has no output - go_live: - text: Create a public profile - title: Let's Go Live - full_house: - title: Full House - text: Have a class with more than 20 students - next_question: - title: Next Question... - text: Finish a Hedy quiz + talk-talk-talk: + title: Talk-talk-talk + text: Create a program with a least 5 ask keywords + trying_is_key: + title: Gotta Use Them All + text: Use all Hedy commands at least once + watch_out: + title: Watch out! + text: Create a program that results in a (non-empty) warning + well_begun_is_half_done: + title: Well begun is half done + text: Finish the Hedy tutorial diff --git a/content/adventures/ca.yaml b/content/adventures/ca.yaml index 958852cd600..57302889712 100644 --- a/content/adventures/ca.yaml +++ b/content/adventures/ca.yaml @@ -1415,35 +1415,35 @@ adventures: print 'Thanks for ordering!' ``` - start_code: |2 + start_code: |4 - define food_order - toppings = ask 'pepperoni, tuna, veggie or cheese?' - size = ask 'big, medium or small?' - number_of_pizza = ask 'How many these pizzas would you like?' + define food_order + toppings = ask 'pepperoni, tuna, veggie or cheese?' + size = ask 'big, medium or small?' + number_of_pizza = ask 'How many these pizzas would you like?' - print 'YOU ORDERED' - print number_of_pizzas ' size ' topping ' pizza' + print 'YOU ORDERED' + print number_of_pizzas ' size ' topping ' pizza' - define drinks_order - drink = ask 'water, coke, icetea, lemonade or coffee?' - number_of_drinks = ask 'How many of these drinks would you like?' + define drinks_order + drink = ask 'water, coke, icetea, lemonade or coffee?' + number_of_drinks = ask 'How many of these drinks would you like?' - print 'YOU ORDERED' - print number_of_drinks ' ' drink + print 'YOU ORDERED' + print number_of_drinks ' ' drink - 'Welcome to Hedy pizza' - more_food = ask 'Would you like to order a pizza?' - while more_food = 'yes' - return food_order - more_food = ask 'Would you like to order a pizza?' - more_drinks = ask 'Would you like to order some drinks?' - while more_drinks == 'yes' - call drink_order - more_drinks == ask 'Would you like to order more drinks?' + 'Welcome to Hedy pizza' + more_food = ask 'Would you like to order a pizza?' + while more_food = 'yes' + return food_order + more_food = ask 'Would you like to order a pizza?' + more_drinks = ask 'Would you like to order some drinks?' + while more_drinks == 'yes' + call drink_order + more_drinks == ask 'Would you like to order more drinks?' - print 'Thanks for ordering!' + print 'Thanks for ordering!' 18: story_text: |- ### Exercise @@ -1466,22 +1466,22 @@ adventures: print 'there a ' sound print 'everywhere a ' sound sound ``` - start_code: |2 - - animals = ['pig', 'dog', 'cow'] - sounds = ['oink', 'woof', 'moo'] - for i in range 1 to 3 - animal = animals[i] - sound = sounds[i] - print 'Old McDonald had a farm' - print 'E I E I O!' - print 'and on that farm he had a ' animal - print 'E I E I O!' - print 'with a ' sound sound ' here' - print 'and a ' sound sound ' there' - print 'here a ' sound - print 'there a ' sound - print 'everywhere a ' sound sound + start_code: |4 + + animals = ['pig', 'dog', 'cow'] + sounds = ['oink', 'woof', 'moo'] + for i in range 1 to 3 + animal = animals[i] + sound = sounds[i] + print 'Old McDonald had a farm' + print 'E I E I O!' + print 'and on that farm he had a ' animal + print 'E I E I O!' + print 'with a ' sound sound ' here' + print 'and a ' sound sound ' there' + print 'here a ' sound + print 'there a ' sound + print 'everywhere a ' sound sound default: name: Introducció default_save_name: intro diff --git a/content/adventures/en.yaml b/content/adventures/en.yaml index 02677e02fee..592731d7e5b 100644 --- a/content/adventures/en.yaml +++ b/content/adventures/en.yaml @@ -178,7 +178,8 @@ adventures: ``` start_code: '# place your code here' 9: - story_text: "In this level you can use `{if}` and `{repeat}` commands inside other `{if}` and `{repeat}` commands. \nThis gives you many options and really helps you to make your story interactive.\n\n### Exercise 1\nFinish the code so the `{if}` works correctly.\n\n### Exercise 2\nAdd an `{if}` and `{else}` for the part of the story where Robin goes home too.\n\n### Exercise 3\nGo back to your level 8 story and use at least two `{if}`s inside another `{if}`.\n" + story_text: "In this level you can use `{if}` and `{repeat}` commands inside other `{if}` and `{repeat}` commands. \nThis gives you many options and really helps you to make your story interactive.\n\n### Exercise 1\nFinish the code so the `{if}` works correctly.\n\n### Exercise 2\nAdd\ + \ an `{if}` and `{else}` for the part of the story where Robin goes home too.\n\n### Exercise 3\nGo back to your level 8 story and use at least two `{if}`s inside another `{if}`.\n" example_code: | ``` {print} 'Robin is walking downtown' @@ -1437,35 +1438,35 @@ adventures: print 'Thanks for ordering!' ``` - start_code: |2 + start_code: |4 - define food_order - toppings = ask 'pepperoni, tuna, veggie or cheese?' - size = ask 'big, medium or small?' - number_of_pizza = ask 'How many these pizzas would you like?' + define food_order + toppings = ask 'pepperoni, tuna, veggie or cheese?' + size = ask 'big, medium or small?' + number_of_pizza = ask 'How many these pizzas would you like?' - print 'YOU ORDERED' - print number_of_pizzas ' size ' topping ' pizza' + print 'YOU ORDERED' + print number_of_pizzas ' size ' topping ' pizza' - define drinks_order - drink = ask 'water, coke, icetea, lemonade or coffee?' - number_of_drinks = ask 'How many of these drinks would you like?' + define drinks_order + drink = ask 'water, coke, icetea, lemonade or coffee?' + number_of_drinks = ask 'How many of these drinks would you like?' - print 'YOU ORDERED' - print number_of_drinks ' ' drink + print 'YOU ORDERED' + print number_of_drinks ' ' drink - 'Welcome to Hedy pizza' - more_food = ask 'Would you like to order a pizza?' - while more_food = 'yes' - return food_order - more_food = ask 'Would you like to order a pizza?' - more_drinks = ask 'Would you like to order some drinks?' - while more_drinks == 'yes' - call drink_order - more_drinks == ask 'Would you like to order more drinks?' + 'Welcome to Hedy pizza' + more_food = ask 'Would you like to order a pizza?' + while more_food = 'yes' + return food_order + more_food = ask 'Would you like to order a pizza?' + more_drinks = ask 'Would you like to order some drinks?' + while more_drinks == 'yes' + call drink_order + more_drinks == ask 'Would you like to order more drinks?' - print 'Thanks for ordering!' + print 'Thanks for ordering!' 18: story_text: |- ### Exercise @@ -1488,22 +1489,22 @@ adventures: print 'there a ' sound print 'everywhere a ' sound sound ``` - start_code: |2 - - animals = ['pig', 'dog', 'cow'] - sounds = ['oink', 'woof', 'moo'] - for i in range 1 to 3 - animal = animals[i] - sound = sounds[i] - print 'Old McDonald had a farm' - print 'E I E I O!' - print 'and on that farm he had a ' animal - print 'E I E I O!' - print 'with a ' sound sound ' here' - print 'and a ' sound sound ' there' - print 'here a ' sound - print 'there a ' sound - print 'everywhere a ' sound sound + start_code: |4 + + animals = ['pig', 'dog', 'cow'] + sounds = ['oink', 'woof', 'moo'] + for i in range 1 to 3 + animal = animals[i] + sound = sounds[i] + print 'Old McDonald had a farm' + print 'E I E I O!' + print 'and on that farm he had a ' animal + print 'E I E I O!' + print 'with a ' sound sound ' here' + print 'and a ' sound sound ' there' + print 'here a ' sound + print 'there a ' sound + print 'everywhere a ' sound sound default: name: Introduction default_save_name: intro @@ -2580,7 +2581,8 @@ adventures: ``` start_code: '# place your code here' 9: - story_text: "In this level you can use nesting, which allows you to make the haunted house even more interactive!\n\n### Exercise\nNow it's very hard to win this game, can you make it easier to win?\nChange your code so it only has one wrong door and two correct doors instead of one correct door and two wrong ones? \nTip: This means changing the variable correct_door into wrong_door, and switching the `{if}` and `{else}` code.\nAnd of course you may also change the story and make it your own. Change the monsters or make it a happy game show where you get a gift!\n" + story_text: "In this level you can use nesting, which allows you to make the haunted house even more interactive!\n\n### Exercise\nNow it's very hard to win this game, can you make it easier to win?\nChange your code so it only has one wrong door and two correct doors instead of one correct\ + \ door and two wrong ones? \nTip: This means changing the variable correct_door into wrong_door, and switching the `{if}` and `{else}` code.\nAnd of course you may also change the story and make it your own. Change the monsters or make it a happy game show where you get a gift!\n" example_code: | ``` {print} 'Escape from the Haunted House!' @@ -2604,7 +2606,9 @@ adventures: ``` start_code: '{print} ''Escape from the haunted house!''' 11: - story_text: "In this level we've changed the `{for}` command so we can tell the player where they are. \n\n### Exercise 1\nFinish the program so the player knows which room they are in.\n\n### Exercise 2\nMake the program into an adventure by following these steps:\n\n1. Make a list of choices (like: fight or flight)\n2. Make sure the player can choose an option with `{ask}`\n3. Is answer correct? Then they may proceed to the next monster. Do they give a wrong answer? Let the player know with a `{print}`. \n\n**Extra** If you make a wrong choice, a monster is still shown! How could you change that?\n" + story_text: "In this level we've changed the `{for}` command so we can tell the player where they are. \n\n### Exercise 1\nFinish the program so the player knows which room they are in.\n\n### Exercise 2\nMake the program into an adventure by following these steps:\n\n1. Make a list of\ + \ choices (like: fight or flight)\n2. Make sure the player can choose an option with `{ask}`\n3. Is answer correct? Then they may proceed to the next monster. Do they give a wrong answer? Let the player know with a `{print}`. \n\n**Extra** If you make a wrong choice, a monster is still\ + \ shown! How could you change that?\n" example_code: | ``` {print} 'Escape from the Haunted House!' @@ -3725,7 +3729,9 @@ adventures: **Extra** Add even more items, as many options as you like! start_code: '# place your code here' 9: - story_text: "In this level you can use nesting to make your restaurant more realistic and more fun!\n\n### Exercise\nThe indentation was removed in the example code. \nCan you figure out how much indentation each line needs in order for the code to work properly?\nIf the customer orders pizza, Hedy shouldn't ask what sauce the costumer wants.\n\n**Extra** A restaurant does not stock all sauces. Make a list of available sauces and give a reply with each order whether you sell it.
\n**Extra** Pizzas have toppings. Ask customers what they want.
\n**Extra** Do customers want a drink? Ask them too!
\n" + story_text: "In this level you can use nesting to make your restaurant more realistic and more fun!\n\n### Exercise\nThe indentation was removed in the example code. \nCan you figure out how much indentation each line needs in order for the code to work properly?\nIf the customer orders\ + \ pizza, Hedy shouldn't ask what sauce the costumer wants.\n\n**Extra** A restaurant does not stock all sauces. Make a list of available sauces and give a reply with each order whether you sell it.
\n**Extra** Pizzas have toppings. Ask customers what they want.
\n**Extra** Do\ + \ customers want a drink? Ask them too!
\n" example_code: | ``` {print} 'Welcome to Restaurant Chez Hedy!' @@ -3941,7 +3947,8 @@ adventures: Fill in the correct code on the blanks to see if it is a draw. start_code: '{print} ''Welcome to your own rock scissors paper!''' 9: - story_text: "In this level you can program the whole rock, paper, scissors game by nesting the `{if}` commands. \n\n### Exercise\nCan you finish the code? The program must tell who has won for every combination.\n\n**Extra** Want to play more than one game? Expand the code so that you can play multiple rounds. You can even use an `{ask}` to ask the user how many rounds they want to play.\n" + story_text: "In this level you can program the whole rock, paper, scissors game by nesting the `{if}` commands. \n\n### Exercise\nCan you finish the code? The program must tell who has won for every combination.\n\n**Extra** Want to play more than one game? Expand the code so that you\ + \ can play multiple rounds. You can even use an `{ask}` to ask the user how many rounds they want to play.\n" example_code: | ``` choices = rock, paper, scissors @@ -4757,7 +4764,8 @@ adventures: ``` start_code: '{print} ''Drawing figures''' 8: - story_text: "Now that we can repeat several lines, we can make figures more easily.\nWe only have to set the angle once and then use that variable in the `{repeat}`.\n\n### Exercise 1\nThe example code creates a square. Change the code so that it create another figure, such as a triangle or a hexagon. \nThis requires a change to two lines of code.\nTip: An entire circle is 360 degrees.\n\n### Exercise 2\nNow create a drawing consisting of at least two polygons.\n" + story_text: "Now that we can repeat several lines, we can make figures more easily.\nWe only have to set the angle once and then use that variable in the `{repeat}`.\n\n### Exercise 1\nThe example code creates a square. Change the code so that it create another figure, such as a triangle\ + \ or a hexagon. \nThis requires a change to two lines of code.\nTip: An entire circle is 360 degrees.\n\n### Exercise 2\nNow create a drawing consisting of at least two polygons.\n" example_code: | ``` angle = 90 diff --git a/content/adventures/fr.yaml b/content/adventures/fr.yaml index fcf71a0bec3..0b51b134cca 100644 --- a/content/adventures/fr.yaml +++ b/content/adventures/fr.yaml @@ -1395,35 +1395,35 @@ adventures: print 'Thanks for ordering!' ``` - start_code: |2 + start_code: |4 - define food_order - toppings = ask 'pepperoni, tuna, veggie or cheese?' - size = ask 'big, medium or small?' - number_of_pizza = ask 'How many these pizzas would you like?' + define food_order + toppings = ask 'pepperoni, tuna, veggie or cheese?' + size = ask 'big, medium or small?' + number_of_pizza = ask 'How many these pizzas would you like?' - print 'YOU ORDERED' - print number_of_pizzas ' size ' topping ' pizza' + print 'YOU ORDERED' + print number_of_pizzas ' size ' topping ' pizza' - define drinks_order - drink = ask 'water, coke, icetea, lemonade or coffee?' - number_of_drinks = ask 'How many of these drinks would you like?' + define drinks_order + drink = ask 'water, coke, icetea, lemonade or coffee?' + number_of_drinks = ask 'How many of these drinks would you like?' - print 'YOU ORDERED' - print number_of_drinks ' ' drink + print 'YOU ORDERED' + print number_of_drinks ' ' drink - 'Welcome to Hedy pizza' - more_food = ask 'Would you like to order a pizza?' - while more_food = 'yes' - return food_order - more_food = ask 'Would you like to order a pizza?' - more_drinks = ask 'Would you like to order some drinks?' - while more_drinks == 'yes' - call drink_order - more_drinks == ask 'Would you like to order more drinks?' + 'Welcome to Hedy pizza' + more_food = ask 'Would you like to order a pizza?' + while more_food = 'yes' + return food_order + more_food = ask 'Would you like to order a pizza?' + more_drinks = ask 'Would you like to order some drinks?' + while more_drinks == 'yes' + call drink_order + more_drinks == ask 'Would you like to order more drinks?' - print 'Thanks for ordering!' + print 'Thanks for ordering!' 18: story_text: |- ### Exercise @@ -1446,22 +1446,22 @@ adventures: print 'there a ' sound print 'everywhere a ' sound sound ``` - start_code: |2 - - animals = ['pig', 'dog', 'cow'] - sounds = ['oink', 'woof', 'moo'] - for i in range 1 to 3 - animal = animals[i] - sound = sounds[i] - print 'Old McDonald had a farm' - print 'E I E I O!' - print 'and on that farm he had a ' animal - print 'E I E I O!' - print 'with a ' sound sound ' here' - print 'and a ' sound sound ' there' - print 'here a ' sound - print 'there a ' sound - print 'everywhere a ' sound sound + start_code: |4 + + animals = ['pig', 'dog', 'cow'] + sounds = ['oink', 'woof', 'moo'] + for i in range 1 to 3 + animal = animals[i] + sound = sounds[i] + print 'Old McDonald had a farm' + print 'E I E I O!' + print 'and on that farm he had a ' animal + print 'E I E I O!' + print 'with a ' sound sound ' here' + print 'and a ' sound sound ' there' + print 'here a ' sound + print 'there a ' sound + print 'everywhere a ' sound sound default: name: Introduction default_save_name: intro diff --git a/content/adventures/mi.yaml b/content/adventures/mi.yaml index 5f4d3f5708c..c6992c36072 100644 --- a/content/adventures/mi.yaml +++ b/content/adventures/mi.yaml @@ -1,1083 +1,4901 @@ adventures: - restaurant: + story: + name: Story + default_save_name: Story + description: Story levels: 1: - story_text: "In level 1 you can make your own virtual restaurant and take your guests' orders.\n" - start_code: '# place your code here' - story_text_2: "### Exercise\nCopy the example code into your input screen by clicking the yellow button.\nFirstly, fill in the correct command on the blanks to make to code work properly.\nThen add at least 4 more lines of code to the restaurant program.\nAsk the costumer what they would like to drink and ask if they want to pay with cash or card.\nLastly, think of a nice way to say goodbye to your costumer.\n" - example_code: "```\n{print} Welcome to Hedy's restaurant 🍟\n_ What would you like to order?\n{echo} So you would like to order\n{print} Thank you for your order!\n{print} It's on its way!\n```\n" - 8: - start_code: '# place your code here' - story_text_2: "### Exercise\nThis code can be expanded with more items on the menu, for example offering drinks, and/or multiple courses or desserts. Add at least one more item.\n**Extra** Add even more items, as many options as you like!\n" - story_text: "In this level you can make your virtual restaurant more elaborate by repeating multiple lines of code. Like this:\n" - example_code: "```\n{print} 'Welcome to Restaurant Chez Hedy!'\npeople = {ask} 'How many people will be joining us today?'\n{print} 'Great!'\n{repeat} people {times}\n food = {ask} 'What would you like to order?'\n {print} food\n{print} 'Thank you for ordering!'\n{print} 'Enjoy your meal!'\n```\n" - 10: - story_text: "In this level you'll learn how to easily ask orders for different courses.\n\n### Exercise 1\nFinish the code with an `{ask}` on the blanks such that the customer is asked what they want to eat for each course.\n" - example_code_2: "```\n_ courses = appetizer, main course, dessert\n_ names = Timon, Onno\n_ {for} name {in} names\n_ {for} course {in} courses\n_ food = {ask} name ', what would you like to eat as your ' course '?'\n_ {print} name ' orders ' food ' as their ' course\n```\n" - start_code: courses = appetizer, main course, dessert - story_text_2: "### Exercise\nOf course, you could also order for multiple people!\nCan you add the correct amount of indentation before each line to make the code work properly?\nTip: some lines don't need any indentation at all.\n" - example_code: "```\ncourses = appetizer, main course, dessert\n{for} course {in} courses\n {print} 'What is your order for ' course '?'\n _ \n _\n```\n" - 3: - story_text_2: "### Exercise\nNow make your own version of the random restaurant.\nMake a list of starts, mains, desserts, drinks and prices yourself.\nThen use `{print}` and `{at} {random}` commands to tell the costumer what will be on their menu tonight.\n" - start_code: '# place your code here' - example_code: "```\ndishes {is} spaghetti, brussels sprouts, hamburgers\n{print} You will have dishes {at} {random} tonight!\nprices {is} 1 euro, 10 euros, 100 euros\n{print} That will be prices {at} {random} please.\n```\n" - story_text: "Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you!\nSimply add lists of your favorite (or least favorite) meals and Hedy can randomly choose your dinner.\nYou can also have a bit of fun, by letting Hedy choose the price for your dinner as well! What will you get?\n" - example_code_2: "```\n{print} Welcome to your own random restaurant!\nstarters {is} _\nmains {is} _\ndesserts {is} _\ndrinks {is} _\nprices {is} _\n_\n```\n" - 15: - story_text: "With the `{while}` you can make sure your costumers can keep adding orders until they are done.\n\n### Exercise\nCorrectly add the `{while}` command to this code.\n" - example_code: "```\n{print} 'Welcome at McHedy'\nmore = 'yes'\n_\n order = {ask} 'What would you like to order?'\n {print} order\n more = {ask} 'Would you like to order anything else?'\n{print} 'Thank you!'\n```\n" - start_code: '# place your code here' + story_text: | + In level 1 you can make a story with a different main character that you enter yourself. + + In the first line, use `{ask}` and ask who the main character of the story will be. + + After that first line, start with `{print}` if the sentence needs to be printed. + You use `{echo}` if you want your main character to be at the end of the sentence. + example_code: | + ``` + {ask} The main character of this story is + {print} The main character is now going to walk in the forest + {echo} He's a bit scared, + {print} He hears crazy noises everywhere + {print} He's afraid this is a haunted forest + ``` + story_text_2: | + ### Exercise + Now create your own story of at least 6 lines of code. + This story cannot be the same as the example code. + Use at least one `{ask}` and one `{echo}` command. + You can make it about any topic you like. + If you can't think of a topic, use one of our choices: going to the movies, a sports match or a day at the zoo. + start_code: '{print} Your story starts here' 2: - story_text_2: "### Exercise\nCopy your own restaurant code from to previous level to the input screen below.\nFix the code by replacing the `{ask}` and `{echo}` commands and using variables, like you've learned in this level.\n\nNow that your code is working again, it's time to add something more.\nLook at the last line of the example code: `{print} food with topping is on its way!`\nIn this single line 2 variables have been used to create a summary of the order.\nNow add your own summary of the food and drinks ordered by the customer.\n\n**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.?\n" - story_text: "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.\nNow you can use variables and Hedy can remember both the food and the toppings!\n" - example_code: "```\n{print} Welcome to Hedy's restaurant!\n{print} Today we're serving pizza or lasagna.\nfood {is} {ask} What would you like to eat?\n{print} Great choice! The food is my favorite!\ntopping {is} {ask} Would you like meat or veggies on that?\n{print} food with topping is on its way!\n```\n" - start_code: '# place your code here' + story_text: | + 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. + example_code: |- + ``` + 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 he hears a crazy noise... + {sleep} + {print} name is afraid this is a haunted forest + ``` + story_text_2: | + ### 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. + start_code: '{print} Your story' + 3: + story_text: | + In level 3 you can make your story more fun. You can use randomness for any monster, animal or other obstacle, like this: + example_code: | + ``` + animals {is} 🦔, 🐿, 🦉, 🦇 + {print} He now hears the sound of an animals {at} {random} + ``` + story_text_2: | + The command `{add}` can also come in handy in your story. + example_code_2: | + ``` + {print} He hears a sound + animals {is} 🐿, 🦔, 🦇, 🦉 + animal {is} {ask} What do you think it is? + {add} animal {to_list} animals + {print} it was an animals {at} {random} + ``` + story_text_3: | + This is an example of the `{remove}` command in your story + + ### Exercise + Copy your story from the previous levels into this level. + In this level you've learned 3 new commands `{at} {random}` , `{add} {to}` and `{remove} {from}`. + Add new lines of code to your story, so that all of the new commands are featured at least once in your story. + example_code_3: | + ``` + {print} His backpack got way too heavy. + {print} Inside were a bottle of water, a flashlight and a brick. + bag {is} water, flashlight, brick + dump {is} {ask} Which item should he dump? + {remove} dump {from} bag + ``` + start_code: '{print} Your story' + 4: + story_text: | + You may have noticed that there is still a problem in the previous levels. Did you try to print a sentence that contained the word name? i.e. `{print}` my name is name. + You can solve that in this level. You must use quotation marks for everything that you are going to print. + + ### 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. + example_code: | + ``` + 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 _ + ``` + start_code: '{print} ''Your story will be printed here!''' + 5: + story_text: | + In this level you can program different endings, which will make your story even more fun. + In the example code you can see how to make 2 different endings. + + ### Exercise 1 + Write a new short story of at least 6 lines of code about a topic of your choosing. + No inspiration? Choose one of these topics: a superhero, a boring school day, stranded on a desert island. + + Now give the player a change to choose a happy or a bad end, just like in the example code. + Program both the endings. + + ### Exercise 2 + Copy the story you've created in your own story adventure in the previous levels. + Find a way to add at least 2 `{if}` and `{else}` commands to your story. + This can be with a happy or bad ending, but you can also try to find other ways to incoporate the commands. + example_code: | + ``` + name {is} {ask} 'Who is walking in the forest?' + {print} name ' walks through the forest' + {print} name ' encounters a monster' + end {is} {ask} 'Would you like a good or a bad ending?' + {if} end {is} good {print} name ' takes the sword and the monster quickly runs away' + {else} {print} 'The monster eats ' name + ``` + start_code: '{print} ''Here your story will start!''' 7: - story_text: "In this level you've learned how to use the `{repeat}` command to repeat a line of code a certain amount of times.\nYou can use that in your restaurant to `{ask}` multiple people what they'd like to eat.\n\n### Exercise\nCan you complete the code? Hedy needs to repeat this question as many times as there are people. So if there are 5 people, the question needs to be asked 5 times.\n**Extra** Expand your code with more questions, for example about drinks or sauce.\n" + story_text: | + In a story, someone says words several times. For example, when someone calls for help or sings a song. + You can put such repetitions in your story, in this level with `{repeat}`. + + ### Exercise + Add repetition to your own story. Go back to your saved programs, choose your story program from a previous level and + find a line containing `{print}` and repeat it! + example_code: | + ``` + {print} 'The prince kept calling for help' + {repeat} 5 {times} {print} 'Help!' + {print} 'Why is nobody helping me?' + ``` + start_code: '{repeat} 5 {times} {print} ''Help!''' + 8: + story_text: | + In this level you can use multiple lines in your `{if}` commands, this way you can upgrade your happy or sad ending! + + ### Exercise 1 + The example code shows two different endings; one where the characters jump in a time machine and one where they do not. + Complete the blanks with at least one sentence per ending. + **Extra** Make the story longer. What happens in the story? You can also add a second `{ask}` with different options. + + ### Exercise 2 + Go back to your saved programs, choose your story program from level 5. Now write a good and a bad ending of at least three lines long each! + example_code: | + ``` + {print} 'OH NO! The T-rex is closing in!' + end = {ask} 'Do you want a happy or a sad ending?' + {if} end {is} happy + {print} 'Just in time Richard jumps back into the time machine!' + {print} _ + {else} + {print} 'Oh no! Richard is too slow...' + {print} _ + ``` start_code: '# place your code here' - example_code: "```\n{print} 'Welcome to Restaurant Chez Hedy'\npeople = {ask} 'How many people are joining us today?'\n```\n" - 4: - story_text: "In this level you have to use quotation marks when using the `{print}` or `{ask}` command.\n\n### Exercise\nAdd the quotation marks to this code to make it work! Be careful: variables should not be in quotation marks.\nThen, use the `{clear}` command to only show one line at a time in your output screen.\n\n### Exercise 2\nGo 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.\n" - example_code: "```\n_ Add the quotation marks to this code _\n{print} Welcome to Restaurant Chez Hedy!\n{print} Today we are serving pizza or lasagna.\nfood {is} {ask} What would you like to eat?\n{print} Great choice! The food is my favorite!\ntopping {is} {ask} Would you like meat or veggies on that?\n{print} food with topping is on its way!\ndrinks {is} {ask} What would you like to drink with that?\n{print} Thank you for your order.\n{print} Your food and drinks will be right there!\n```\n" + 9: + story_text: "In this level you can use `{if}` and `{repeat}` commands inside other `{if}` and `{repeat}` commands. \nThis gives you many options and really helps you to make your story interactive.\n\n### Exercise 1\nFinish the code so the `{if}` works correctly.\n\n### Exercise 2\nAdd\ + \ an `{if}` and `{else}` for the part of the story where Robin goes home too.\n\n### Exercise 3\nGo back to your level 8 story and use at least two `{if}`s inside another `{if}`.\n" + example_code: | + ``` + {print} 'Robin is walking downtown' + location = {ask} 'Is Robin going into a shop, or does she go home?' + {if} location {is} shop + {print} 'She enters the shop.' + {print} 'Robin sees an interesting looking book' + book = {ask} 'Does Robin buy the book?' + {if} book {is} yes + _ {print} 'Robin buys the book and goes home' + _ {else} + _ {print} 'Robin leaves the shop and goes home' + {else} + {print} 'Robin goes home' + ``` start_code: '# place your code here' - 6: - example_code: "You can make a simple restaurant code, like this:\n```\n{print} 'Welcome to Restaurant Chez Hedy'\n{print} 'Here is our menu:'\n{print} 'Our main courses are pizza, lasagne, or spaghetti'\nmain = {ask} 'Which main course would you like?'\nprice = 0\n{if} main {is} pizza price = 10\n{if} main {is} lasagne price = 12\n{if} main {is} spaghetti price = 8\n{print} 'You have ordered ' main\n{print} 'That will be ' price ' dollars, please'\n{print} 'Thank you, enjoy your meal!'\n```\n" + 10: + story_text: | + In this level you can use the {for} command in your story. In this way you could easily program the children's book 'Brown bear, Brown bear, what do you see'. + + ### Exercise + + Look at the story if you do not know it, and make sure it is printed as in the book. + example_code: "```\nanimals = _ , _ , _ \n{print} 'Brown bear, Brown bear'\n{print} 'What do you see?'\n```\n" start_code: '# place your code here' - story_text: "In this level you can use maths to calculate the total price of your customer's order, which can make your virtual restaurant more realistic.\nBut you can also add many more things to your virtual restaurant, for example more courses.\n\n### Exercise\nYou can add many more things to your virtual restaurant. For example, can you...\n- ask how many people are coming and multiply the price by that amount?\n- add another course?\n- give people a discount when they enter a (secret) couponcode?\n- add a children's menu?\n- think of other fun things to add?\n" 12: - example_code: "```\nprice = 0.0\nfood = {ask} 'What would you like to order?'\ndrink = {ask} 'What would you like to drink?'\n{if} food {is} 'hamburger'\n price = price + 6.50\n{if} food {is} 'pizza'\n price = price + 5.75\n{if} drink {is} 'water'\n price = price + 1.20\n{if} drink {is} 'soda'\n price = price + 2.35\n{print} 'That will be ' price ' dollar, please'\n```\n" - story_text: "From this level on you can use decimal numbers to make you menu more realistic.\n\n### Exercise\nCan you think of a code to give your friends and family a 15% discount?\n" - start_code: '# place your code here' - 11: - example_code: "```\n{print} 'Welcome to Restaurant Hedy!'\npeople = {ask} 'For how many people would you like to order?'\n{print} 'So you want to order for ' people ' people.'\n{print} \"Let's go!\"\n```\n" - story_text: "We can use the `{for}` with `{range}` to print the orders from multiple customers in an orderly manner.\n\n### Exercise\nFinish the restaurant code, so that you can ask for the order of multiple people. Print the order number each time: 'Order 1', 'Order 2', etc.\nAre you not sure how to go about this? Have a peek at your level 8 code.\n\n**Extra** In level 9 the restaurant also used prices. You can add that here too!\n" - start_code: '# place your code here' - 5: - story_text: "### Exercise\nThe example code shows how you could program that you've run out of a menu item in your restaurant.\nCopy your own restaurant code from the previous levels. Create a problem in your restaurant and code it, like the example code did.\nFor instance, you could also run out of a menu item, or you don't take credit cards, or the ice cream machine is broken.\n\n**Extra** Have you programmed the problem and programmed appropriate responses? Then try to add more `{if}` and `{else}` commands into your code.\nTry to add an `{if}` after every `{ask}` command in your code to make the code as interactive as possible!\n" - example_code: "```\ndrinks_in_stock {is} water, lemonade, cola, orange juice\ndrink {is} {ask} 'What would you like to drink?'\n{if} drink {in} drinks_in_stock {print} 'One ' drink 'coming up!'\n{else} {print} 'Sorry, we do not sell that'\n```\n" + story_text: |- + In this level quotation marks will be needed to save multiple words in a variable. + + ### Exercise + + Find a story from a previous level, any level is ok. Now make sure quotation marks are added in the right places. + example_code: | + ``` + name = 'The Queen of England' + {print} name ' was eating a piece of cake, when suddenly...' + ``` start_code: '# place your code here' 13: - story_text: "In this level you will learn new commands to extend your code even further.\n\n### Exercise 1\nPlace a `{and}` and a `{or}` in the logical place in the program.\n\n### Exercise 2\nExpand your restaurant with at least one more `{and}` and one `{or}`.\nFor example, create a special discount coupon that only applies to pizza, or give your customer a free drink\nwith fries and pancakes. Or something completely different of course!\n" + story_text: | + By using the `{and}` and `{or}` commands, you can make your stories more versatile. You can ask two questions and respond to the combination of answers. + + ### Exercise 1 + Look at the example code and finish it. Then add at least 2 more `{if}` codes with `{and}` or `{or}`. + + ### Exercise 2 + Find a story from a previous level, and add one `{and}` or `{or}`. + example_code: | + ``` + {print} 'Our hero is walking through the forest' + {print} 'The path splits two ways' + path = {ask} 'Which path should she choose?' + weapon = {ask} 'What weapon does she draw?' + {if} path {is} 'left' {and} weapon {is} 'sword' + _ + ``` start_code: '# place your code here' - example_code: "```\nprice = 10\nfood = {ask} 'What would you like to eat?'\ndrinks = {ask} 'What would you like to drink?'\n{if} food {is} 'sandwich' _ drinks {is} 'juice'\n {print} 'That is our discount menu'\n price = price - 3\n{if} drinks {is} 'water' _ drinks {is} 'juice'\n {print} 'That is a healthy choice'\n{print} 'That will be ' price ' dollars'\n```\n" - 9: + 15: + story_text: | + Using the `{while}` loop can make your stories more interesting. For example, you can use `{while} game == 'on'` so you can play until the game is over. + Or you can use `{while} sword == 'lost'` so the player can't continue the game until they have found something. + + ### Exercise + The example code shows you how to use the `{while}` loop in a story. Now **think of your own scenario** in which the player has to find something before they can continue. + example_code: | + ``` + keys = 'lost' + {print} 'You are standing in your garden and you have lost your keys.' + {print} 'Where do you want to look for them?' + {print} 'You can choose: tree, flowerbed, rock, postbox' + {while} keys == 'lost' + location = {ask} 'Where do you want to look?' + {if} location == 'flowerbed' + {print} 'Here they are!' + keys = 'found' + {else} + {print} 'Nope they are not at the ' location + {print} 'Now you can enter the house!' + ``` start_code: '# place your code here' - story_text: "In this level you can use nesting to make your restaurant more realistic and more fun!\n\n### Exercise\nThe indentation was removed in the example code. \nCan you figure out how much indentation each line needs in order for the code to work properly?\nIf the customer orders pizza, Hedy shouldn't ask what sauce the costumer wants.\n\n**Extra** A restaurant does not stock all sauces. Make a list of available sauces and give a reply with each order whether you sell it.
\n**Extra** Pizzas have toppings. Ask customers what they want.
\n**Extra** Do customers want a drink? Ask them too!
\n" - example_code: "```\n{print} 'Welcome to Restaurant Chez Hedy!'\npeople = {ask} 'How many people will be joining us today?'\n{print} 'Great!'\nprice = 0\n{repeat} people {times}\n_ food = {ask} 'What would you like to order?'\n_ {print} food\n_ {if} food {is} fries\n_ price = price + 3\n_ sauce = {ask} 'What kind of sauce would you like with your fries?'\n_ {if} sauce {is} no\n_ {print} 'no sauce'\n_ {else}\n_ price = price + 1\n_ {print} 'with ' sauce\n_ {if} food {is} pizza\n_ price = price + 4\n{print} 'That will be ' price ' dollar'\n{print} 'Enjoy your meal!'\n```\n" - description: Create your own virtual restaurant - name: Restaurant - default_save_name: Restaurant - story: + 18: + story_text: | + We are going to print another story, but now we have to use brackets with `{print}`. + + ### Exercise 1 + Create a story of at least 5 sentences. You don't have to use 'name' just yet. + example_code: | + ``` + {print}('Welcome to this story!') + ``` + story_text_2: | + ### Exercise 2 + We have already prepared an `{input}` for you. First, use the `name` variable in your story. + Then add a second `{ask}` and use that variable as well. + Tip: Remember the commas in a `{print}` between text and variables! + example_code_2: | + ``` + naam = {input}("What's your name?") + {print}('Welcome to this story!') + ``` + start_code: '# place your code here' + add_remove_command: + name: '{add} {to} & {remove} {from}' + default_save_name: add_remove_command + description: introducing add to and remove from levels: 3: - example_code: "```\nanimals {is} 🦔, 🐿, 🦉, 🦇\n{print} He now hears the sound of an animals {at} {random}\n```\n" - example_code_2: "```\n{print} He hears a sound\nanimals {is} 🐿, 🦔, 🦇, 🦉\nanimal {is} {ask} What do you think it is?\n{add} animal {to_list} animals\n{print} it was an animals {at} {random}\n```\n" - example_code_3: "```\n{print} His backpack got way too heavy.\n{print} Inside were a bottle of water, a flashlight and a brick.\nbag {is} water, flashlight, brick\ndump {is} {ask} Which item should he dump?\n{remove} dump {from} bag\n```\n" - story_text: "In level 3 you can make your story more fun. You can use randomness for any monster, animal or other obstacle, like this:\n" - story_text_2: "The command `{add}` can also come in handy in your story.\n" - start_code: '{print} Your story' - story_text_3: "This is an example of the `{remove}` command in your story\n\n### Exercise\nCopy your story from the previous levels into this level.\nIn this level you've learned 3 new commands `{at} {random}` , `{add} {to}` and `{remove} {from}`.\nAdd new lines of code to your story, so that all of the new commands are featured at least once in your story.\n" + story_text: | + ## Add to + You can add items to the list with the `{add} {to}` command. To add an item to a list you can simply type: `{add} penguin {to} animals` or you can use the `{ask}` command like in the example code. + example_code: | + ``` + animals {is} dog, cat, kangaroo + like {is} {ask} What is your favorite animal? + {add} like {to_list} animals + {print} I choose animals {at} {random} + ``` + story_text_2: | + ## Remove from + If you can add items to a list, of course you can also take them off. This is done with the `{remove} {from}` command. + example_code_2: | + ``` + animals {is} dog, cat, kangaroo + dislike {is} {ask} What animal do you not like? + {remove} dislike {from} animals + {print} I choose animals {at} {random} + ``` + story_text_3: | + ### Exercise + Try out the new commands in this virtual restaurant. Add the flavor the player is hoping for to the list and remove the flavors they are allergic to. + example_code_3: | + ``` + {print} Mystery milkshake + flavors {is} strawberry, chocolate, vanilla + hope {is} {ask} What flavor are you hoping for? + _ + allergies {is} {ask} Are you allergic to any flavors? + _ + {print} You get a flavors {at} {random} milkshake + ``` + start_code: |- + animals {is} dog, cat, kangaroo + like {is} {ask} What is your favorite animal? + {add} like {to_list} animals + dislike {is} {ask} What animal do you not like? + {remove} dislike {from} animals + {print} I choose animals {at} {random} + and_or_command: + name: '{and} & {or}' + default_save_name: and or + description: introducing and or + levels: + 13: + story_text: |- + We are now going to learn `{and}` and `{or}`! If you want to check two statements, you don't have to use two `{if}`s but can use `{and}` and `{or}`. + + If you use `{and}`, both statements, left and right of the `{and}` need to be true. We can also use `{or}`. Then only one statement needs to be correct. + example_code: | + ``` + name = {ask} 'what is your name?' + age = {ask} 'what is your age?' + {if} name {is} 'Hedy' {and} age {is} 2 + {print} 'You are the real Hedy!' + ``` + start_code: |- + name = {ask} 'what is your name?' + age = {ask} 'what is your age?' + {if} name {is} 'Hedy' {and} age {is} 2 + {print} 'You are the real Hedy!' + ask_command: + name: '{ask}' + default_save_name: ask_command + description: Introduction ask command + levels: + 1: + story_text: | + ## The ask command + Now that you can use the `{print}` command, you are ready to learn the next command: `{ask}`. With the `{ask}` command, you can ask a question. Check it out: + example_code: | + ``` + {print} Hello! + {ask} What is your name? + ``` + story_text_2: | + ## The `{echo}` command + If you want the computer to repeat the answer back to you, you can use the `{echo}` command. The answer will be echoed back at the end of the sentence, so in this example after hello. + example_code_2: | + ``` + {print} Hello! + {ask} What is your name? + {echo} hello + ``` + story_text_3: | + ### Exercise + Try out the `{ask}` and `{echo}` commands. Firstly, fill in the blanks to make this program work. + Then ask 2 more questions using the `{ask}` command, after each `{ask}` use an `{echo}` to print the answer on the screen. + example_code_3: | + ``` + _ How are you doing? + _ + ``` + start_code: | + {print} Hello! + {ask} What is your name? + {echo} hello + 2: + story_text: | + ## 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! + example_code: | + ``` + name {is} {ask} What is your name? + {print} Hello name + age {is} {ask} How old are you? + {print} name is age years old. + ``` + story_text_2: | + ### 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. + example_code_2: | + ``` + favorite_animals {is} {ask} What is your favorite animal? + {print} I like favorite_animals + ``` + start_code: |- + name {is} {ask} What is your name? + {print} Hello name + age {is} {ask} How old are you? + {print} name is age years old. 18: - story_text: "We are going to print another story, but now we have to use brackets with `{print}`.\n\n### Exercise 1\nCreate a story of at least 5 sentences. You don't have to use 'name' just yet.\n" - story_text_2: "### Exercise 2\nWe have already prepared an `{input}` for you. First, use the `name` variable in your story.\nThen add a second `{ask}` and use that variable as well.\nTip: Remember the commas in a `{print}` between text and variables!\n" + story_text: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. + example_code: | + ``` + {print}('My name is Hedy!') + name = {input}('What is your name?') + {print}('So your name is ', name) + ``` + start_code: | + {print}('My name is Hedy!') + name = {input}('What is your name?') + {print}('So your name is ', name) + blackjack: + name: Blackjack + default_save_name: Blackjack + description: Try to get as close to 21 as you can + levels: + 17: + story_text: | + Blackjack is a simple game of cards in which you have to get as close to 21 points as possible. You get two cards. Each card is worth their numeral value, and the face cards (Jack, Queen and King) are worth 10 points. + The Ace is worth either 1 or 11 points (you can choose). The dealer, your opponent, also gets two cards. + If you want, you can get another card, and its points will be added to your total. The dealer can also choose to take another card. + But be careful not to get more than 21 points, because if you do, you lose! + The player who gets closest to 21, without going over it, wins! + + Have fun! + example_code: | + ``` + {print} 'BLACKJACK' + cards = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen','King', 'Ace'] + points = 0 + dealer_points = 0 + card_1 = cards[{random}] + card_2 = cards[{random}] + card_3 = cards [{random}] + dealer_card_1 = cards[{random}] + dealer_card_2 = cards[{random}] + dealer_card_3 = cards[{random}] + # Points for card 1 + {if} card_1 == 'Jack' {or} card_1 == 'Queen' {or} card_1 == 'King': + points = points + 10 + {elif} card_1 == 'Ace': + points = points + 11 + {else}: + points = points + card_1 + # Points for card 2 + {if} card_2 == 'Jack' {or} card_2 == 'Queen' {or} card_2 == 'King': + points = points + 10 + {elif} card_2 == 'Ace': + points = points + 11 + {else}: + points = points + card_2 + # Points for dealer card 1 + {if} dealer_card_1 == 'Jack' {or} dealer_card_1 == 'Queen' {or} dealer_card_1 == 'King': + dealer_points = dealer_points + 10 + {elif} dealer_card_1 == 'Ace': + dealer_points = dealer_points + 11 + {else}: + dealer_points = dealer_points + dealer_card_1 + # Points for dealer card 2 + {if} dealer_card_2 == 'Jack' {or} dealer_card_2 == 'Queen' {or} dealer_card_2 == 'King': + dealer_points = dealer_points + 10 + {elif} dealer_card_2 == 'Ace': + dealer_points = dealer_points + 11 + {else}: + dealer_points = dealer_points + dealer_card_2 + # Two Aces + {if} card_1 == 'Ace' {and} card_2 == 'Ace': + points = 12 + {if} dealer_card_1 == 'Ace' {and} dealer_card_2 == 'Ace': + dealer_points = 12 + # Scoreboard + {print} 'You have a ' card_1 ' and a ' card_2 ' (' points ' points)' + {print} 'The dealer has a ' dealer_card_1 ' and a ' dealer_card_2 ' (' dealer_points ' points)' + # Extra card for the player + hit = {ask} 'Do you want an extra card?' + {if} hit == 'yes': + {if} card_3 == 'Jack' {or} card_3 == 'Queen' {or} card_3 == 'King': + points = points + 10 + {elif} card_3 == 'Ace': + {if} points > 11: + points = points + 11 + {else}: + points = points + 1 + {else}: + points = points + card_3 + {print} 'You get an extra ' card_3 ' (' points ' points)' + {else}: + {print} 'No extra cards' + # Winner + {if} points > 21 {or} dealer_points > points {or} dealer_points == 21: + {print} 'You lose' + {elif} dealer_points < 17: + {print} 'The dealer takes an extra card. It is a... ' dealer_card_3 + {if} dealer_card_3 == 'Jack' {or} dealer_card_3 == 'Queen' {or} dealer_card_3 == 'King': + dealer_points = dealer_points + 10 + {elif} dealer_card_3 == 'Ace': + {if} dealer_points < 11: + dealer_points = dealer_points + 11 + {else}: + dealer_points = dealer_points + 1 + {else}: + dealer_points = dealer_points + dealer_card_3 + {print} 'The dealer has ' dealer_points ' points now' + {if} dealer_points < 21 {and} dealer_points > points: + {print} 'You lose' + {else}: + {print} 'You win' + {elif} points > dealer_points {and} points < 21: + {print} 'You win!' + ``` start_code: '# place your code here' - example_code: "```\n{print}('Welcome to this story!')\n```\n" - example_code_2: "```\nnaam = {input}(\"What's your name?\")\n{print}('Welcome to this story!')\n```\n" - 5: - start_code: "{print} 'Here your story will start!'" - story_text: "In this level you can program different endings, which will make your story even more fun.\nIn the example code you can see how to make 2 different endings.\n\n### Exercise 1\nWrite a new short story of at least 6 lines of code about a topic of your choosing.\nNo inspiration? Choose one of these topics: a superhero, a boring school day, stranded on a desert island.\n\nNow give the player a change to choose a happy or a bad end, just like in the example code.\nProgram both the endings.\n\n### Exercise 2\nCopy the story you've created in your own story adventure in the previous levels.\nFind a way to add at least 2 `{if}` and `{else}` commands to your story.\nThis can be with a happy or bad ending, but you can also try to find other ways to incoporate the commands.\n" - example_code: "```\nname {is} {ask} 'Who is walking in the forest?'\n{print} name ' walks through the forest'\n{print} name ' encounters a monster'\nend {is} {ask} 'Would you like a good or a bad ending?'\n{if} end {is} good {print} name ' takes the sword and the monster quickly runs away'\n{else} {print} 'The monster eats ' name\n```\n" - 2: - start_code: '{print} Your story' - story_text: "In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence.\n\nYou do have to program a little bit extra for that. You must now name your main character first.\n\nYou can then put that name anywhere in a sentence.\n" - story_text_2: "### Exercise\nNow it's time to add variables to your own story that you've made in the previous level.\nGo to 'My programs', look for your level 1 story adventure and copy the code. Paste the code in your input screen in this level.\n\nThis code won't work in this level, because you have not used variables yet.\nChange the `{ask}` commands and `{echo}` commands in your code to the correct form that you've learned in this level.\n\n**Extra** Add a `{sleep}` command to your code to build up tension in your story.\n" - example_code: "```\nname {is} {ask} What is the name of the main character?\n{print} name is now going to run in the woods\n{print} name is a bit scared\n{print} Suddenly he hears a crazy noise...\n{sleep}\n{print} name is afraid this is a haunted forest\n```" - 1: - start_code: '{print} Your story starts here' - story_text: "In level 1 you can make a story with a different main character that you enter yourself.\n\nIn the first line, use `{ask}` and ask who the main character of the story will be.\n\nAfter that first line, start with `{print}` if the sentence needs to be printed.\nYou use `{echo}` if you want your main character to be at the end of the sentence.\n" - example_code: "```\n{ask} The main character of this story is\n{print} The main character is now going to walk in the forest\n{echo} He's a bit scared,\n{print} He hears crazy noises everywhere\n{print} He's afraid this is a haunted forest\n```\n" - story_text_2: "### Exercise\nNow create your own story of at least 6 lines of code.\nThis story cannot be the same as the example code.\nUse at least one `{ask}` and one `{echo}` command.\nYou can make it about any topic you like.\nIf you can't think of a topic, use one of our choices: going to the movies, a sports match or a day at the zoo.\n" + calculator: + name: Calculator + default_save_name: Calculator + description: Create a calculator + levels: + 6: + story_text: | + Now that you can do maths, you can make a calculator yourself! + example_code: | + ``` + number_1 = {ask} 'Fill in the first number:' + number_2 = {ask} 'Fill in the second number:' + correct_answer = number_1 * number_2 + {print} number_1 ' times ' number_2 ' is ' correct_answer + ``` + story_text_2: | + ### Exercise + The calculator above will calculate the answer for you, but you can also make a program to test your own maths skills, like this: + Fill in the blanks to make it complete! + example_code_2: | + ``` + correct_answer = 11 * 27 + answer = {ask} 'How much is 11 times 27?' + {if} answer {is} _ {print} 'good job!' + {else} {print} 'Wrong! It was ' _ + ``` + story_text_3: | + **Extra** You can also let the computer do random products on its own using `{random}`. + example_code_3: |- + ``` + numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + number_1 = _ + number_2 = _ + correct_answer = number_1 * number_2 + given_answer = {ask} 'What is ' number_1 ' times ' number_2 '?' + {if} _ + {else} _ + ``` + start_code: | + number_1 = {ask} 'Fill in the first number:' + number_2 = {ask} 'Fill in the second number:' + correct_answer = number_1 * number_2 + {print} number_1 ' times ' number_2 ' is ' correct_answer 9: - story_text: "In this level you can use `{if}` and `{repeat}` commands inside other `{if}` and `{repeat}` commands. \nThis gives you many options and really helps you to make your story interactive.\n\n### Exercise 1\nFinish the code so the `{if}` works correctly.\n\n### Exercise 2\nAdd an `{if}` and `{else}` for the part of the story where Robin goes home too.\n\n### Exercise 3\nGo back to your level 8 story and use at least two `{if}`s inside another `{if}`.\n" - start_code: '# place your code here' - example_code: "```\n{print} 'Robin is walking downtown'\nlocation = {ask} 'Is Robin going into a shop, or does she go home?'\n{if} location {is} shop\n {print} 'She enters the shop.'\n {print} 'Robin sees an interesting looking book'\n book = {ask} 'Does Robin buy the book?'\n {if} book {is} yes\n _ {print} 'Robin buys the book and goes home'\n _ {else}\n _ {print} 'Robin leaves the shop and goes home'\n{else}\n {print} 'Robin goes home'\n```\n" + story_text: | + In level 6 you created a calculator, in this level you can expand that code so it asks multiple questions. + + ### Exercise 1 + Can you finish line 10 to make to program work? + + ### Exercise 2 + Give the player feedback when the enter a right or wrong answer. To achieve that, expand your program with an `{else}`. + example_code: | + ``` + score = 0 + {repeat} 10 {times} + numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + number1 = numbers {at} {random} + number2 = numbers {at} {random} + correct_answer = number1 * number2 + {print} 'What is ' number1 ' times ' number2 '?' + answer = {ask} 'Type your answer here...' + {print} 'Your answer is' answer + {if} _ {is} _ + score = score + 1 + {print} 'Great job! Your score is... ' score ' out of 10!' + ``` + start_code: '{print} ''Welcome to this calculator!''' 10: + story_text: | + This calculator game helps you practise your tables of multiplication! + ### Exercise + Can you add more numbers to the list, so you can practise the multiplication tables until 10? + example_code: | + ``` + numbers = 1, 2, 3 + {for} number1 {in} numbers + {for} number2 {in} numbers + answer = {ask} 'How much is ' number2 ' times ' number1 '?' + correct = number1 * number2 + {if} answer {is} correct + {print} 'Great job!' + {else} + {print} 'That is wrong. The right answer is ' correct + ``` start_code: '# place your code here' - example_code: "```\nanimals = _ , _ , _ \n{print} 'Brown bear, Brown bear'\n{print} 'What do you see?'\n```\n" - story_text: "In this level you can use the {for} command in your story. In this way you could easily program the children's book 'Brown bear, Brown bear, what do you see'.\n\n### Exercise\n\nLook at the story if you do not know it, and make sure it is printed as in the book.\n" - 15: - start_code: '# place your code here' - story_text: "Using the `{while}` loop can make your stories more interesting. For example, you can use `{while} game == 'on'` so you can play until the game is over.\nOr you can use `{while} sword == 'lost'` so the player can't continue the game until they have found something.\n\n### Exercise\nThe example code shows you how to use the `{while}` loop in a story. Now **think of your own scenario** in which the player has to find something before they can continue.\n" - example_code: "```\nkeys = 'lost'\n{print} 'You are standing in your garden and you have lost your keys.'\n{print} 'Where do you want to look for them?'\n{print} 'You can choose: tree, flowerbed, rock, postbox'\n{while} keys == 'lost'\n location = {ask} 'Where do you want to look?'\n {if} location == 'flowerbed'\n {print} 'Here they are!'\n keys = 'found'\n {else}\n {print} 'Nope they are not at the ' location\n{print} 'Now you can enter the house!'\n```\n" - 8: - story_text: "In this level you can use multiple lines in your `{if}` commands, this way you can upgrade your happy or sad ending!\n\n### Exercise 1\nThe example code shows two different endings; one where the characters jump in a time machine and one where they do not.\nComplete the blanks with at least one sentence per ending.\n**Extra** Make the story longer. What happens in the story? You can also add a second `{ask}` with different options.\n\n### Exercise 2\nGo back to your saved programs, choose your story program from level 5. Now write a good and a bad ending of at least three lines long each!\n" - example_code: "```\n{print} 'OH NO! The T-rex is closing in!'\nend = {ask} 'Do you want a happy or a sad ending?'\n{if} end {is} happy\n {print} 'Just in time Richard jumps back into the time machine!'\n {print} _\n{else}\n {print} 'Oh no! Richard is too slow...'\n {print} _\n```\n" - start_code: '# place your code here' - 4: - example_code: "```\nname {is} {ask} _ What is your name? _\n{print} _ The main character is called _ name\n_\n_\n{print} name _ is now going to walk in the woods _\n{print} name _ is a bit scared _\nanimals {is} 🦔, 🐿, 🦉, 🦇\n{print} _ He hears the sound of a _ animals {at} {random}\n{print} name _ is afraid this is a haunted forest _\n```\n" - story_text: "You may have noticed that there is still a problem in the previous levels. Did you try to print a sentence that contained the word name? i.e. `{print}` my name is name.\nYou can solve that in this level. You must use quotation marks for everything that you are going to print.\n\n### Exercise\nCopy the example code and finish it by adding quotation marks on the blanks in lines 1 and 2.\nThe 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?\n\n### Exercise 2\nGo 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.\nMind: 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.\n" - start_code: "{print} 'Your story will be printed here!'" - 7: - story_text: "In a story, someone says words several times. For example, when someone calls for help or sings a song.\nYou can put such repetitions in your story, in this level with `{repeat}`.\n\n### Exercise\nAdd repetition to your own story. Go back to your saved programs, choose your story program from a previous level and\nfind a line containing `{print}` and repeat it!\n" - start_code: "{repeat} 5 {times} {print} 'Help!'" - example_code: "```\n{print} 'The prince kept calling for help'\n{repeat} 5 {times} {print} 'Help!'\n{print} 'Why is nobody helping me?'\n```\n" + 11: + story_text: | + With a `{for}` you can simplify tables of multiplication practise program. + + ### Exercise 1 + Improve the example code such that it prints a nice multiplication table:
"1 times 10 is 10", "2 times 10 is 20", etc. + + ### Exercise 2 + Go back to your level 10 multiplication code, and modify it so that it uses a `{for}` and `{range}`. + example_code: | + ``` + number = 10 + {for} i {in} {range} 1 {to} 10 + {print} i * number + ``` + start_code: | + number = 10 + {for} i {in} {range} 1 {to} 10 + {print} i * number 12: + story_text: | + In this level, you can make a calculator that works for decimal numbers. + + ### Exercise 1 + Fill out the blanks to complete the calculator. Remember to use a period and not a comma for decimal numbers. + + ### Exercise 2 + Create a new mathematics practice program, but now use decimal numbers. + Create a list of numbers, choose two to multiple and let the player answer. + And of course you have to validate the answer! **Extra** Increase the difficulty by adding lives: A player loses a life for a wrong answer and after three wrong answers the game ends. + example_code: | + ``` + number1 = {ask} 'What is the first number?' + number2 = {ask} 'What is the second number?' + answer = _ + {print} number1 ' plus ' number2 ' is ' _ + ``` start_code: '# place your code here' - story_text: "In this level quotation marks will be needed to save multiple words in a variable.\n\n### Exercise\n\nFind a story from a previous level, any level is ok. Now make sure quotation marks are added in the right places." - example_code: "```\nname = 'The Queen of England'\n{print} name ' was eating a piece of cake, when suddenly...'\n```\n" 13: - story_text: "By using the `{and}` and `{or}` commands, you can make your stories more versatile. You can ask two questions and respond to the combination of answers.\n\n### Exercise 1\nLook at the example code and finish it. Then add at least 2 more `{if}` codes with `{and}` or `{or}`.\n\n### Exercise 2\nFind a story from a previous level, and add one `{and}` or `{or}`.\n" - example_code: "```\n{print} 'Our hero is walking through the forest'\n{print} 'The path splits two ways'\npath = {ask} 'Which path should she choose?'\nweapon = {ask} 'What weapon does she draw?'\n{if} path {is} 'left' {and} weapon {is} 'sword'\n _\n```\n" + story_text: | + ### Exercise 1 + Let's make the practice program a bit harder. The player now has to answers two questions correctly. Fill out the blanks to complete the program. + + ### Exercise 2 Extra + Sometimes, calculations have multiple correct answers. For example, 10 can be divided by 5 and by 2. So the question 'What number divides 10?' can be answered by 2 and by 5. + Ask for a calculation that has multiple correct answers, ask the player to answer it, and determine if it is correct using `{or}`. + Empty the programming field and create your own solution. + example_code: | + ``` + answer1 = {ask} 'What is 10 times 7?' + answer2 = {ask} 'What is 6 times 7?' + {if} _ _ _ _ _ _ _ + {print} _ + ``` + start_code: '# Write your code here' + 14: + story_text: | + In this adventure you will build a calculator that calculates your mean grade for you. If you get your calculator to work, you can move on to the next adventure, which allows you to add two extra features. + + ### Exercise 1 + Fill in the blanks to get the calculator to work. + * Start with the fourth line, add a question to figure out what grade the student got. + * In the fifth line you'll want to calculate the total of all grades, so the total = total + grade. + * Then we get to set the return value. We want to return the mean, so the total devided by the amount of tests (4). + * Lastly we finish the code by calling the function in line 8. + + Did you get it? Awesome! Would you like to add even more to your calculator? **This adventure continues in the next tab!** + example_code: | + ``` + {define} calculate_mean_grade + total = 0 + {for} i {in} {range} 1 {to} 4 + grade = {ask} _ + total = total + _ + return _ / 4 + + mean_grade = {call} _ + {print} 'Your mean grade is ' mean_grade + ``` + start_code: | + {define} calculate_mean_grade + total = 0 + {for} i {in} {range} 1 {to} 4 + grade = {ask} _ + total = total + _ + return _ / 4 + + mean_grade = {call} _ + {print} 'Your mean grade is ' mean_grade + 15: + story_text: | + You can add the `{while}` loop to the calculator game you've learned to make in a previous level. + This makes sure the player can't continue to the next question if they answer incorrectly. + + ### Exercise + Add the `{while}` loop in the function, ask the player what number_1 times number_2 is and print their answer. + Then `{call}` the function. + example_code: | + ``` + {define} new_question + numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + number_1 = numbers {at} {random} + number_2 = numbers {at} {random} + correct = number_1 * number_2 + answer = 0 + _ + _ + _ + {print} 'Well done!' + + {print} 'Give 10 correct answers to win!' + {for} i {in} {range} 1 {to} 10 + _ + {print} 'You win!' + ``` start_code: '# place your code here' - name: Story - description: Story - default_save_name: Story - dishes: + calculator_2: + name: Calculator 2 + default_save_name: Calculator 2 + description: Calculator 2 + levels: + 14: + story_text: | + ### Exercise 2 + **This is the second part of this adventure.** The adventure starts in the previous tab. + Of course, you don't always want to calculate the mean of 4 tests. You might want to calculate the mean of 10 tests or only 2... + We can fix this problem by adding the argument and variable 'amount_of_tests'. + * Start a new line on line 3. Set the amount_of_tests argument by asking the student how many tests they have made. + * Change the 4 in line 4 to the new argument amount_of_tests. + * Lastly, change the 4 in line 6 to amount_of_tests + + Try out your new program. Does it work? + + ### Exercise 3 + Did you want to make your program even better? Great! In the previous program you could only calculate the mean grade of 1 subject, but it would be better if you could calculate the mean grade for all subjects you want! + We won't tell you how to do it, but we will give you one tip: Start your code in line 1 with: define calculate_mean_grade with subject. + example_code: | + ``` + # Use your own code from the previous adventure. + ``` + start_code: | + # Use your own code from the previous adventure. + clear_command: + name: '{clear}' + default_save_name: clear_command + description: clear command levels: - 10: - example_code: "```\ndays = Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday\nnames = mom, dad, Emma, Sophie\n{for} day {in} days\n {print} names {at} {random} ' does the dishes on ' day\n```\n" - story_text: "In this level you can make a schedule for the whole week in an easy way!\n\n### Exercise\nAdd a second chore, such as vacuuming or tidying up, and make sure it is also divided for the whole week.\n
**Extra** The program is not fair, you can be unlucky and wash up all week. How could you make the program more fair?\n" - start_code: "days = Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday\nnames = mom, dad, Emma, Sophie\n{for} day {in} days\n {print} names {at} {random} ' does the dishes on ' day\n" - 5: - story_text: "With the `{if}` you can now have more fun with choice in the program. You can have your program respond to the choice that the computer has made.\n### Exercise\nCan you finish the code so that it prints 'too bad' when it is your turn and otherwise 'yes!'?\nDon't forget the quotes!\n" - start_code: "{print} 'Who does the dishes?'" - example_code: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n_ dishwasher {is} Sophie {print} _ too bad I have to do the dishes _\n_ {print} 'luckily no dishes because ' _ ' is already washing up'\n```\n" - 6: - example_code_2: "```\npeople = mom, dad, Emma, Sophie\ndishwasher = people {at} {random}\n{print} 'Monday the dishes are done by: ' dishwasher\n{remove} dishwasher {from} people\ndishwasher = people {at} {random}\n{print} 'Tuesday the dishes are done by: ' dishwasher\n{remove} dishwasher {from} people\n```\n" - example_code: "```\npeople = mom, dad, Emma, Sophie\nemma_washes = 0\ndishwasher = people {at} {random}\n{print} 'The dishwasher is' dishwasher\n{if} dishwasher {is} Emma emma_washes = emma_washes + 1\n{print} 'Emma will do the dishes this week' emma_washes 'times'\n```\n\nNow you can copy lines 3 to 5 a few times (e.g. 7 times for a whole week) to calculate for a whole week again.\nDo you make the code for the whole week?\n" - story_text_2: "If you are extremely unlucky the previous program might choose you to do the dishes for the whole week! That's not fair!\nTo create a fairer system you can use the `{remove}` command to remove the chosen person from the list. This way you don't have to do the dishes again until everybody has had a turn.\n\nMonday and Tuesday are ready for you! Can you add the rest of the week?\nAnd… can you come up with a solution for when your list is empty?\n" - story_text: "How often is everyone going to do the dishes? Is that fair? You can count it in this level.\n" - start_code: "{print} 'Who does the dishes?'" 4: - example_code: "```\npeople {is} mom, dad, Emma, Sophie\n{print} _ the dishes are done by _\n{sleep}\n{print} people {at} _\n```\n" - story_text: "With quotation marks you can make your dishwashing program even better.\n\n### Exercise\nFirst, fill in right symbols or commands on the blanks to make this example program work.\nDid 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.\n" - start_code: "{print} 'Who does the dishes?'" + story_text: | + Time for a new command! With `{clear}` you can clear all the text form your output screen. This way you can prevent your screen getting too full of text. + Beware! If you are using a `{clear}` command, remember to use a `{sleep}` above it. Otherwise Hedy will clear your screen without giving you the time to read! + example_code: | + ``` + {print} '3' + {sleep} + {clear} + {print} '2' + {sleep} + {clear} + {print} '1' + {sleep} + {clear} + {print} 'SURPRISE!' + ``` + start_code: | + {print} '3' + {sleep} + {clear} + {print} '2' + {sleep} + {clear} + {print} '1' + {sleep} + {clear} + {print} 'SURPRISE!' + debugging: + name: debugging + default_save_name: debugging + description: debugging adventure + levels: + 1: + story_text: |- + 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 show you 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! + example_code: | + **Warning! This code needs to be debugged!** + ``` + {print} I love programming + Do you love programming too? + {echo} + {print} What are your hobbies? + {echo} Your hobbies are + ``` + start_code: | + {print} I love programming + Do you love programming too? + {echo} + {print} What are your hobbies? + {echo} Your hobbies are + 2: + story_text: |- + 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! + example_code: | + **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! + ``` + start_code: | + 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! 3: - story_text_2: "### Exercise\nMake your own version of the dishwasher program. Firstly make a list of your family members.\nThen think of a task that needs to be done, and let the computer decide who has to do the task with the `{at} {random}` command.\n\n**Extra** Don't feel like doing the dishes yourself? Hack the program by removing your name from the list with the `{remove}` `{from}` command.\n" - start_code: '{print} Who does the dishes?' - example_code: "```\npeople {is} mom, dad, Emma, Sophie\n{print} people {at} {random} has to do the dishes\n```\n" - story_text: "Do you always disagree at home about who should wash the dishes or change the litter box today?\nThen you can let the computer choose very fairly. You can program that in this level!\n" + story_text: |- + 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! + example_code: | + **Warning! This code needs to be debugged!** + ``` + movie_choices {is} dracula, fast and furious, home alone, barbie + chosen_movie {is} movies {at} {random} + {print} Tonight we will watch chosen _movies + like {ask} Do you like that movie? + {print} Tomorrow we will watch something else. + {add} chosen_movie {to} movie_choices + {print} Tomorrow we will watch tomorrows_movie + tomorrows_movie {is} movie_choices {at} {random} + I'll go get the popcorn! {print} + ``` + start_code: | + movie_choices {is} dracula, fast and furious, home alone, barbie + chosen_movie {is} movies {at} {random} + {print} Tonight we will watch chosen _movies + like {ask} Do you like that movie? + {print} Tomorrow we will watch something else. + {add} chosen_movie {to} movie_choices + {print} Tomorrow we will watch tomorrows_movie + tomorrows_movie {is} movie_choices {at} {random} + I'll go get the popcorn! {print} + 4: + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **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} + ``` + start_code: | + {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} + 5: + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + {print} Welcome to Swimming Pool Hedy! + class {is} {ask} 'Are you here to join a class today?' + {if} class yes + {print} 'Great! You are joining a class!' + {print} {else} 'You will not be joining a class' + discount {is} {ask} 'Do you have a discount code?' + {if} discount {is} yes + discount_answer {is} {ask} 'What is your discount code?' + discount_codes = Senior4231, Student8786, NewMember6709 + {if} discount_answer {is} {in} discount_codes + {print} 'That will be $3,50' + {else} 'That code is not valid' + {else} 'That will be $5,50' + {print} 'Have a nice swim!' + ``` + start_code: | + {print} Welcome to Swimming Pool Hedy! + class {is} {ask} 'Are you here to join a class today?' + {if} class yes + {print} 'Great! You are joining a class!' + {print} {else} 'You will not be joining a class' + discount {is} {ask} 'Do you have a discount code?' + {if} discount {is} yes + discount_answer {is} {ask} 'What is your discount code?' + discount_codes = Senior4231, Student8786, NewMember6709 + {if} discount_answer {is} {in} discount_codes + {print} 'That will be $3,50' + {else} 'That code is not valid' + {else} 'That will be $5,50' + {print} 'Have a nice swim!' + 6: + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + {print} 'Vending machine' + chosen_product = {ask} 'Please select a product' + 1_dollar_products = coke orange juice water + 2_dollar_products = chocolate, cookie, museli bar + 3dollar_prodcuts = potato chips, beef jerky, banana bread + {if} chosen {is} {in} 1_dollar_products + price = 1 + {if} chosen_product {is} 2_dollar_products + price = 2 + {else} chosen_product {in} 3_dollar_products + price = 3 + amount_of_products = '{ask} How many of ' chosen_product would you like to have?' + total = price + amount_of_product + {print} 'That will be $' price 'please' + ``` + start_code: | + {print} 'Vending machine' + chosen_product = {ask} 'Please select a product' + 1_dollar_products = coke orange juice water + 2_dollar_products = chocolate, cookie, museli bar + 3dollar_prodcuts = potato chips, beef jerky, banana bread + {if} chosen {is} {in} 1_dollar_products + price = 1 + {if} chosen_product {is} 2_dollar_products + price = 2 + {else} chosen_product {in} 3_dollar_products + price = 3 + amount_of_products = '{ask} How many of ' chosen_product would you like to have?' + total = price + amount_of_product + {print} 'That will be $' price 'please' 7: - story_text: "With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for multiple days!\n### Exercise\nUse the `{repeat}` command to decide on who needs to wash the dishes for an entire week. Each blank needs to be filled with one command or number!\n**Extra** Can you think of other tasks in the house? Adapt the code so it decides on three household chores. Do not forget to print what tasks it concerns!\n" - start_code: "{print} 'Who does the dishes?'" - example_code: "```\npeople = mom, dad, Emma, Sophie\n{repeat} _ _ {print} 'Dishwashing will be done by ' _ _ _\n```\n" - name: Dishes? - description: Use the computer to see who does the dishes - default_save_name: Dishes - haunted: - levels: + story_text: |- + ### Exercise + Surprise! This program looks more like an output than a code. And yet, we don't want you to just add `{print}` commands in front of each line. + Fix this program to turn it into the nursery rhyme 'Brother John (Frère Jacques)' by using the {repeat} command of course! + example_code: | + **Warning! This code needs to be debugged!** + ``` + Are you sleeping? + Brother John! + Morning bells are ringing! + Ding, dang, dong! + ``` + start_code: | + Are you sleeping? + Brother John! + Morning bells are ringing! + Ding, dang, dong! + 8: + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + {print} 'Welcome to Manicures and Pedicures by Hedy' + bodypart = {ask} 'Are you getting your fingernails or toenails done today? Or both?' + {if} bodyparts {is} both + {print} That will be $25' + price = 25 + {else} + {print} That will be $18' + price = 18 + color = {ask} What color would you like? + sparkles = {ask} 'Would you like some sparkles with that?' + {if} sparkles {is} yes + {print} 'We charge $3 extra for that' + price = price + 3 + {else} {print} 'No sparkles' {print} 'So no extra charge' + {sleep} 5 + {print} 'All done! That will be $' price ' please!' + {print} 'Thank you! Byebye!' + start_code: | + {print} 'Welcome to Manicures and Pedicures by Hedy' + bodypart = {ask} 'Are you getting your fingernails or toenails done today? Or both?' + {if} bodyparts {is} both + {print} That will be $25' + price = 25 + {else} + {print} That will be $18' + price = 18 + color = {ask} What color would you like? + sparkles = {ask} 'Would you like some sparkles with that?' + {if} sparkles {is} yes + {print} 'We charge $3 extra for that' + price = price + 3 + {else} {print} 'No sparkles' {print} 'So no extra charge' + {sleep} 5 + {print} 'All done! That will be $' price ' please!' + {print} 'Thank you! Byebye!' 9: - story_text: "In this level you can use nesting, which allows you to make the haunted house even more interactive!\n\n### Exercise\nNow it's very hard to win this game, can you make it easier to win?\nChange your code so it only has one wrong door and two correct doors instead of one correct door and two wrong ones? \nTip: This means changing the variable correct_door into wrong_door, and switching the `{if}` and `{else}` code.\nAnd of course you may also change the story and make it your own. Change the monsters or make it a happy game show where you get a gift!\n" - example_code: "```\n{print} 'Escape from the Haunted House!'\nplayer = alive\ndoors = 1, 2, 3\nmonsters = zombie, vampire, giant spider\n{repeat} 3 {times}\n {if} player {is} alive\n correct_door {is} doors {at} {random}\n {print} 'There are 3 doors in front of you...'\n chosen_door = {ask} 'Which door do you choose?'\n {if} chosen_door {is} correct_door\n {print} 'No monsters here!'\n {else}\n {print} 'You are eaten by a ' monsters {at} {random}\n player = dead\n {else}\n {print} 'GAME OVER'\n{if} player {is} alive\n {print} 'Great! You survived!'\n```\n" - start_code: "{print} 'Escape from the haunted house!'" + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + {print} 'Welcome to our sandwich shop' + amount 'How many sandwiches would you like to buy?' + {repeat} amount {times} + {ask} {is} {ask} 'What kind or bread would you like your sandwich to be?' + types_of_bread {is} white, wheat, rye, garlic, gluten free + {if} chosen_bread in types_of_bread + {print} 'Lovely!' + {else} + 'I'm sorry we don't sell that' + topping {is} {ask} 'What kind of topping would you like?' + sauce {is} {ask} 'What kind of sauce would you like?' + {print} One chosen_bread with topping and sauce. + price = amount * 6 + {print} 'That will be 'price dollar' please' + ``` + start_code: | + {print} 'Welcome to our sandwich shop' + amount 'How many sandwiches would you like to buy?' + {repeat} amount {times} + {ask} {is} {ask} 'What kind or bread would you like your sandwich to be?' + types_of_bread {is} white, wheat, rye, garlic, gluten free + {if} chosen_bread in types_of_bread + {print} 'Lovely!' + {else} + 'I'm sorry we don't sell that' + topping {is} {ask} 'What kind of topping would you like?' + sauce {is} {ask} 'What kind of sauce would you like?' + {print} One chosen_bread with topping and sauce. + price = amount * 6 + {print} 'That will be 'price dollar' please' + 10: + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + names = Muad Hasan Samira Noura + activities = fly a kite, go swimming, go hiking, catch tan in the sun + {for} name {is} names + {print} At the beach name loves to activity {at} {random} + ``` + start_code: | + names = Muad Hasan Samira Noura + activities = fly a kite, go swimming, go hiking, catch tan in the sun + {for} name {is} names + {print} At the beach name loves to activity at random 11: - start_code: "{print} 'Escape from the haunted house!'" - story_text: "In this level we've changed the `{for}` command so we can tell the player where they are. \n\n### Exercise 1\nFinish the program so the player knows which room they are in.\n\n### Exercise 2\nMake the program into an adventure by following these steps:\n\n1. Make a list of choices (like: fight or flight)\n2. Make sure the player can choose an option with `{ask}`\n3. Is answer correct? Then they may proceed to the next monster. Do they give a wrong answer? Let the player know with a `{print}`. \n\n**Extra** If you make a wrong choice, a monster is still shown! How could you change that?\n" - example_code: "```\n{print} 'Escape from the Haunted House!'\nmonsters = zombie, vampire, giant spider\n_\n {print} 'Room ' i\n monster = monsters {at} {random}\n```\n" + story_text: |- + ### Exercise + Debug this calender program. The output of this program is supposed to look like a list of dates. + For example: + + ``` + Hedy calender + Here are all the days of November + November 1 + November 2 + November 3 + ``` + And so on. + + Mind that you have to test your code extra carefully for the month February, because the amount of days in this month changes in leap years. + example_code: | + **Warning! This code needs to be debugged!** + ``` + print 'Hedy calender' + months_with_31 days = January, March, May, July, September, October, December + months_with_30_days = April, June, August, November + month = ask 'Which month would you like to see?' + if month in months_with_31_days + days = 31 + if month in months_with30_days + days = 30 + if month = February + leap_years = 2020, 2024, 2028, 2036, 2040, 2044, 2028 + year = ask 'What year is it?' + if year in leap_years + days = 29 + else + days = 28 + + print 'Here are all the days of ' moth + for i in range 1 to days + print month i + ``` + start_code: | + print 'Hedy calender' + months_with_31 days = January, March, May, July, September, October, December + months_with_30_days = April, June, August, November + month = ask 'Which month would you like to see?' + if month in months_with_31_days + days = 31 + if month in months_with30_days + days = 30 + if month = February + leap_years = 2020, 2024, 2028, 2036, 2040, 2044, 2028 + year = ask 'What year is it?' + if year in leap_years + days = 29 + else + days = 28 + + print 'Here are all the days of ' moth + for i in range 1 to days + print month i + 12: + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + define greet + greetings = 'Hello', 'Hi there', 'Goodevening' + print greetings at random + + define take_order + food = ask 'What would you like to eat?' + print 'One food' + drink = 'What would you like to drink?' + print 'One ' drink + more = ask 'Would you like anything else?' + if more is 'no' + print 'Alright' + else + print 'And ' more + print 'Thank you' + + print 'Welcome to our restaurant' + people = ask 'How many people are in your party tonight?' + for i in range 0 to people + call greet_costumer + ``` + start_code: | + define greet + greetings = 'Hello', 'Hi there', 'Goodevening' + print greetings at random + + define take_order + food = ask 'What would you like to eat?' + print 'One food' + drink = 'What would you like to drink?' + print 'One ' drink + more = ask 'Would you like anything else?' + if more is 'no' + print 'Alright' + else + print 'And ' more + print 'Thank you' + + print 'Welcome to our restaurant' + people = ask 'How many people are in your party tonight?' + for i in range 0 to people + call greet_costumer + 13: + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + defin movie_recommendation with name + action_movies == 'Die Hard', 'Fast and Furious', 'Inglorious Bastards' + romance_movies = 'Love Actually', 'The Notebook', 'Titanic' + comedy_movies = 'Mr Bean' 'Barbie''Deadpool' + kids_movies = 'Minions', 'Paddington', 'Encanto' + if name is 'Camila' or name is 'Manuel' + recommended_movie = kids_movie at random + if name is 'Pedro' or 'Gabriella' + mood = ask 'What you in the mood for?' + if mood is 'action' + recommended_movie = comedy_movies at random + if mood is 'romance' + recommended_movie = romance_movies + if mood is 'comedy' + recommended_movie = comedy_movies at random + + print 'I would recommend ' recommended_movie ' for ' name + + name = ask 'Who is watching?' + recommendation = ask 'Would you like a recommendation?' + if recommendaion is 'yes' + print movie_recommendation with name + else + print 'No problem!' + ``` + start_code: | + defin movie_recommendation with name + action_movies == 'Die Hard', 'Fast and Furious', 'Inglorious Bastards' + romance_movies = 'Love Actually', 'The Notebook', 'Titanic' + comedy_movies = 'Mr Bean' 'Barbie''Deadpool' + kids_movies = 'Minions', 'Paddington', 'Encanto' + if name is 'Camila' or name is 'Manuel' + recommended_movie = kids_movie at random + if name is 'Pedro' or 'Gabriella' + mood = ask 'What you in the mood for?' + if mood is 'action' + recommended_movie = comedy_movies at random + if mood is 'romance' + recommended_movie = romance_movies + if mood is 'comedy' + recommended_movie = comedy_movies at random + + print 'I would recommend ' recommended_movie ' for ' name + + name = ask 'Who is watching?' + recommendation = ask 'Would you like a recommendation?' + if recommendaion is 'yes' + print movie_recommendation with name + else + print 'No problem!' 14: - example_code: "```\n{print} 'Escape from the haunted house'\nlives = 3\ndoors = 1, 2, 3\nmonsters = 'the wicked witch', 'a zombie', 'a sleeping 3 headed dog'\n{for} i {in} {range} 1 {to} 10\n {if} lives _\n good_door = doors {at} {random}\n monster = monsters {at} {random}\n chosen_door = {ask} 'Which door do you choose?'\n {if} good_door == chosen_door\n {print} 'You have chosen the correct door'\n {else}\n {print} 'You see...' monster\n {if} monster == 'a sleeping 3 headed dog'\n {print} 'Pffieuw.... Its asleep'\n {else}\n {print} 'You lose one life'\n lives = _\n {else}\n {print} 'GAME OVER'\n```\n" - start_code: '# place your code here' - story_text: "### Exercise\nIn this level you can use the `<` and `>` symbol to introduce lives to your game.\nMake sure the player loses a life when they come across the wrong monster and that the game stops if you have no lives left.\n" + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + define calculate_heartbeat + print 'Press your fingertips gently against the side of your neck' + print '(just under your jawline)' + print 'Count the number of beats you feel for 15 seconds' + beats == ask 'How many beats do you feel in 15 seconds?' + heartbeat = beats*4 + print 'Your heartbeat is ' heartbeat + if heartbeat >= 60 or heartbeat <= 100 + print 'Your heartbeat seems fine' + else + if heartbeat > 60 + print 'Your heartbeat seems to be too low' + if heartbeat < 100 + print 'Your heartbeat seems to be too high' + print 'You might want to contact a medical professional' + + measure_heartbeat = ask 'Would you like to measure your heartbeat?' + if measure_heartbeat = 'yes' + call measure_heartbeat + else + 'no problem' + ``` + start_code: | + define calculate_heartbeat + print 'Press your fingertips gently against the side of your neck' + print '(just under your jawline)' + print 'Count the number of beats you feel for 15 seconds' + beats == ask 'How many beats do you feel in 15 seconds?' + heartbeat = beats*4 + print 'Your heartbeat is ' heartbeat + if heartbeat >= 60 or heartbeat <= 100 + print 'Your heartbeat seems fine' + else + if heartbeat > 60 + print 'Your heartbeat seems to be too low' + if heartbeat < 100 + print 'Your heartbeat seems to be too high' + print 'You might want to contact a medical professional' + + measure_heartbeat = ask 'Would you like to measure your heartbeat?' + if measure_heartbeat = 'yes' + call measure_heartbeat + else + 'no problem' + 15: + story_text: |- + ### Exercise + Debug this random children's story. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + names = 'Tanya', 'Romy', 'Kayla', 'Aldrin', 'Ali' + verbs='walking', 'skipping', 'cycling', 'driving', 'running' + locations = 'on a mountaintop', 'in the supermarket', 'to the swimming pool' + hiding_spots = 'behind a tree', under a table', in a box' + sounds = 'a trumpet', 'a car crash', 'thunder' + causes_of_noise = 'a television', 'a kid with firecrackers', 'a magic elephant', 'a dream' + + chosen_ name = names at random + chosen_verb = verbs at random + chosen_location = 'locations at random' + chosen_sounds = noises at random + chosen_spot = hiding_spots random + chosen_causes = causes_of_noise at random + + print chosen_name ' was ' chosen_verb ' ' chosen_location + print 'when they suddenly heard a sound like ' sounds at random + print chosen_name ' looked around, but they couldn't discover where the noise came from' + print chosen_name ' hid ' chosen_spot' + print 'They tried to look around, but couldn't see anything from there' + hidden = 'yes' + while hidden = 'yes' + print chosen_name 'still didn't see anything' + answer = ask 'does ' chosen_name ' move from their hiding spot?' + if answer = 'yes' + hidden == 'no' + print 'chosen_name moved from' chosen_spot + print 'And then they saw it was just' chosen_cause + print chosen_name 'laughed and went on with their day' + print The End + ``` + start_code: | + names = 'Tanya', 'Romy', 'Kayla', 'Aldrin', 'Ali' + verbs='walking', 'skipping', 'cycling', 'driving', 'running' + locations = 'on a mountaintop', 'in the supermarket', 'to the swimming pool' + hiding_spots = 'behind a tree', under a table', in a box' + sounds = 'a trumpet', 'a car crash', 'thunder' + causes_of_noise = 'a television', 'a kid with firecrackers', 'a magic elephant', 'a dream' + + chosen_ name = names at random + chosen_verb = verbs at random + chosen_location = 'locations at random' + chosen_sounds = noises at random + chosen_spot = hiding_spots random + chosen_causes = causes_of_noise at random + + print chosen_name ' was ' chosen_verb ' ' chosen_location + print 'when they suddenly heard a sound like ' sounds at random + print chosen_name ' looked around, but they couldn't discover where the noise came from' + print chosen_name ' hid ' chosen_spot' + print 'They tried to look around, but couldn't see anything from there' + hidden = 'yes' + while hidden = 'yes' + print chosen_name 'still didn't see anything' + answer = ask 'does ' chosen_name ' move from their hiding spot?' + if answer = 'yes' + hidden == 'no' + print 'chosen_name moved from' chosen_spot + print 'And then they saw it was just' chosen_cause + print chosen_name 'laughed and went on with their day' + print The End + 16: + story_text: |- + ### Exercise + Debug this code. Good luck! + Tip: Make sure that you only see your score once in the end. + example_code: | + **Warning! This code needs to be debugged!** + ``` + country = ['The Netherlands', 'Poland', 'Turkey', 'Zimbabwe', 'Thailand', 'Brasil', 'Peru', 'Australia', 'India', 'Romania' ] + capitals = 'Amsterdam', 'Warshaw' 'Istanbul', 'Harare', 'Bangkok', 'Brasilia', 'Lima', 'Canberra', 'New Delhi', 'Bucharest' + score = 0 + for i in range 0 to 10 + answer = ask 'What's the capital of ' countries[i] + correct = capital[i] + if answer = correct + print 'Correct!' + score = score + 1 + else + print 'Wrong,' capitals[i] 'in the capital of' countries[i] + print 'You scored ' score ' out of 10' + + ``` + start_code: | + country = ['The Netherlands', 'Poland', 'Turkey', 'Zimbabwe', 'Thailand', 'Brasil', 'Peru', 'Australia', 'India', 'Romania' ] + capitals = 'Amsterdam', 'Warshaw' 'Istanbul', 'Harare', 'Bangkok', 'Brasilia', 'Lima', 'Canberra', 'New Delhi', 'Bucharest' + score = 0 + for i in range 0 to 10 + answer = ask 'What's the capital of ' countries[i] + correct = capital[i] + if answer = correct + print 'Correct!' + score = score + 1 + else + print 'Wrong,' capitals[i] 'in the capital of' countries[i] + print 'You scored ' score ' out of 10' + 17: + story_text: |- + ### Exercise + Debug this code. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + define food_order + toppings = ask 'pepperoni, tuna, veggie or cheese?' + size = ask 'big, medium or small?' + number_of_pizza = ask 'How many these pizzas would you like?' + + print 'YOU ORDERED' + print number_of_pizzas ' size ' topping ' pizza' + + define drinks_order + drink = ask 'water, coke, icetea, lemonade or coffee?' + number_of_drinks = ask 'How many of these drinks would you like?' + + print 'YOU ORDERED' + print number_of_drinks ' ' drink + + 'Welcome to Hedy pizza' + more_food = ask 'Would you like to order a pizza?' + while more_food = 'yes' + return food_order + more_food = ask 'Would you like to order a pizza?' + more_drinks = ask 'Would you like to order some drinks?' + while more_drinks == 'yes' + call drink_order + more_drinks == ask 'Would you like to order more drinks?' + + + print 'Thanks for ordering!' + ``` + start_code: |4 + + define food_order + toppings = ask 'pepperoni, tuna, veggie or cheese?' + size = ask 'big, medium or small?' + number_of_pizza = ask 'How many these pizzas would you like?' + + print 'YOU ORDERED' + print number_of_pizzas ' size ' topping ' pizza' + + define drinks_order + drink = ask 'water, coke, icetea, lemonade or coffee?' + number_of_drinks = ask 'How many of these drinks would you like?' + + print 'YOU ORDERED' + print number_of_drinks ' ' drink + + 'Welcome to Hedy pizza' + more_food = ask 'Would you like to order a pizza?' + while more_food = 'yes' + return food_order + more_food = ask 'Would you like to order a pizza?' + more_drinks = ask 'Would you like to order some drinks?' + while more_drinks == 'yes' + call drink_order + more_drinks == ask 'Would you like to order more drinks?' + + + print 'Thanks for ordering!' + 18: + story_text: |- + ### Exercise + Debug this Old MacDonald program from level 16. Good luck! + example_code: | + **Warning! This code needs to be debugged!** + ``` + animals = ['pig', 'dog', 'cow'] + sounds = ['oink', 'woof', 'moo'] + for i in range 1 to 3 + animal = animals[i] + sound = sounds[i] + print 'Old McDonald had a farm' + print 'E I E I O!' + print 'and on that farm he had a ' animal + print 'E I E I O!' + print 'with a ' sound sound ' here' + print 'and a ' sound sound ' there' + print 'here a ' sound + print 'there a ' sound + print 'everywhere a ' sound sound + ``` + start_code: |4 + + animals = ['pig', 'dog', 'cow'] + sounds = ['oink', 'woof', 'moo'] + for i in range 1 to 3 + animal = animals[i] + sound = sounds[i] + print 'Old McDonald had a farm' + print 'E I E I O!' + print 'and on that farm he had a ' animal + print 'E I E I O!' + print 'with a ' sound sound ' here' + print 'and a ' sound sound ' there' + print 'here a ' sound + print 'there a ' sound + print 'everywhere a ' sound sound + default: + name: Introduction + default_save_name: intro + description: Level explanation + levels: + 1: + story_text: | + Welcome to Hedy! In Level 1 you can start by printing a story. + + Try the code yourself with the green 'Run code' button under the programming field. + + Ready? Then go to the next tab to learn your first command! + start_code: '{print} hello world!' + 2: + story_text: | + 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. + example_code: | + **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 + ``` + story_text_2: | + If the player types a hamburger and coke, you can't say "so you would like a hamburger and coke", but you have to make two separate line. + Also, the `{echo}` command only echoes the word at the end of the sentence. So you can't say "your hamburger is coming right up!". + + 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! + start_code: '{print} hello world!' + 3: + story_text: | + In the previous level you've learned what a variable is and how you can use it to make your adventures more interactive. + But... that's not the only thing you can do with variables! You can also use variables to make lists. + And you can even let Hedy pick a random word out of a list, which allows you to make real games! + Take a quick look at the next tab! + start_code: '{print} hello world!' 4: - start_code: '# place your code here' - example_code: "```\n_ Add quotation marks to this code _\n{print} Escape from the haunted house!\n{print} There are 3 doors in front of you...\nchoice {is} {ask} Which door do you choose?\n{print} You picked door ... choice\nmonsters {is} a zombie, a vampire, NOTHING YOUVE ESCAPED\n{print} You see...\n{sleep}\n{print} monsters {at} {random}\n ```\n" - story_text: "In this level you learn how to use quotation marks in your games.\n\n### Exercise\nCan you make your Haunted House level 4 proof?\n\n### Exercise 2\nGo 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.\n" + story_text: | + 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. + example_code: | + ``` + name {is} Sophie + {print} My name is name + ``` + start_code: | + name {is} Sophie + {print} My name is name 5: - example_code: "```\n{print} 'Escape from the haunted house!'\n{print} 'There are 3 doors in front of you...'\ndoors {is} 1, 2, 3\nmonsters {is} werewolf, mummy, vampire, zombie\nchosen_door {is} {ask} 'Which door do you choose?'\n{print} 'You chose door...' chosen_door\n{sleep}\ncorrect_door {is} doors {at} {random}\n_ _ _ _ {print} 'Great! Youve escaped!'\n{else} {print} 'Oh no! You are being eaten by a...' monsters {at} {random}\n```\n" - story_text: "Up until this level the haunted house game always asked the player to choose a door, but as you might have noticed, they didn't really have to answer correctly.\nIf the player filled in a completely random answer, the game would still work and the player might even win (despite not picking a door).\nIn this level you can only win the game by picking the same door Hedy picked randomly.\n\n### Exercise\nCan you find the 4 missing words to complete the code?\n" + story_text: | + In the previous levels 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 this level 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 go to next tab for the new command! + example_code: | + ``` + password {is} {ask} 'What is the correct password?' + ``` + start_code: |- + name {is} {ask} 'what is your name?' + {if} name {is} Hedy {print} 'cool!' {else} {print} 'meh' + 6: + story_text: | + In the previous level you have practiced with `{ask}` and `{if}`. For example you can ask guests what they would like to eat. + What you can't yet do though, is calculate the price for everyone's dinner. + + The next level makes it possible to use addition, subtraction and multiplication in your programs. This way you can calculate the prices in your restaurant, but you could also add a secret code to give your friends and family a discount. + Another option in the next level is programming your own maths game, for your little brother or sister to practice their multiplications. + Go see for yourself! + example_code: | + ``` + food_price {is} 0 + drink_price {is} 0 + total_price {is} 0 + {print} 'Welcome to McHedy' + order {is} {ask} 'What would you like to eat?' + {if} order {is} hamburger food_price {is} 5 + {if} order {is} fries food_price {is} 2 + drink {is} {ask} 'What would you like to drink?' + {if} drink {is} water drink_price {is} 0 + {else} drink_price {is} 3 + total_price {is} food_price + drink_price + {print} 'That will be ' total_price ' dollars, please' + ``` start_code: '# place your code here' - 1: - story_text: "In this adventure you are working towards making a game in which you have to escape from a haunted house by picking the correct door.\nIf you pick the right door you'll survive, but if not a terrible monster might...\n\nIn level 1 we start our haunted house game by making up a scary story and ask the player what monster they'll see in the haunted house.\n" - start_code: '{print} How did I get here?' - example_code: "```\n{print} How did I get here?\n{print} I remember my friend telling me to go into the old mansion...\n{print} and suddenly everything went black.\n{print} But how did I end up on the floor...?\n{print} My head hurts like Ive been hit by a baseball bat!\n{print} What's that sound?\n{print} Oh no! I feel like Im not alone in this house!\n{print} I need to get out of here!\n{print} There are 3 doors in front of me..\n{ask} Which door should i pick?\n{echo} I choose door\n{print} ...?\n```\n" - story_text_2: "### Exercise\nCopy the example code to your input screen by clicking the yellow button.\nNow finish the story by adding at least 5 lines of code.\nRemember to start each line of codes with a `{print}` command.\n" + 7: + story_text: | + Great job! You've reached the next level, which means you have practiced with `{if}` and `{else}`. You have probably noticed that your codes are getting longer and longer. + For example if you want to program 'Happy Birthday'. + + That's a lot of code for mainly the same words over and over again. Luckily in the next tab you'll learn a solution with the `{repeat}` command, that allows you to repeat a line of code multiple times. + example_code: | + ``` + {print} 'happy birthday to you' + {print} 'happy birthday to you' + {print} 'happy birthday dear Hedy' + {print} 'happy birthday to you' + ``` + start_code: | + {print} 'happy birthday to you' + {print} 'happy birthday to you' + {print} 'happy birthday dear Hedy' + {print} 'happy birthday to you' + 8: + story_text: | + Now you've learned how to repeat one single line of code. This comes in handy, but it's not always enough. Sometimes you want to repeat multiple lines at once. + This level allows you to group a couple of lines of code, and repeat that little group of lines all at once! + example_code: | + ``` + {repeat} 5 {times} {print} 'In the next tab you can repeat multiple lines of code at once!' + ``` + start_code: '{print} ''Lets go to the next tab!''' + 9: + story_text: | + Great job! You've reached another new level! In the previous level you've learned to use multiple lines of code in an {if} or {repeat} command. But you can't yet combine the two... + Good news! In this level you will be allowed to put an {if} inside an {if}, or inside a {repeat} command. + example_code: | + ``` + answer = {ask} 'Are you ready to learn something new?' + {if} answer {is} yes + {print} 'Great! You can learn to use the repeat command in the if command!' + {print} 'Hooray!' + {print} 'Hooray!' + {print} 'Hooray!' + {else} + {print} 'Maybe you should practice some more in the previous level' + start_code: '{print} Lets go to the next tab!' + 10: + story_text: | + You're doing great! In the previous levels we still faced a small problem. You have learned to repeat lines, but what if you'd want to slightly change the line. + For example if you want to sing the song 'if you're happy and you know it'. It would look like this: + + If you'd also want the next verse 'stomp your feet', and the next one, and the next one, you'd have to change the code completely. + In this level you'll learn the `{for}` command, which allows you to make a list of actions and repeat the code with another action each time! + Please take a look! + example_code: | + ``` + {repeat} 2 {times} + {print} 'if youre happy and you know it clap your hands' + {print} 'if youre happy and you know it and you really want to show it' + {print} 'if youre happy and you know it clap your hands' + ``` + start_code: '{print} ''Lets go to the next tab!''' + 11: + story_text: | + You have reached level 11, you're doing great! In the higher levels, Hedy is focussing more and more on teaching you the programming language Python. + In Python there is no `{repeat}` command, but there is a command that works like {repeat}. Are you curious to find out how to say `{repeat}` in Python language? Quickly go on to find out! + start_code: '{print} ''Lets go to the next tab!''' + 12: + story_text: | + Maybe you have tried using decimal numbers in your restaurant adventure. If you did, you probably noticed that Hedy didn't understand them yet and always rounded off. + From this level on you can use decimal numbers. + example_code: | + ``` + burger = 5 + drink = 2 + total = burger + drink + print 'You have ordered a burger and a drink' + print 'That costs ' total ' dollars please' + ``` + start_code: '{print} ''Lets go to the next tab!''' + 13: + story_text: | + In the previous levels you learned how to put two `{if}`commands inside each other. This works fine, but it does give you very long and unhandy codes like this one: + + In this system you have to give both the correct username and the correct password. + In this level you will learn the `{and}` command that will make this code a lot shorter and more understandable! + Check it out! + example_code: | + ``` + username = {ask} 'What is your username?' + password = {ask} 'What is your password?' + {if} username {is} 'Hedy' + {if} password {is} 'secret' + {print} 'Welcome Hedy!' + {else} + {print} 'Access denied' + {else} + {print} 'Access denied!' + ``` + start_code: '{print} ''Lets go to the next tab!''' + 14: + story_text: | + With the program below you can calculate if you've passed a subject at school (so, a grade of six or higher). + You can see this code is extremely inefficient, due to the very long code in line 5. + All the different grades from 1 to 5 had to be programmed separately. Lucky for you, in this level you'll learn how to do this without this extremely long code! + example_code: | + ``` + first_grade = {ask} 'What score did you get on your first test?' + second_grade = {ask} 'What score did you get on your second test?' + added = first_grade + second_grade + mean_grade = added / 2 + {if} mean_grade = 1 {or} mean_grade = 2 {or} mean_grade = 3 {or} mean_grade = 4 {or} mean_grade = 5 + {print} 'Oh no! You have failed the subject...' + {else} + {print} 'Great! You have passed the subject!' + ``` + start_code: | + answer = {ask} 'Do you want to learn more?' + {if} answer == 'yes' + {print} 'Go to the next adventure!' + {if} answer != 'yes' + {print} 'That is a shame!' + 15: + story_text: | + In this game below a code has been made to make sure the player can play on as long as they want... + But the code is ineffective and way too long. Also, what if the player wants to play 101 games instead of 100? + You can't play to infinity? + In this level you will learn a command that makes all of this a lot easier! + example_code: | + ``` + game = 'on' + {for} i {in} {range} 1 {to} 100 + {if} game == 'on' + answer = {ask} 'Do you want to continue?' + {if} answer == 'no' + game = 'over' + {if} answer == 'yes' + {print} 'Ok we will continue' + ``` + start_code: '{print} ''Lets go to the next tab!''' 16: - story_text: "### Exercise\nThis haunted house game uses the connection between the lists you can use in this level.\nFor example: all the properties that belong to the zombie are first in all the lists, witch second and vampire third.\nCheck out the code and fill in `weapons[i]`, `monsters[i]` , `bad_fate[i]`, `good_fate[i]`, `hint[i]` on the correct blanks to get the code to work!\n" - example_code: "```\nnumbers = [1, 2, 3]\ni = numbers[{random}]\nhint = ['growling', 'a cackling laugh', 'fluttering batwings']\nmonsters = ['zombie', 'witch', 'vampire']\nbad_fate = ['Your brain is eaten', 'You are forever cursed', 'You are bitten']\ngood_fate = ['You throw the ham. The zombie is distracted and starts eating it.', 'You set the curtains on fire. The witch flees out of fear for the fire', 'The vampire hates garlic and flees']\nweapons = ['ham', 'lighter', 'garlic']\n{print} 'You are standing in front of an old mansion'\n{print} 'Something is not right here'\n{print} 'You hear ' _\n{print} 'You are going to explore it'\n{print} 'You enter the kitchen and see a lighter, a raw ham and a garlic.'\nyour_weapon = {ask} 'What do you bring with you?'\n{print} 'With your ' your_weapon ' you enter the living room'\n{print} 'There you find a ' _\nneeded_weapon = _\n{if} your_weapon == needed_weapon\n {print} 'You use your ' your_weapon\n {print} _\n {print} 'YOU WIN!'\n{else}\n {print} 'You have chosen the wrong weapon...'\n {print} _\n {print} 'GAME OVER'\n```\n" - start_code: '# place your code here' - 3: - example_code: "```\n_ Escape from the haunted house!\n_ There are 3 doors in front of you...\n_ _ _ Which door do you choose?\n_ You picked door ... choice\nmonsters _ a zombie, a vampire, NOTHING YOUVE ESCAPED\n_ You see...\n{sleep}\n_ _ _ _\n```\n" - start_code: '# place your code here' - story_text: "In the previous levels you've made an introduction to your haunted house game, but as you might have noticed the story would always have a dreadful end.\nIn this level you can make your story more interactive by changing the outcome of the game; sometimes you'll get eaten, sometimes you'll escape!\nLet Hedy decide randomly!\n\n### Exercise\nCopy the example codes and fill in the blanks to make it work!\n\n**Extra** This story is pretty straight forward, maybe you can spook it up a bit by adding a more exciting story.\nAlso you have very limited outcomes right now, there are only 3 options of what's behind the doors. Maybe you can think of more monsters to add to the list!\n" - 2: - story_text_2: "### Exercise\nIn the example above the monsters are predetermined. So each time you run your code, the output is the same.\nCan you add `{ask}` commands to make the haunted house interactive and have the players choose the monsters they come across?\n" - start_code: monster1 {is} _ - example_code_2: "```\nmonster_1 {is} _\nmonster_2 {is} _\nmonster_3 {is} _\n{print} You enter the haunted house.\n{print} Suddenly you see a monster_1\n{print} You run into the other room...\n{print} But a monster_2 is waiting there for you!\n{print} Oh no! Quickly get to the kitchen.\n{print} But as you enter monster_3 attacks you!\n```\n" - example_code: "```\nmonster_1 {is} 👻\nmonster_2 {is} 🤡\nmonster_3 {is} 👶\n{print} You enter the haunted house.\n{print} Suddenly you see a monster_1\n{print} You run into the other room...\n{print} But a monster_2 is waiting there for you!\n{print} Oh no! Quickly get to the kitchen.\n{print} But as you enter monster_3 attacks you!\n```\n" - story_text: "In this haunted house you can choose your monsters with emojis. Of course you could also use words.\n" - description: Escape from the haunted house - default_save_name: Haunted House - name: Haunted House + story_text: | + In this level we will grow a bit more towards real Python code. You will also learn how to match two lists together. + This way you can program a code in which the correct animal is matched to the right sound. + Because the two codes below... Are obviously nonsense! + example_code: |- + ``` + animals = 'chicken', 'horse', 'cow' + sounds = 'cluck', 'neigh', 'moo' + {for} animal {in} animals + {print} 'A ' animal ' says ' sounds {at} {random} + ``` + You could also try to make it work this way, but.... + ``` + animals = 'chicken', 'horse', 'cow' + sounds = 'cluck', 'neigh', 'moo' + {for} animal {in} animals + {for} sound {in} sounds + {print} 'A ' animal ' says ' sound + ``` + Note: These codes will not work like this in this level. Head to the next tab to see which parts you need to correct. + start_code: '{print} ''Lets go to the next tab!''' + 17: + story_text: | + Now we are going to change indentation a little bit. Every time that we need an indentation, we need `:` at the line before the indentation. + + In this level you can also use a new command: `{elif}`. `{elif}` is short for {else} {if} and you need it when you want to make 3 (or more!) options. + Check it out! + start_code: '{print} ''Lets go to the next tab!''' + 18: + story_text: | + Congratulations! You have reached the last level of Hedy! The code you have created here can be copied to real Python environments like replit or PyCharm, and you can continue learning there! + Note however that Python can only read English commands, so if you have been using other languages, you will need to switch to English now. + start_code: '{print} (''Great job!!!'')' dice: + name: Dice + default_save_name: Dice + description: Make your own dice levels: - 10: - start_code: '# place your code here' - story_text: "### Exercise\nIs everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once!\nChange the names into names of your friends or family, and finish the code so they each roll.\n" - example_code: "```\nplayers = Ann, John, Jesse\nchoices = 1, 2, 3, 4, 5, 6\n_ _ _ _\n {print} player ' throws ' choices {at} {random}\n {sleep}\n```\n" + 3: + story_text: | + In this level we can choose from a list. With that we can let the computer choose one side of the die. + Take a look at the games you have in your closet at home. + Are there games with a (special) die? You can also copy it with this code. + For example, the dice of the game Earthworms with the numbers 1 to 5 and an earthworm on it. + + ![Die of earthworms with 1 to 5 and an earthworm on it](https://cdn.jsdelivr.net/gh/felienne/hedy@24f19e9ac16c981517e7243120bc714912407eb5/coursedata/img/dobbelsteen.jpeg) + example_code: | + ``` + choices {is} 1, 2, 3, 4, 5, earthworm + {print} You threw _ {at} {random} ! + ``` + story_text_2: | + ### Exercise + The dice in the example above are dice for a specific game. Can you make normal dice? + Or other special dice from a different game? + example_code_2: | + ``` + choices {is} _ + ``` + start_code: | + choices {is} 1, 2, 3, 4, 5, earthworm + {print} You threw _ {at} {random} ! + 4: + story_text: | + 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. + start_code: '{print} ''What will the die indicate this time?''' + 5: + story_text: | + We are going to add the `{if}` and `{else}` commands to our dice! + + ### Exercise + Complete the sample code so that the code says "You can stop throwing" once you have thrown an earthworm. It should say "You have to throw again" if you've thrown anything else. + **Extra** Maybe you want to recreate a die from a completely different game. That's fine too! Then make up your own reaction, e.g. 'yes' for 6 and 'pity' for something else. + example_code: | + ``` + choices {is} 1, 2, 3, 4, 5, earthworm + throw {is} choices {at} {random} + {print} 'you have thrown ' throw + _ throw {is} earthworm {print} 'You can stop throwing.' + _ {print} 'You have to throw it again!' + ``` + start_code: '{print} ''What will the die indicate this time?''' 6: - story_text: "You can also make an Earthworm die again in this, but now you can also calculate how many points have been rolled.\nYou may know that the worm counts 5 points for Earthworms. Now after a roll you can immediately calculate how many points you have thrown.\nThis is the code to calculate points for one die:\n\n### Exercise\nCan you make the code so that you get the total score for 8 dice? To do that, you have to copy and paste some lines of the code.\n" - start_code: "{print} 'What will the die indicate this time?'" - example_code: "```\nchoices = 1, 2, 3, 4, 5, earthworm\npoints = 0\nthrow = choices {at} {random}\n{print} 'you threw ' throw\n{if} throw {is} earthworm points = points + 5 {else} points = points + throw\n{print} 'those are ' points ' points'\n```\n" - example_code_2: "Did you manage to calculate the score for 8 dice? That required a lot of copy and pasting, right? We are going to make that easier in level 7!\n" + story_text: | + You can also make an Earthworm die again in this, but now you can also calculate how many points have been rolled. + You may know that the worm counts 5 points for Earthworms. Now after a roll you can immediately calculate how many points you have thrown. + This is the code to calculate points for one die: + + ### Exercise + Can you make the code so that you get the total score for 8 dice? To do that, you have to copy and paste some lines of the code. + example_code: | + ``` + choices = 1, 2, 3, 4, 5, earthworm + points = 0 + throw = choices {at} {random} + {print} 'you threw ' throw + {if} throw {is} earthworm points = points + 5 {else} points = points + throw + {print} 'those are ' points ' points' + ``` + example_code_2: | + Did you manage to calculate the score for 8 dice? That required a lot of copy and pasting, right? We are going to make that easier in level 7! + start_code: '{print} ''What will the die indicate this time?''' 7: - example_code: "```\nchoices = 1, 2, 3, 4, 5, 6\n_ _ _ _ _ _ _\n```\n" - story_text: "You can also make a dice again in this level. With the `{repeat}` code you can easily roll a whole hand of dice.\n\n### Exercise\nTry to finish the sample code! **Extra** Think of a game you know that involves a dice and program that using a `{repeat}`.\n" - start_code: "{print} 'What will the dice indicate this time?'" - 4: - start_code: "{print} 'What will the die indicate this time?'" - story_text: "In this level you can also create dice. But this time you can try it yourself, without an example code!\n\n### Exercise\nMake your own dice in this level.\nTip: 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.\n" - 3: - story_text_2: "### Exercise\nThe dice in the example above are dice for a specific game. Can you make normal dice?\nOr other special dice from a different game?\n" - start_code: "choices {is} 1, 2, 3, 4, 5, earthworm\n{print} You threw _ {at} {random} !\n" - example_code_2: "```\nchoices {is} _\n```\n" - example_code: "```\nchoices {is} 1, 2, 3, 4, 5, earthworm\n{print} You threw _ {at} {random} !\n```\n" - story_text: "In this level we can choose from a list. With that we can let the computer choose one side of the die.\nTake a look at the games you have in your closet at home.\nAre there games with a (special) die? You can also copy it with this code.\nFor example, the dice of the game Earthworms with the numbers 1 to 5 and an earthworm on it.\n\n![Die of earthworms with 1 to 5 and an earthworm on it](https://cdn.jsdelivr.net/gh/felienne/hedy@24f19e9ac16c981517e7243120bc714912407eb5/coursedata/img/dobbelsteen.jpeg)\n" + story_text: | + You can also make a dice again in this level. With the `{repeat}` code you can easily roll a whole hand of dice. + + ### Exercise + Try to finish the sample code! **Extra** Think of a game you know that involves a dice and program that using a `{repeat}`. + example_code: | + ``` + choices = 1, 2, 3, 4, 5, 6 + _ _ _ _ _ _ _ + ``` + start_code: '{print} ''What will the dice indicate this time?''' + 10: + story_text: | + ### Exercise + Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! + Change the names into names of your friends or family, and finish the code so they each roll. + example_code: | + ``` + players = Ann, John, Jesse + choices = 1, 2, 3, 4, 5, 6 + _ _ _ _ + {print} player ' throws ' choices {at} {random} + {sleep} + ``` + start_code: '# place your code here' 15: - example_code: "```\noptions = 1, 2, 3, 4, 5, 6\n{print} 'Throw 6 as fast as you can!'\nthrown = 0\ntries = 0\n_\n_\n_\n_\n_\n{print} 'Yes! You have thrown 6 in ' tries ' tries.'\n```\n" - story_text: "### Exercise\nIn this level you can create a little game in which you'll have to throw 6 as fast as possible.\nWe have started the code, it's up to you to get the game to work!\n\nFirstly, add a `{while}` loop that checks if 6 has been thrown or not.\nAs long as you haven't thrown 6 already, throw the dice on a random number.\nPrint what the player has thrown.\nAdd a try to the amount of tries\nWait a second before you throw again, or - in case you've thrown a 6 - before the game ends.\n" + story_text: | + ### Exercise + In this level you can create a little game in which you'll have to throw 6 as fast as possible. + We have started the code, it's up to you to get the game to work! + + Firstly, add a `{while}` loop that checks if 6 has been thrown or not. + As long as you haven't thrown 6 already, throw the dice on a random number. + Print what the player has thrown. + Add a try to the amount of tries + Wait a second before you throw again, or - in case you've thrown a 6 - before the game ends. + example_code: | + ``` + options = 1, 2, 3, 4, 5, 6 + {print} 'Throw 6 as fast as you can!' + thrown = 0 + tries = 0 + _ + _ + _ + _ + _ + {print} 'Yes! You have thrown 6 in ' tries ' tries.' + ``` start_code: '# place your code here' - 5: - example_code: "```\nchoices {is} 1, 2, 3, 4, 5, earthworm\nthrow {is} choices {at} {random}\n{print} 'you have thrown ' throw\n_ throw {is} earthworm {print} 'You can stop throwing.'\n_ {print} 'You have to throw it again!'\n```\n" - start_code: "{print} 'What will the die indicate this time?'" - story_text: "We are going to add the `{if}` and `{else}` commands to our dice!\n\n### Exercise\nComplete the sample code so that the code says \"You can stop throwing\" once you have thrown an earthworm. It should say \"You have to throw again\" if you've thrown anything else.\n**Extra** Maybe you want to recreate a die from a completely different game. That's fine too! Then make up your own reaction, e.g. 'yes' for 6 and 'pity' for something else.\n" - default_save_name: Dice - name: Dice - description: Make your own dice - default: + dishes: + name: Dishes? + default_save_name: Dishes + description: Use the computer to see who does the dishes levels: - 16: - story_text: "In this level we will grow a bit more towards real Python code. You will also learn how to match two lists together.\nThis way you can program a code in which the correct animal is matched to the right sound.\nBecause the two codes below... Are obviously nonsense!\n" - example_code: "```\nanimals = 'chicken', 'horse', 'cow'\nsounds = 'cluck', 'neigh', 'moo'\n{for} animal {in} animals\n {print} 'A ' animal ' says ' sounds {at} {random}\n```\nYou could also try to make it work this way, but....\n```\nanimals = 'chicken', 'horse', 'cow'\nsounds = 'cluck', 'neigh', 'moo'\n{for} animal {in} animals\n {for} sound {in} sounds\n {print} 'A ' animal ' says ' sound\n```\nNote: These codes will not work like this in this level. Head to the next tab to see which parts you need to correct." - start_code: "{print} 'Lets go to the next tab!'" - 2: - start_code: '{print} hello world!' - story_text_2: "If the player types a hamburger and coke, you can't say \"so you would like a hamburger and coke\", but you have to make two separate line.\nAlso, the `{echo}` command only echoes the word at the end of the sentence. So you can't say \"your hamburger is coming right up!\".\n\nThat 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.\nSo let's go to the next tab!\n" - story_text: "Congratulations! You've reached level 2. Hopefully you've already made some awesome codes!\nIn the first level you might've notice that the `{echo}` command can only save one bit of information at a time.\nFor 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.\n" - example_code: "**Warning! This code does not work!**\nIn 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.\n```\n{print} Welcome at Hedy's\n{ask} What would you like to eat?\n{echo} So you want\n{ask} what would you like to drink?\n{echo} So you want\n```\n" - 10: - example_code: "```\n{repeat} 2 {times}\n {print} 'if youre happy and you know it clap your hands'\n{print} 'if youre happy and you know it and you really want to show it'\n{print} 'if youre happy and you know it clap your hands'\n```\n" - story_text: "You're doing great! In the previous levels we still faced a small problem. You have learned to repeat lines, but what if you'd want to slightly change the line.\nFor example if you want to sing the song 'if you're happy and you know it'. It would look like this:\n\nIf you'd also want the next verse 'stomp your feet', and the next one, and the next one, you'd have to change the code completely.\nIn this level you'll learn the `{for}` command, which allows you to make a list of actions and repeat the code with another action each time!\nPlease take a look!\n" - start_code: "{print} 'Lets go to the next tab!'" - 12: - story_text: "Maybe you have tried using decimal numbers in your restaurant adventure. If you did, you probably noticed that Hedy didn't understand them yet and always rounded off.\nFrom this level on you can use decimal numbers.\n" - start_code: "{print} 'Lets go to the next tab!'" - example_code: "```\nburger = 5\ndrink = 2\ntotal = burger + drink\nprint 'You have ordered a burger and a drink'\nprint 'That costs ' total ' dollars please'\n```\n" 3: - start_code: '{print} hello world!' - story_text: "In the previous level you've learned what a variable is and how you can use it to make your adventures more interactive.\nBut... that's not the only thing you can do with variables! You can also use variables to make lists.\nAnd you can even let Hedy pick a random word out of a list, which allows you to make real games!\nTake a quick look at the next tab!\n" - 15: - story_text: "In this game below a code has been made to make sure the player can play on as long as they want...\nBut the code is ineffective and way too long. Also, what if the player wants to play 101 games instead of 100?\nYou can't play to infinity?\nIn this level you will learn a command that makes all of this a lot easier!\n" - start_code: "{print} 'Lets go to the next tab!'" - example_code: "```\ngame = 'on'\n{for} i {in} {range} 1 {to} 100\n {if} game == 'on'\n answer = {ask} 'Do you want to continue?'\n {if} answer == 'no'\n game = 'over'\n {if} answer == 'yes'\n {print} 'Ok we will continue'\n```\n" + story_text: | + Do you always disagree at home about who should wash the dishes or change the litter box today? + Then you can let the computer choose very fairly. You can program that in this level! + example_code: | + ``` + people {is} mom, dad, Emma, Sophie + {print} people {at} {random} has to do the dishes + ``` + story_text_2: | + ### Exercise + Make your own version of the dishwasher program. Firstly make a list of your family members. + Then think of a task that needs to be done, and let the computer decide who has to do the task with the `{at} {random}` command. + + **Extra** Don't feel like doing the dishes yourself? Hack the program by removing your name from the list with the `{remove}` `{from}` command. + start_code: '{print} Who does the dishes?' 4: - start_code: "name {is} Sophie\n{print} My name is name\n" - story_text: "In the previous levels you've been practising with variables, but you may have come across this problem.\nYou might have tried to run a code like this:\n\nOf course you wanted to print\n\n`My name is Sophie`\n\nbut Hedy prints\n\n`My Sophie is Sophie`.\n\nIn this level this problem is fixed by using quotation marks.\n" - example_code: "```\nname {is} Sophie\n{print} My name is name\n```\n" + story_text: | + 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. + example_code: | + ``` + people {is} mom, dad, Emma, Sophie + {print} _ the dishes are done by _ + {sleep} + {print} people {at} _ + ``` + start_code: '{print} ''Who does the dishes?''' + 5: + story_text: | + With the `{if}` you can now have more fun with choice in the program. You can have your program respond to the choice that the computer has made. + ### Exercise + Can you finish the code so that it prints 'too bad' when it is your turn and otherwise 'yes!'? + Don't forget the quotes! + example_code: | + ``` + people {is} mom, dad, Emma, Sophie + dishwasher {is} people {at} {random} + _ dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ + _ {print} 'luckily no dishes because ' _ ' is already washing up' + ``` + start_code: '{print} ''Who does the dishes?''' 6: - example_code: "```\nfood_price {is} 0\ndrink_price {is} 0\ntotal_price {is} 0\n{print} 'Welcome to McHedy'\norder {is} {ask} 'What would you like to eat?'\n{if} order {is} hamburger food_price {is} 5\n{if} order {is} fries food_price {is} 2\ndrink {is} {ask} 'What would you like to drink?'\n{if} drink {is} water drink_price {is} 0\n{else} drink_price {is} 3\ntotal_price {is} food_price + drink_price\n{print} 'That will be ' total_price ' dollars, please'\n```\n" - story_text: "In the previous level you have practiced with `{ask}` and `{if}`. For example you can ask guests what they would like to eat.\nWhat you can't yet do though, is calculate the price for everyone's dinner.\n\nThe next level makes it possible to use addition, subtraction and multiplication in your programs. This way you can calculate the prices in your restaurant, but you could also add a secret code to give your friends and family a discount.\nAnother option in the next level is programming your own maths game, for your little brother or sister to practice their multiplications.\nGo see for yourself!\n" - start_code: '# place your code here' - 1: - story_text: "Welcome to Hedy! In Level 1 you can start by printing a story.\n\nTry the code yourself with the green 'Run code' button under the programming field.\n\nReady? Then go to the next tab to learn your first command!\n" - start_code: '{print} hello world!' + story_text: | + How often is everyone going to do the dishes? Is that fair? You can count it in this level. + example_code: | + ``` + people = mom, dad, Emma, Sophie + emma_washes = 0 + dishwasher = people {at} {random} + {print} 'The dishwasher is' dishwasher + {if} dishwasher {is} Emma emma_washes = emma_washes + 1 + {print} 'Emma will do the dishes this week' emma_washes 'times' + ``` + + Now you can copy lines 3 to 5 a few times (e.g. 7 times for a whole week) to calculate for a whole week again. + Do you make the code for the whole week? + story_text_2: | + If you are extremely unlucky the previous program might choose you to do the dishes for the whole week! That's not fair! + To create a fairer system you can use the `{remove}` command to remove the chosen person from the list. This way you don't have to do the dishes again until everybody has had a turn. + + Monday and Tuesday are ready for you! Can you add the rest of the week? + And… can you come up with a solution for when your list is empty? + example_code_2: | + ``` + people = mom, dad, Emma, Sophie + dishwasher = people {at} {random} + {print} 'Monday the dishes are done by: ' dishwasher + {remove} dishwasher {from} people + dishwasher = people {at} {random} + {print} 'Tuesday the dishes are done by: ' dishwasher + {remove} dishwasher {from} people + ``` + start_code: '{print} ''Who does the dishes?''' 7: - story_text: "Great job! You've reached the next level, which means you have practiced with `{if}` and `{else}`. You have probably noticed that your codes are getting longer and longer.\nFor example if you want to program 'Happy Birthday'.\n\nThat's a lot of code for mainly the same words over and over again. Luckily in the next tab you'll learn a solution with the `{repeat}` command, that allows you to repeat a line of code multiple times.\n" - start_code: "{print} 'happy birthday to you'\n{print} 'happy birthday to you'\n{print} 'happy birthday dear Hedy'\n{print} 'happy birthday to you'\n" - example_code: "```\n{print} 'happy birthday to you'\n{print} 'happy birthday to you'\n{print} 'happy birthday dear Hedy'\n{print} 'happy birthday to you'\n```\n" - 13: - example_code: "```\nusername = {ask} 'What is your username?'\npassword = {ask} 'What is your password?'\n{if} username {is} 'Hedy'\n {if} password {is} 'secret'\n {print} 'Welcome Hedy!'\n {else}\n {print} 'Access denied'\n{else}\n {print} 'Access denied!'\n```\n" - story_text: "In the previous levels you learned how to put two `{if}`commands inside each other. This works fine, but it does give you very long and unhandy codes like this one:\n\nIn this system you have to give both the correct username and the correct password.\nIn this level you will learn the `{and}` command that will make this code a lot shorter and more understandable!\nCheck it out!\n" - start_code: "{print} 'Lets go to the next tab!'" + story_text: | + With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for multiple days! + ### Exercise + Use the `{repeat}` command to decide on who needs to wash the dishes for an entire week. Each blank needs to be filled with one command or number! + **Extra** Can you think of other tasks in the house? Adapt the code so it decides on three household chores. Do not forget to print what tasks it concerns! + example_code: | + ``` + people = mom, dad, Emma, Sophie + {repeat} _ _ {print} 'Dishwashing will be done by ' _ _ _ + ``` + start_code: '{print} ''Who does the dishes?''' + 10: + story_text: | + In this level you can make a schedule for the whole week in an easy way! + + ### Exercise + Add a second chore, such as vacuuming or tidying up, and make sure it is also divided for the whole week. +
**Extra** The program is not fair, you can be unlucky and wash up all week. How could you make the program more fair? + example_code: | + ``` + days = Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday + names = mom, dad, Emma, Sophie + {for} day {in} days + {print} names {at} {random} ' does the dishes on ' day + ``` + start_code: | + days = Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday + names = mom, dad, Emma, Sophie + {for} day {in} days + {print} names {at} {random} ' does the dishes on ' day + elif_command: + name: '{elif}' + default_save_name: elif + description: elif + levels: + 17: + story_text: | + In this level you can also use a new command: `{elif}`. `{elif}` is a combination of the keywords `{else}` and `{if}` and you need it when you want to make 3 (or more!) options. + Check it out! + example_code: | + ``` + prices = ['1 million dollars', 'an apple pie', 'nothing'] + your_price = prices[{random}] + {print} 'You win ' your_price + {if} your_price == '1 million dollars' : + {print} 'Yeah! You are rich!' + {elif} your_price == 'an apple pie' : + {print} 'Lovely, an apple pie!' + {else}: + {print} 'Better luck next time..' + ``` + start_code: |- + prices = ['1 million dollars', 'an apple pie', 'nothing'] + your_price = prices[{random}] + {print} 'You win ' your_price + {if} your_price == '1 million dollars' : + {print} 'Yeah! You are rich!' + {elif} your_price == 'an apple pie' : + {print} 'Lovely, an apple pie!' + {else}: + {print} 'Better luck next time..' + for_command: + name: '{for}' + default_save_name: for + description: for command + levels: + 10: + story_text: |- + ## For + In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. + `{for}` creates a block, like `{repeat}` and `{if}` so all lines in the block need to start with 4 spaces. + example_code: | + ``` + animals = dog, cat, blobfish + {for} animal {in} animals + {print} 'I love ' animal + ``` + start_code: |- + animals = dog, cat, blobfish + {for} animal {in} animals + {print} 'I love ' animal 11: - story_text: "You have reached level 11, you're doing great! In the higher levels, Hedy is focussing more and more on teaching you the programming language Python.\nIn Python there is no `{repeat}` command, but there is a command that works like {repeat}. Are you curious to find out how to say `{repeat}` in Python language? Quickly go on to find out!\n" - start_code: "{print} 'Lets go to the next tab!'" - 9: - example_code: "```\nanswer = {ask} 'Are you ready to learn something new?'\n{if} answer {is} yes\n {print} 'Great! You can learn to use the repeat command in the if command!'\n {print} 'Hooray!'\n {print} 'Hooray!'\n {print} 'Hooray!'\n{else}\n {print} 'Maybe you should practice some more in the previous level'\n" - start_code: '{print} Lets go to the next tab!' - story_text: "Great job! You've reached another new level! In the previous level you've learned to use multiple lines of code in an {if} or {repeat} command. But you can't yet combine the two...\nGood news! In this level you will be allowed to put an {if} inside an {if}, or inside a {repeat} command.\n" - 8: - start_code: "{print} 'Lets go to the next tab!'" - example_code: "```\n{repeat} 5 {times} {print} 'In the next tab you can repeat multiple lines of code at once!'\n```\n" - story_text: "Now you've learned how to repeat one single line of code. This comes in handy, but it's not always enough. Sometimes you want to repeat multiple lines at once.\nThis level allows you to group a couple of lines of code, and repeat that little group of lines all at once!\n" - 5: - start_code: "name {is} {ask} 'what is your name?'\n{if} name {is} Hedy {print} 'cool!' {else} {print} 'meh'" - example_code: "```\npassword {is} {ask} 'What is the correct password?'\n```\n" - story_text: "In the previous levels you've already learned to use `{at} {random}` which made your games different every time you ran the code.\nBut it's not really interactive, the player doesn't have any influence on what happens in the game.\n\nIn this level 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.\nSo let's go to next tab for the new command!\n" - 18: - start_code: "{print} ('Great job!!!')" - story_text: "Congratulations! You have reached the last level of Hedy! The code you have created here can be copied to real Python environments like replit or PyCharm, and you can continue learning there!\nNote however that Python can only read English commands, so if you have been using other languages, you will need to switch to English now.\n" - 14: - start_code: "answer = {ask} 'Do you want to learn more?'\n{if} answer == 'yes'\n {print} 'Go to the next adventure!'\n{if} answer != 'yes'\n {print} 'That is a shame!'\n" - story_text: "With the program below you can calculate if you've passed a subject at school (so, a grade of six or higher).\nYou can see this code is extremely inefficient, due to the very long code in line 5.\nAll the different grades from 1 to 5 had to be programmed separately. Lucky for you, in this level you'll learn how to do this without this extremely long code!\n" - example_code: "```\nfirst_grade = {ask} 'What score did you get on your first test?'\nsecond_grade = {ask} 'What score did you get on your second test?'\nadded = first_grade + second_grade\nmean_grade = added / 2\n{if} mean_grade = 1 {or} mean_grade = 2 {or} mean_grade = 3 {or} mean_grade = 4 {or} mean_grade = 5\n {print} 'Oh no! You have failed the subject...'\n{else}\n {print} 'Great! You have passed the subject!'\n```\n" + story_text: |- + In this level, we add a new form of the `{for}`. In earlier levels, we used `{for}` with a list, but we can also use `{for}` with numbers. + We do that by adding a variable name, followed by `{in}` `{range}`. We then write the number to start at, `{to}` and the number to end at. + + Try the example to see what happens! In this level again, you will need to use indentations in lines below the `{for}` statements. + example_code: | + ``` + {for} counter {in} {range} 1 {to} 10 + {print} counter + {print} 'Ready or not. Here I come!' + ``` + start_code: |- + {for} counter {in} {range} 1 {to} 10 + {print} counter + {print} 'Ready or not. Here I come!' 17: - start_code: "{print} 'Lets go to the next tab!'" - story_text: "Now we are going to change indentation a little bit. Every time that we need an indentation, we need `:` at the line before the indentation.\n\nIn this level you can also use a new command: `{elif}`. `{elif}` is short for {else} {if} and you need it when you want to make 3 (or more!) options.\nCheck it out!\n" - default_save_name: intro - name: Introduction - description: Level explanation + story_text: | + Now we are going to change indentation a little bit. Every time that we need an indentation, we need `:` at the line before the indentation. + example_code: | + ``` + {for} i {in} {range} 1 {to} 10: + {print} i + {print} 'Ready or not, here I come!' + ``` + start_code: |- + {for} i {in} {range} 1 {to} 10: + {print} i + {print} 'Ready or not, here I come!' fortune: + name: Fortune teller + default_save_name: Fortune Teller + description: Let Hedy predict the future levels: 1: - story_text: "Have you ever been to a carnival and had your future predicted by a fortune teller? Or have you ever played with a magic eight ball?\nThen you probably know that they can't really predict your future, but it's still fun to play!\n\nIn the upcoming levels you can learn how to create your own fortune telling machine!\nIn level 1 you can start off easy by letting Hedy introduce herself as a fortune teller and let her `{echo}` the players' answers.\nLike this:\n" - example_code: "```\n_ Hello, I'm Hedy the fortune teller!\n_ Who are you?\n_ Let me take a look in my crystal ball\n_ I see... I see...\n_ Your name is\n```\n" - start_code: '# place your code here' - story_text_2: "### Exercise\nCopy the example code into your input screen and fill in the blanks to make the code work.\n**Extra** Change the code and let the fortune teller not only predict your name, but also your age, your favorite sports team or something else about yourself.\n" - 10: - story_text: "In this level you'll learn how to program the game MASH (mansion, apartment, shack, house). In this game you can predict for all the players at once, what their future will look like.\n\n### Exercise\nFil in the blanks by using the new command that you've learned this level.\n" - start_code: '# place your code here' - example_code: "```\nhouses = mansion, apartment, shack, house\nloves = nobody, a royal, their neighbour, their true love\npets = dog, cat, elephant\nnames = Jenna, Ryan, Jim\n_\n {print} name ' lives in a ' houses {at} {random}\n {print} name ' will marry ' loves {at} {random}\n {print} name ' will get a ' pets {at} {random} ' as their pet.'\n {sleep}\n```\n" - 6: - example_code: "```\n{print} 'I am Hedy the fortune teller!'\n{print} 'I can predict how many kids youll get when you grow up!'\nage = {ask} 'How old are you?'\nsiblings = {ask} 'How many siblings do you have?'\nlength = {ask} 'How tall are you in centimetres?'\nkids = length / age\nkids = kids - siblings\n{print} 'You will get ...'\n{sleep}\n{print} kids ' kids!'\n```\n" - story_text: "In this level you can use math in your predictions as a fortune teller. This allows you to make up (silly) formulas to calculate the future.\nFor example you could calculate how rich you'll get or how many kids you will have when you grow up.\n\n\n\n### Exercise\nCan you think of your own (silly) fortune telling machine?\n" + story_text: | + Have you ever been to a carnival and had your future predicted by a fortune teller? Or have you ever played with a magic eight ball? + Then you probably know that they can't really predict your future, but it's still fun to play! + + In the upcoming levels you can learn how to create your own fortune telling machine! + In level 1 you can start off easy by letting Hedy introduce herself as a fortune teller and let her `{echo}` the players' answers. + Like this: + example_code: | + ``` + _ Hello, I'm Hedy the fortune teller! + _ Who are you? + _ Let me take a look in my crystal ball + _ I see... I see... + _ Your name is + ``` + story_text_2: | + ### Exercise + Copy the example code into your input screen and fill in the blanks to make the code work. + **Extra** Change the code and let the fortune teller not only predict your name, but also your age, your favorite sports team or something else about yourself. start_code: '# place your code here' 3: - story_text_2: "### Exercise\nNow, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or 'ask again'.\n" - story_text: "In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only `{echo}`.\nIn this level you can use a variable and the `{at} {random}` command to really let Hedy choose an answer for you. Check out this code for instance:\n" + story_text: | + In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only `{echo}`. + In this level you can use a variable and the `{at} {random}` command to really let Hedy choose an answer for you. Check out this code for instance: + example_code: | + ``` + {print} I’m Hedy the fortune teller! + question {is} {ask} What do you want to know? + {print} This is what you want to know: question + answers {is} yes, no, maybe + {print} My crystal ball says... + {sleep} 2 + {print} answers {at} {random} + ``` + story_text_2: | + ### Exercise + Now, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or 'ask again'. + start_code: '# place your code here' + 4: + story_text: | + This level has no new functions, but allows you to practice with using the quotation marks. + You can remake your level 3 code, and make sure to add the quotation marks in the right places! + + Mind that in level 3, 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 4 make this possible! + + ### 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. + example_code: | + ``` + _ 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} + ``` start_code: '# place your code here' - example_code: "```\n{print} I’m Hedy the fortune teller!\nquestion {is} {ask} What do you want to know?\n{print} This is what you want to know: question\nanswers {is} yes, no, maybe\n{print} My crystal ball says...\n{sleep} 2\n{print} answers {at} {random}\n```\n" 5: - example_code: "```\nfriends {is} Jordan, Lucy, Dave\n{print} 'I can predict if you will win the lottery tomorrow!'\nperson {is} {ask} 'Who are you?'\ngood_answer {is} Hurray! You win!, You will definitely win!, We have a winner!\nbad_answer {is} Bad luck! Try again!, Another person will win, You lose!\n{if} person {in} friends {print} good_answer {at} {random}\n{else} {print} bad_answer {at} {random}\n```\n" - story_text: "### Exercise\nIn the example code you see how to make a fortune teller program that allows you to tip the odds in your favor. This cheating program always tells you that you will win the lottery, but your friends will never win.\n\nUse this to make your own program, be creative! For example you could create a code that predicts that:\n* your favorite sports team will beat all the competitors!\n* your favorite movie will be chosen for movie night!\n* you win tickets to your favorite show!\n* you are the fairest of them all, like Snow White's magic mirror.\nLet your imagination do the work!\n\nYour program has to exist of at least 10 lines of code and need to have at least one `{if}` and `{else}` command.\n" + story_text: | + ### Exercise + In the example code you see how to make a fortune teller program that allows you to tip the odds in your favor. This cheating program always tells you that you will win the lottery, but your friends will never win. + + Use this to make your own program, be creative! For example you could create a code that predicts that: + * your favorite sports team will beat all the competitors! + * your favorite movie will be chosen for movie night! + * you win tickets to your favorite show! + * you are the fairest of them all, like Snow White's magic mirror. + Let your imagination do the work! + + Your program has to exist of at least 10 lines of code and need to have at least one `{if}` and `{else}` command. + example_code: | + ``` + friends {is} Jordan, Lucy, Dave + {print} 'I can predict if you will win the lottery tomorrow!' + person {is} {ask} 'Who are you?' + good_answer {is} Hurray! You win!, You will definitely win!, We have a winner! + bad_answer {is} Bad luck! Try again!, Another person will win, You lose! + {if} person {in} friends {print} good_answer {at} {random} + {else} {print} bad_answer {at} {random} + ``` start_code: '# place your code here' - 12: - story_text: "From level 12 on, you will also have to use quotation marks in lists, before and after each item.\n\n### Exercise\nAdd two predictions to the list" - example_code: "```\nfortunes = 'you will slip on a banana peel', _\n{print} 'I will take a look in my crystal ball for your future.'\n{print} 'I see... I see...'\n{sleep}\n{print} fortunes {at} {random}\n```\n" + 6: + story_text: | + In this level you can use math in your predictions as a fortune teller. This allows you to make up (silly) formulas to calculate the future. + For example you could calculate how rich you'll get or how many kids you will have when you grow up. + + + + ### Exercise + Can you think of your own (silly) fortune telling machine? + example_code: | + ``` + {print} 'I am Hedy the fortune teller!' + {print} 'I can predict how many kids youll get when you grow up!' + age = {ask} 'How old are you?' + siblings = {ask} 'How many siblings do you have?' + length = {ask} 'How tall are you in centimetres?' + kids = length / age + kids = kids - siblings + {print} 'You will get ...' + {sleep} + {print} kids ' kids!' + ``` start_code: '# place your code here' - 4: - example_code: "```\n_ Add the quotation marks to this code _\n{print} Im Hedy the fortune teller!\nquestion {is} {ask} What do you want to know?\n{print} This is your question: question\nanswers {is} yes, no, maybe\n{print} My crystal ball says...\n{sleep} 2\n{print} answers {at} {random}\n```\n" - story_text: "This level has no new functions, but allows you to practice with using the quotation marks.\nYou can remake your level 3 code, and make sure to add the quotation marks in the right places!\n\nMind that in level 3, we couldn't use the word 'question' as both the name of the variable and a normal word that could be printed.\nThe quotation marks in level 4 make this possible!\n\n### Exercise\nWe have removed all the quotation marks from this example code, can you add them in all the right places?\n\n### Exercise 2\nGo 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.\n" + 7: + story_text: | + ### Exercise + Finish this program that tells you if your crush loves you back or not. + example_code: | + ``` + {print} 'I have a flower with magic petals' + {print} 'If you pick the petals the flower will tell you if your crush loves you back' + amount = {ask} 'How many petals do you want to pick?' + options = they love you, they love you not + _ _ _ _ options {at} {random} + ``` start_code: '# place your code here' 8: - example_code: "```\n{print} 'I am Hedy the fortune teller!'\n{print} 'You can ask me 3 questions.'\nanswers = yes, no, maybe\n_ _ _\n question = {ask} 'What do you want to know?'\n {print} question\n {sleep}\n {print} 'My crystal ball says...' answers {at} {random}\n```\n" + story_text: | + In the next example you can have your fortune teller ask multiple questions and also print them! + + ### Exercise + Can you fill in right command on the blanks? + example_code: | + ``` + {print} 'I am Hedy the fortune teller!' + {print} 'You can ask me 3 questions.' + answers = yes, no, maybe + _ _ _ + question = {ask} 'What do you want to know?' + {print} question + {sleep} + {print} 'My crystal ball says...' answers {at} {random} + ``` start_code: '# place your code here' - story_text: "In the next example you can have your fortune teller ask multiple questions and also print them!\n\n### Exercise\nCan you fill in right command on the blanks?\n" - 7: - story_text: "### Exercise\nFinish this program that tells you if your crush loves you back or not.\n" + 10: + story_text: | + In this level you'll learn how to program the game MASH (mansion, apartment, shack, house). In this game you can predict for all the players at once, what their future will look like. + + ### Exercise + Fil in the blanks by using the new command that you've learned this level. + example_code: | + ``` + houses = mansion, apartment, shack, house + loves = nobody, a royal, their neighbour, their true love + pets = dog, cat, elephant + names = Jenna, Ryan, Jim + _ + {print} name ' lives in a ' houses {at} {random} + {print} name ' will marry ' loves {at} {random} + {print} name ' will get a ' pets {at} {random} ' as their pet.' + {sleep} + ``` + start_code: '# place your code here' + 12: + story_text: |- + From level 12 on, you will also have to use quotation marks in lists, before and after each item. + + ### Exercise + Add two predictions to the list + example_code: | + ``` + fortunes = 'you will slip on a banana peel', _ + {print} 'I will take a look in my crystal ball for your future.' + {print} 'I see... I see...' + {sleep} + {print} fortunes {at} {random} + ``` start_code: '# place your code here' - example_code: "```\n{print} 'I have a flower with magic petals'\n{print} 'If you pick the petals the flower will tell you if your crush loves you back'\namount = {ask} 'How many petals do you want to pick?'\noptions = they love you, they love you not\n_ _ _ _ options {at} {random}\n```\n" - default_save_name: Fortune Teller - description: Let Hedy predict the future - name: Fortune teller functions: + name: functions + default_save_name: functions + description: functions levels: - 14: - example_code: "```\n{define} calculate_new_price {with} amount, percentage\n percentage = percentage / 100\n discount_amount = amount * percentage\n return amount - discount_amount\n\nold_price = {ask} 'How much is on the price tag?'\ndiscount = {ask} 'What percentage is the discount?'\n\nnew_price = _ calculate_new_price {with} old_price, _\n{print} 'The new price is ' new_price ' dollar'\n```\n" - start_code: "{define} calculate_new_price {with} amount, percentage\n percentage = percentage / 100\n discount_amount = amount * percentage\n return amount - discount_amount\n\nold_price = {ask} 'How much is on the price tag?'\ndiscount = {ask} 'What percentage is the discount?'\n\nnew_price = _ calculate_new_price {with} old_price, _\n{print} 'The new price is ' new_price ' dollar'\n" - story_text: "In the previous levels you have learned to create functions and use arguments with them. Another great use of a function is to let it calculate something for you.\nYou can give the function a calculation and it will give you the answer of the calculation. This answer is called a **return value**.\n\nFor example, in this code the function calculate_new_price will calculate the new price of any item. It will give you the new price as a return value.\n\n### Exercise\nFinish this code. We have already made the variable new_price for you, you only need to set it.\nYou should finish the line of code by calling the function that calculates the new price.\n" 12: - start_code: "sides = 'left', 'right'\nlimbs = 'hand', 'foot'\ncolors = 'red', 'blue', 'green', 'yellow'\n\n{define} turn\n chosen_side = sides {at} {random}\n chosen_limb = limbs _\n chosen_color = colors _\n {print} chosen_side ' ' chosen_limb ' on ' chosen_color\n\n{print} 'Lets play a game of Twister!'\n{for} i {in} {range} 1 to _\n {call} turn\n {sleep} 2\n" - story_text: "In this level you'll learn how to use **functions**. A function is a block of code you can easily use multiple times. Using functions helps us organize pieces of code that we can use again and again.\nTo create a function, use `{define}` and give the function a name. Then put all the lines you want in the function in a indented block under the `{define}` line.\nLeave one empty line in your code to make it look nice and neat. Great job! You have created a function!\n\nNow, whenever we need that block of code, we just use {call} with the function's name to call it up! We don't have to type that block of code again.\n\nCheck out this example code of a game of Twister. The function 'turn' contains a block of code that chooses which limb should go where.\n\n### Exercise\nFinish this code by setting the 2 variables chosen_limb and chosen_color.\nThen, choose how many times you want to call the function to give the twister spinner a spin.\n\n### Exercise 2\nImprove your code by adding a variable called 'people'. Use the variable to give all the players their own command in the game.\nFor example: 'Ahmed, right hand on green' or 'Jessica, left foot on yellow'.\n" - example_code: "```\nsides = 'left', 'right'\nlimbs = 'hand', 'foot'\ncolors = 'red', 'blue', 'green', 'yellow'\n\n{define} turn\n chosen_side = sides {at} {random}\n chosen_limb = limbs _\n chosen_color = colors _\n {print} chosen_side ' ' chosen_limb ' on ' chosen_color\n\n{print} 'Lets play a game of Twister!'\n{for} i {in} {range} 1 to _\n {call} turn\n {sleep} 2\n```\n" + story_text: | + In this level you'll learn how to use **functions**. A function is a block of code you can easily use multiple times. Using functions helps us organize pieces of code that we can use again and again. + To create a function, use `{define}` and give the function a name. Then put all the lines you want in the function in a indented block under the `{define}` line. + Leave one empty line in your code to make it look nice and neat. Great job! You have created a function! + + Now, whenever we need that block of code, we just use {call} with the function's name to call it up! We don't have to type that block of code again. + + Check out this example code of a game of Twister. The function 'turn' contains a block of code that chooses which limb should go where. + + ### Exercise + Finish this code by setting the 2 variables chosen_limb and chosen_color. + Then, choose how many times you want to call the function to give the twister spinner a spin. + + ### Exercise 2 + Improve your code by adding a variable called 'people'. Use the variable to give all the players their own command in the game. + For example: 'Ahmed, right hand on green' or 'Jessica, left foot on yellow'. + example_code: | + ``` + sides = 'left', 'right' + limbs = 'hand', 'foot' + colors = 'red', 'blue', 'green', 'yellow' + + {define} turn + chosen_side = sides {at} {random} + chosen_limb = limbs _ + chosen_color = colors _ + {print} chosen_side ' ' chosen_limb ' on ' chosen_color + + {print} 'Lets play a game of Twister!' + {for} i {in} {range} 1 to _ + {call} turn + {sleep} 2 + ``` + start_code: | + sides = 'left', 'right' + limbs = 'hand', 'foot' + colors = 'red', 'blue', 'green', 'yellow' + + {define} turn + chosen_side = sides {at} {random} + chosen_limb = limbs _ + chosen_color = colors _ + {print} chosen_side ' ' chosen_limb ' on ' chosen_color + + {print} 'Lets play a game of Twister!' + {for} i {in} {range} 1 to _ + {call} turn + {sleep} 2 13: - start_code: "{define} song {with} place\n {print} 'My Bonnie is over the ' place\n\n{call} song {with} 'ocean'\n{call} song {with} 'sea'\n{call} song {with} 'ocean'\n" - story_text: "Now that you've learned how to use functions, you'll learn how to use a function with an argument.\nAn **argument** is a variable that is used within a function. It is not used outside the function.\n\nFor example in this code we've programmed the first verse of the song 'My Bonnie is over the ocean'.\nIn this example code the argument `place` is used. Place is a variable that is only used in the function, so an argument.\nTo use `place` we have programmed the line `define song with place`.\nWhen the function is called, computer will replace the argument `place`, with the piece of text after `call song with`.\n\n### Exercise\nThe next verse of this song goes:\n\nLast night as I lay on my pillow\nLast night as I lay on my bed\nLast night as I lay on my pillow\nI dreamed that my Bonnie is dead\n\nCan you program this verse in the same way as the example?\n" - example_code: "```\n{define} song {with} place\n {print} 'My Bonnie is over the ' place\n\n{call} song {with} 'ocean'\n{call} song {with} 'sea'\n{call} song {with} 'ocean'\n```\n" - name: functions - description: functions - default_save_name: functions - songs: + story_text: | + Now that you've learned how to use functions, you'll learn how to use a function with an argument. + An **argument** is a variable that is used within a function. It is not used outside the function. + + For example in this code we've programmed the first verse of the song 'My Bonnie is over the ocean'. + In this example code the argument `place` is used. Place is a variable that is only used in the function, so an argument. + To use `place` we have programmed the line `define song with place`. + When the function is called, computer will replace the argument `place`, with the piece of text after `call song with`. + + ### Exercise + The next verse of this song goes: + + Last night as I lay on my pillow + Last night as I lay on my bed + Last night as I lay on my pillow + I dreamed that my Bonnie is dead + + Can you program this verse in the same way as the example? + example_code: | + ``` + {define} song {with} place + {print} 'My Bonnie is over the ' place + + {call} song {with} 'ocean' + {call} song {with} 'sea' + {call} song {with} 'ocean' + ``` + start_code: | + {define} song {with} place + {print} 'My Bonnie is over the ' place + + {call} song {with} 'ocean' + {call} song {with} 'sea' + {call} song {with} 'ocean' + 14: + story_text: | + In the previous levels you have learned to create functions and use arguments with them. Another great use of a function is to let it calculate something for you. + You can give the function a calculation and it will give you the answer of the calculation. This answer is called a **return value**. + + For example, in this code the function calculate_new_price will calculate the new price of any item. It will give you the new price as a return value. + + ### Exercise + Finish this code. We have already made the variable new_price for you, you only need to set it. + You should finish the line of code by calling the function that calculates the new price. + example_code: | + ``` + {define} calculate_new_price {with} amount, percentage + percentage = percentage / 100 + discount_amount = amount * percentage + return amount - discount_amount + + old_price = {ask} 'How much is on the price tag?' + discount = {ask} 'What percentage is the discount?' + + new_price = _ calculate_new_price {with} old_price, _ + {print} 'The new price is ' new_price ' dollar' + ``` + start_code: | + {define} calculate_new_price {with} amount, percentage + percentage = percentage / 100 + discount_amount = amount * percentage + return amount - discount_amount + + old_price = {ask} 'How much is on the price tag?' + discount = {ask} 'What percentage is the discount?' + + new_price = _ calculate_new_price {with} old_price, _ + {print} 'The new price is ' new_price ' dollar' + guess_my_number: + name: Guess my number + default_save_name: guess my number + description: guess my number levels: - 18: - example_code: "```\nlines = ['what shall we do with the drunken sailor', 'shave his belly with a rusty razor', 'put him in a long boat till hes sober']\n{for} line {in} lines _\n {for} i {in} {range} 1 {to} 3 _\n {print} _ line _\n {print} 'early in the morning'\n {for} i {in} {range} 1 {to} 3\n {print} 'way hay and up she rises'\n {print} 'early in the morning'\n```\n" - story_text: "In level 16 we made songs using lists. These programs however are no longer working properly in this level. The colons from level 17 and the brackets from level 18 still need to be added.\n\n### Exercise 1\nThe Drunken sailor song is given as sample code, but not yet working.\nCan you make sure everything works again? To help you, we've put _ in the places of _some_ errors.\n\n### Exercise 2\nNow also look up your Old MacDonald song from level 16, and correct it.\n" + 14: + story_text: | + In this level you can program the game 'Guess my number' + + ### Exercise + Fill in the correct symbols on the blanks to get the game to work. + example_code: | + ``` + {print} 'Guess my number' + numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + number = numbers {at} {random} + game = 'on' + {for} i {in} {range} 1 {to} 10 + {if} game == 'on' + guess = {ask} 'Which number do you think it is?' + {if} guess _ number + {print} 'Lower!' + {if} guess _ number + {print} 'Higher!' + {if} guess _ number + {print} 'You win!' + game = 'over' + ``` start_code: '# place your code here' - 6: - story_text_2: "This children's song counts down from 5 little monkeys to 1 monkey.\nIf you copy line 2 - 7 and paste it under the the code, you can sing the whole song!\n" - example_code_2: "```\nnumber = 6\nnumber = number - 1\n{print} number ' little monkeys jumping on the bed'\n{print} 'One fell off and bumped his head'\n{print} 'Mama called the doctor and the doctor said'\n{print} 'NO MORE MONKEYS JUMPING ON THE BED!'\n{sleep}\n```\n" - example_code: "```\nverse = 99\n{print} verse ' bottles of beer on the wall'\n{print} verse ' bottles of beer'\n{print} 'Take one down, pass it around'\nverse = verse - 1\n{print} verse ' bottles of beer on the wall'\n{sleep}\n```\n" - story_text: "Songs often contain a lot of repetition. Sometimes the repetition is also based on counting.\nFor example, in the well-known song 'Bottles of beer'. You can program that song with a little math.\n\nTip: Use the read aloud function to let Hedy sing the song to you!\n\n### Exercise\nYou can now repeat lines 2 to 7 as many times as you want by copying the lines.\n" - start_code: "{print} 'Lets sing!'" - 7: - start_code: "{print} 'Baby Shark'" - example_code: "```\n{repeat} _ _ {print} 'Baby Shark tututudutudu'\n{print} 'Baby Shark'\n```\n" - story_text: "Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing:\n\nBaby Shark tututudutudu
\nBaby Shark tututudutudu
\nBaby Shark tututudutudu
\nBaby Shark\n\n### Exercise\nYou can print the song Baby Shark with a `{repeat}`? Finish the code by replacing the blanks?\n**Extra** After Baby Shark you can of course also program other songs. There are many songs with repetition!\nCan you think of one more song and print it?\n" - 8: - example_code: "```\nverse = 99\n_ 99 {times}\n{print} verse ' bottles of beer on the wall'\n{print} verse ' bottles of beer'\n{print} 'Take one down, pass it around'\nverse = verse - 1\n{print} verse ' bottles of beer on the wall'\n```\n" - story_text: "In a previous level you've programmed the song 'Bottles of beer'. But without the `{repeat}` command, you had to copy the verses many times.\nIn this level you can repeat the song 99 times, just by adding one simple line!\n\n### Exercise\nAdd the right command on the blanks and indent the code correctly.\n" + harry_potter: + name: Harry Potter + default_save_name: Harry Potter + description: Harry Potter adventures + levels: + 10: + story_text: | + ### Exercise + We can also make a Harry Potter themed fortune teller. Fill in blanks such that 9 lines are printed. + **Extra** Change the theme of the fortune teller into something else, such as your favorite book, film or tv show. + example_code: | + ``` + houses = Gryffindor, Slytherin, Hufflepuff, Ravenclaw + subjects = potions, defence against the dark arts, charms, transfiguration + fears = Voldemort, spiders, failing your OWL test + names = Harry, Ron, Hermione + _ + _ {print} name ' is placed in ' houses {at} {random} + _ {print} name ' is great at ' subjects {at} {random} + _ {print} name 's greatest fear is ' fears {at} {random} + ``` start_code: '# place your code here' + haunted: + name: Haunted House + default_save_name: Haunted House + description: Escape from the haunted house + levels: + 1: + story_text: | + In this adventure you are working towards making a game in which you have to escape from a haunted house by picking the correct door. + If you pick the right door you'll survive, but if not a terrible monster might... + + In level 1 we start our haunted house game by making up a scary story and ask the player what monster they'll see in the haunted house. + example_code: | + ``` + {print} How did I get here? + {print} I remember my friend telling me to go into the old mansion... + {print} and suddenly everything went black. + {print} But how did I end up on the floor...? + {print} My head hurts like Ive been hit by a baseball bat! + {print} What's that sound? + {print} Oh no! I feel like Im not alone in this house! + {print} I need to get out of here! + {print} There are 3 doors in front of me.. + {ask} Which door should i pick? + {echo} I choose door + {print} ...? + ``` + story_text_2: | + ### Exercise + Copy the example code to your input screen by clicking the yellow button. + Now finish the story by adding at least 5 lines of code. + Remember to start each line of codes with a `{print}` command. + start_code: '{print} How did I get here?' + 2: + story_text: | + In this haunted house you can choose your monsters with emojis. Of course you could also use words. + example_code: | + ``` + 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! + ``` + story_text_2: | + ### 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? + example_code_2: | + ``` + 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! + ``` + start_code: monster1 {is} _ + 3: + story_text: | + In the previous levels you've made an introduction to your haunted house game, but as you might have noticed the story would always have a dreadful end. + In this level you can make your story more interactive by changing the outcome of the game; sometimes you'll get eaten, sometimes you'll escape! + Let Hedy decide randomly! + + ### Exercise + Copy the example codes and fill in the blanks to make it work! + + **Extra** This story is pretty straight forward, maybe you can spook it up a bit by adding a more exciting story. + Also you have very limited outcomes right now, there are only 3 options of what's behind the doors. Maybe you can think of more monsters to add to the list! + example_code: | + ``` + _ Escape from the haunted house! + _ There are 3 doors in front of you... + _ _ _ Which door do you choose? + _ You picked door ... choice + monsters _ a zombie, a vampire, NOTHING YOUVE ESCAPED + _ You see... + {sleep} + _ _ _ _ + ``` + start_code: '# place your code here' + 4: + story_text: | + 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. + example_code: | + ``` + _ 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} + ``` + start_code: '# place your code here' + 5: + story_text: | + Up until this level the haunted house game always asked the player to choose a door, but as you might have noticed, they didn't really have to answer correctly. + If the player filled in a completely random answer, the game would still work and the player might even win (despite not picking a door). + In this level you can only win the game by picking the same door Hedy picked randomly. + + ### Exercise + Can you find the 4 missing words to complete the code? + example_code: | + ``` + {print} 'Escape from the haunted house!' + {print} 'There are 3 doors in front of you...' + doors {is} 1, 2, 3 + monsters {is} werewolf, mummy, vampire, zombie + chosen_door {is} {ask} 'Which door do you choose?' + {print} 'You chose door...' chosen_door + {sleep} + correct_door {is} doors {at} {random} + _ _ _ _ {print} 'Great! Youve escaped!' + {else} {print} 'Oh no! You are being eaten by a...' monsters {at} {random} + ``` + start_code: '# place your code here' + 9: + story_text: "In this level you can use nesting, which allows you to make the haunted house even more interactive!\n\n### Exercise\nNow it's very hard to win this game, can you make it easier to win?\nChange your code so it only has one wrong door and two correct doors instead of one correct\ + \ door and two wrong ones? \nTip: This means changing the variable correct_door into wrong_door, and switching the `{if}` and `{else}` code.\nAnd of course you may also change the story and make it your own. Change the monsters or make it a happy game show where you get a gift!\n" + example_code: | + ``` + {print} 'Escape from the Haunted House!' + player = alive + doors = 1, 2, 3 + monsters = zombie, vampire, giant spider + {repeat} 3 {times} + {if} player {is} alive + correct_door {is} doors {at} {random} + {print} 'There are 3 doors in front of you...' + chosen_door = {ask} 'Which door do you choose?' + {if} chosen_door {is} correct_door + {print} 'No monsters here!' + {else} + {print} 'You are eaten by a ' monsters {at} {random} + player = dead + {else} + {print} 'GAME OVER' + {if} player {is} alive + {print} 'Great! You survived!' + ``` + start_code: '{print} ''Escape from the haunted house!''' 11: - example_code: "```\n_ monkeys _ _ 5 _ 1\n {print} monkeys ' little monkeys jumping on the bed'\n _\n```\n" - story_text: "In this level you can use the `{for}` with `{range}` to make songs that use counting, like the 5 little monkeys.\n\n### Exercise 1\nFill in the blanks and make the code work! If you don't remember the song text, look it up yourself.\n\n### Exercise 2\nThe final line of the song is different from the others. Print this line inside the `{for}`, and use an `{if}` to make it work correctly.\n" + story_text: "In this level we've changed the `{for}` command so we can tell the player where they are. \n\n### Exercise 1\nFinish the program so the player knows which room they are in.\n\n### Exercise 2\nMake the program into an adventure by following these steps:\n\n1. Make a list of\ + \ choices (like: fight or flight)\n2. Make sure the player can choose an option with `{ask}`\n3. Is answer correct? Then they may proceed to the next monster. Do they give a wrong answer? Let the player know with a `{print}`. \n\n**Extra** If you make a wrong choice, a monster is still\ + \ shown! How could you change that?\n" + example_code: | + ``` + {print} 'Escape from the Haunted House!' + monsters = zombie, vampire, giant spider + _ + {print} 'Room ' i + monster = monsters {at} {random} + ``` + start_code: '{print} ''Escape from the haunted house!''' + 14: + story_text: | + ### Exercise + In this level you can use the `<` and `>` symbol to introduce lives to your game. + Make sure the player loses a life when they come across the wrong monster and that the game stops if you have no lives left. + example_code: | + ``` + {print} 'Escape from the haunted house' + lives = 3 + doors = 1, 2, 3 + monsters = 'the wicked witch', 'a zombie', 'a sleeping 3 headed dog' + {for} i {in} {range} 1 {to} 10 + {if} lives _ + good_door = doors {at} {random} + monster = monsters {at} {random} + chosen_door = {ask} 'Which door do you choose?' + {if} good_door == chosen_door + {print} 'You have chosen the correct door' + {else} + {print} 'You see...' monster + {if} monster == 'a sleeping 3 headed dog' + {print} 'Pffieuw.... Its asleep' + {else} + {print} 'You lose one life' + lives = _ + {else} + {print} 'GAME OVER' + ``` start_code: '# place your code here' + 16: + story_text: | + ### Exercise + This haunted house game uses the connection between the lists you can use in this level. + For example: all the properties that belong to the zombie are first in all the lists, witch second and vampire third. + Check out the code and fill in `weapons[i]`, `monsters[i]` , `bad_fate[i]`, `good_fate[i]`, `hint[i]` on the correct blanks to get the code to work! + example_code: | + ``` + numbers = [1, 2, 3] + i = numbers[{random}] + hint = ['growling', 'a cackling laugh', 'fluttering batwings'] + monsters = ['zombie', 'witch', 'vampire'] + bad_fate = ['Your brain is eaten', 'You are forever cursed', 'You are bitten'] + good_fate = ['You throw the ham. The zombie is distracted and starts eating it.', 'You set the curtains on fire. The witch flees out of fear for the fire', 'The vampire hates garlic and flees'] + weapons = ['ham', 'lighter', 'garlic'] + {print} 'You are standing in front of an old mansion' + {print} 'Something is not right here' + {print} 'You hear ' _ + {print} 'You are going to explore it' + {print} 'You enter the kitchen and see a lighter, a raw ham and a garlic.' + your_weapon = {ask} 'What do you bring with you?' + {print} 'With your ' your_weapon ' you enter the living room' + {print} 'There you find a ' _ + needed_weapon = _ + {if} your_weapon == needed_weapon + {print} 'You use your ' your_weapon + {print} _ + {print} 'YOU WIN!' + {else} + {print} 'You have chosen the wrong weapon...' + {print} _ + {print} 'GAME OVER' + ``` + start_code: '# place your code here' + hotel: + name: hotel + default_save_name: hotel + description: hotel + levels: 13: - start_code: "{define} song {with} place\n {print} 'My Bonnie is ' place\n\nchosen_place = {ask} 'Where do you want Bonnie to be?'\nsynonym = {ask} 'What is another word for that?'\n\n{call} song {with} chosen_place\n{call} song {with} synonym\n{call} song {with} chosen_place\n" - story_text: "In the previous adventure you have learned how to use an argument in a function, but did you know that you could combine them with {ask} commands as well?\nIn this example we have changed the 'My Bonnie' program and made it interactive. You are now asked where Bonnie is.\n" - example_code: "```\n{define} song {with} place\n {print} 'My Bonnie is ' place\n\nchosen_place = {ask} 'Where do you want Bonnie to be?'\nsynonym = {ask} 'What is another word for that?'\n\n{call} song {with} chosen_place\n{call} song {with} synonym\n{call} song {with} chosen_place\n```\n" - 10: - example_code: "```\nfamily = baby, mammy, daddy, grandma, grandpa\n_ _ _ _ \n {print} _\n```\n" + story_text: | + In the previous adventure you have learned how to use an argument in a function, and you've learned how to combine it with an {ask}. + You might have wondered why you would use functions, because the functions in the example were only one line of code. + Now we will show you what a bigger function looks like and we will use multiple agruments now as well. You'll see how much better it is to use a function once the function gets bigger. + Here is an example of a function with arguments combined with {ask} commands. + example_code: | + ``` + {define} welcome_message {with} title, last_name, country, room_number + {print} 'Welcome to Hotel Hedy, ' title ' ' last_name + nice_trip {is} {ask} 'Did you have a nice trip from, ' country '?' + {if} nice_trip {is} 'yes' + {print} 'Lovely!' + {else} + {print} 'Sorry to hear that.' + {print} 'Hopefully you can take a nice rest in you room.' + {print} 'Your room number is ' room_number + + {print} 'Hello. Please fill in your information to check in.' + title = {ask} 'What is your title (mr, mrs, ms, dr, etc.)?' + name = {ask} 'What is you last name?' + homecountry = {ask} 'What country do you come from?' + + {call} welcome_message {with} title, name, homecountry, 105 + ``` + start_code: | + {define} welcome_message {with} title, last_name, country, room_number + {print} 'Welcome to Hotel Hedy, ' title ' ' last_name + nice_trip {is} {ask} 'Did you have a nice trip from, ' country '?' + {if} nice_trip {is} 'yes' + {print} 'Lovely!' + {else} + {print} 'Sorry to hear that.' + {print} 'Hopefully you can take a nice rest in you room.' + {print} 'Your room number is ' room_number + + {print} 'Hello. Please fill in your information to check in.' + title = {ask} 'What is your title (mr, mrs, ms, dr, etc.)?' + name = {ask} 'What is you last name?' + homecountry = {ask} 'What country do you come from?' + + {call} welcome_message {with} title, name, homecountry, 105 + if_command: + name: '{if} & {else}' + default_save_name: if_command + description: Introducing the if command + levels: + 5: + story_text: | + ## If... else.... + In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. + This code prints nice if you enter Hedy as a name, and boo! if you enter something else. + `{ask}` and `{print}` still work like they did in level 4. + example_code: | + ``` + name {is} {ask} 'what is your name?' + {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' + ``` + story_text_2: | + Sometimes code with an `{if}` gets really long and does not fit on the line well.
You may also divide the code over two lines, starting the second line at the `{else}` like this: + example_code_2: | + ``` + name {is} {ask} 'what is your name?' + {if} name {is} Hedy {print} 'nice' + {else} {print} 'boo!' + ``` + story_text_3: | + ### Exercise + Try to create your own code with `{if}` and `{else}`. You can use the example code if you want. + example_code_3: | + ``` + answer {is} {ask} '2 + 2 = ?' + _ _ _ 4 _ 'Great job!' + _ _ 'No 2 + 2 = 4' + ``` + start_code: |- + name {is} {ask} 'what is your name?' + {if} name {is} Hedy {print} 'nice' + {else} {print} 'boo!' + 8: + story_text: | + ## If... Else... + You have learned to repeat a block of lines of code after a `{repeat}` command. + Now you can also use indentation to make blocks after a {if} or {else} command. + Check out the example code. + + ### Exercise + Add an {else} command to the example code. Make a block of line using indentation. You do this by starting each line with 4 spaces. + example_code: | + ``` + name = {ask} 'What is your name?' + {if} name {is} Hedy + {print} 'Welcome Hedy' + {print} 'You can play on your computer!' + ``` + start_code: | + name = {ask} 'What is your name?' + {if} name {is} Hedy + {print} 'Welcome Hedy' + {print} 'You can play on your computer!' + 9: + story_text: | + In this level you can also put an {if} command inside another {if} command. + example_code: | + ``` + continue = {ask} 'Do you want to continue?' + {if} continue = yes + sure = {ask} 'Are you sure?' + {if} sure {is} yes + {print} 'We will continue' + {else} + {print} 'You are not sure' + {else} + {print} 'You do not want to continue' + ``` + start_code: | + continue = {ask} 'Do you want to continue?' + {if} continue = yes + sure = {ask} 'Are you sure?' + {if} sure {is} yes + {print} 'We will continue' + {else} + {print} 'You are not sure' + {else} + {print} 'You do not want to continue' + in_command: + name: '{in}' + default_save_name: in_command + description: Introducing the in command + levels: + 5: + story_text: | + ## Lists + When we want to check if something is in a list, we can now use the `{in}` command. + This code prints pretty! if you choose green or yellow, and meh otherwise. + example_code: | + ``` + pretty_colors {is} green, yellow + favorite_color {is} {ask} 'What is your favorite color?' + {if} favorite_color {in} pretty_colors {print} 'pretty!' + {else} {print} 'meh' + ``` + story_text_2: | + ### Exercise + Finish the example code by filling in the blanks with commands that you've learned. + When you've finished the code, try to create a code of your own and use a question that you've thought of yourself. + example_code_2: | + ``` + animals {is} dog, cow, sheep + answer {is} {ask} 'What is your favorite animal?' + _ answer _ animals _ 'Mine too!' + _ _ 'My favorite animals are dogs, cows and sheep' + ``` + start_code: |- + pretty_colors {is} green, yellow + favorite_color {is} {ask} 'What is your favorite color?' + {if} favorite_color {in} pretty_colors {print} 'pretty!' + {else} {print} 'meh' + is_command: + name: '{is}' + default_save_name: is_command + description: introducing is command + levels: + 2: + story_text: | + ## 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: + example_code: | + ``` + name {is} Hedy + age {is} 15 + {print} name is age years old + ``` + story_text_2: | + ### Exercise + Time to make your own variables! + In the example code we made an example of the variable `favorite_animals`. 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 in the blanks. 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. + example_code_2: | + ``` + favorite_animals {is} _ + {print} I like favorite_animals + ``` + start_code: |- + name {is} Hedy + age {is} 15 + {print} name is age years old + 6: + story_text: | + We also make a change in storing a word in a variable! You may now use `=` instead of `{is}` when we store a name or a number in a variable, like this: + example_code: | + ``` + name = Hedy + answer = 20 + 4 + ``` + start_code: | + name = Hedy + answer = 20 + 4 + 14: + story_text: | + We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. + The `<` checks if the first number is smaller than the second, for example age `<` 12 checks if age is smaller than 12. + If you want to check if the first number is smaller or equal to the second, you can use `<=`, for example age `<=` 11. + The `>` checks if the first number is bigger than the second, for example points `>` 10 checks if points is larger than 10. + If you want to check if the first number is bigger or equal to the second, you can use `>=`, for example points `>=` 11. + You use these comparisons in an `{if}`, like this: + example_code: | + ``` + age = {ask} 'How old are you?' + {if} age > 12 + {print} 'You are older than I am!' + ``` + story_text_2: | + From this level on, if you want to compare exactly, you can use two equal signs. This is what most programming languages do: + example_code_2: | + ``` + name = {ask} 'What is your name?' + {if} name == 'Hedy' + {print} 'You are cool!' + ``` + story_text_3: | + You can also compare if something is *not* equal to something else using `!=` like this: + example_code_3: | + ``` + name = {ask} 'What is your name?' + {if} name != 'Hedy' + {print} 'You are not Hedy' + ``` + start_code: |- + age = {ask} 'How old are you?' + {if} age < 13 + {print} 'You are younger than me!' + {else} + {print} 'You are older than me!' + language: + name: Language + default_save_name: Language + description: Practice words in a foreign language + levels: + 5: + story_text: | + Make your own program to practice your vocabulary in a new language. + + ### Exercise + Make the code longer by adding at least 3 more words for the player to learn. + **Extra** Of course, you can choose to use a different language than French. You can change to code to any language you'd like to learn. + example_code: | + ``` + {print} 'Learn French!' + cat {is} {ask} '🐱' + {if} cat {is} chat {print} 'Terrific!' + {else} {print} 'No, cat is chat' + frog {is} {ask} '🐸' + {if} frog {is} grenouille {print} 'Super!' + {else} {print} 'No, frog is grenouille' + ``` start_code: '# place your code here' - example_code_2: "```\nmonkeys = 5, 4, 3, 2, 1\n```\n" - story_text: "With `{for}` you can print make the whole baby shark song (including all the other sharks in the family) in only 6 lines!\n\n### Exercise 1\nCan you make the baby shark code even shorter by using a `{for}` command? Finish the example code.\n" - story_text_2: "### Exercise 2\nPrint the song Five little moneys jumping on the bed. Look up the text if you don't remember.\n\n**Extra** Print the song Old MacDonald had a farm, and make sure all animals make a different sound, using an `{if}`.\n" 16: + story_text: | + ### Exercise + Take a look at the example code. This is a program to practise French vocabulary. Now make your own program to practice your vocabulary in a new language. + If you don't know any other languages, you can use Google translate or you can use emojis and your native language. + example_code: | + ``` + french_words = ['bonjour', 'ordinateur', 'pomme de terre'] + translation = ['hello', 'computer', 'potato'] + score = 0 + {for} i {in} {range} 1 {to} 3 + answer = {ask} 'What does ' french_words[i] ' mean?' + correct = translation[i] + {if} answer == correct + {print} 'Correct!' + score = score + 1 + {else} + {print} 'Wrong, ' french_words[i] ' means ' translation[i] + {print} 'You gave ' score ' correct answers.' + ``` start_code: '# place your code here' - story_text: "In this level, you can program a song like OldMacDonald even more quickly. You can connect the right animal to the right sound by simply putting them in the same place in the list.\nThe Drunken Sailor is also quickly made in this level. You only need 8 lines for the entire song, check it out!\n\n### Exercise\nComplete the Old McDonald song by setting the variable `animal` to `animals[i]` and `sound` to `sounds[i]`.\n" - example_code: "```\nanimals = ['pig', 'dog', 'cow']\nsounds = ['oink', 'woof', 'moo']\n{for} i {in} {range} 1 {to} 3\n animal = _\n sound = _\n {print} 'Old McDonald had a farm'\n {print} 'E I E I O!'\n {print} 'and on that farm he had a ' animal\n {print} 'E I E I O!'\n {print} 'with a ' sound sound ' here'\n {print} 'and a ' sound sound ' there'\n {print} 'here a ' sound\n {print} 'there a ' sound\n {print} 'everywhere a ' sound sound\n```\n\n```\nlines = ['what shall we do with the drunken sailor', 'shave his belly with a rusty razor', 'put him in a long boat till hes sober']\n{for} line {in} lines\n {for} i {in} {range} 1 {to} 3\n {print} line\n {print} 'early in the morning'\n {for} i {in} {range} 1 {to} 3\n {print} 'way hay and up she rises'\n {print} 'early in the morning'\n```\n" + maths: + name: maths + default_save_name: maths + description: Introducing maths + levels: + 6: + story_text: | + ## 1 + 1 + In this level you learn something new: you can now also calculate. + + The plus is easy, you write it like with math: `5 + 5` for example. The minus also works fine, it is `5 - 5`. + + The times is a bit different, because there is no times symbol on your keyboard. Just search, there really isn't! + That is why we multiply with the asterisk above 8: `5 * 5`. Read that as "5 times 5" that helps you remember it best. + example_code: | + ``` + {print} '5 plus 5 is ' 5 + 5 + {print} '5 minus 5 is ' 5 - 5 + {print} '5 times 5 is ' 5 * 5 + {print} '5 devided by 5 is ' 5 / 5 + ``` + start_code: | + {print} '5 plus 5 is ' 5 + 5 + {print} '5 minus 5 is ' 5 - 5 + {print} '5 times 5 is ' 5 * 5 + {print} '5 devided by 5 is ' 5 / 5 12: - example_code: "```\n_ actions = 'clap your hands', 'stomp your feet', 'shout Hurray!'\n_ {for} action {in} actions\n_ {for} i {in} {range} 1 {to} 2\n_ {print} 'if youre happy and you know it'\n_ {print} action\n_ {print} 'if youre happy and you know it and you really want to show it'\n_ {print} 'if youre happy and you know it'\n_ {print} action\n```\n" - start_code: '# place your code here' - story_text: "In this song we can make it even easier to program 'if you're happy and you know it, clap your hands'. Because we can put all of the actions in a variable, check it out:\n\n### Exercise\nCan you add the right amount of indentation to each line to make the song play correctly?\nTip: Not all lines need indentation\n" - name: Sing a song! - default_save_name: Song - description: Print a song + story_text: |- + **Decimal numbers** + So far, Hedy did not allow for decimal numbers like 1.5, but now we do allow that. Note that computers use the `.` for decimal numbers. + example_code: | + ``` + {print} 'Two and a half plus two and a half is...' + {print} 2.5 + 2.5 + ``` + story_text_2: |- + **Maths with words** + In this level you can also do addition with words like this: + example_code_2: | + ``` + a = 'Hello ' + b = 'world!' + {print} a + b + ``` + start_code: |- + {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: + name: Parrot + default_save_name: Parrot + description: Create your own online pet parrot that will copy you! levels: 1: - start_code: "{print} Im Hedy the parrot\n{ask} What is your name?\n{echo}\n{echo}\n" - example_code: "```\n{print} Im Hedy the parrot\n{ask} whats your name?\n{echo}\n{echo}\n```\n" - story_text_2: "### Exercise\nCopy the example code to your input screen by clicking on the yellow button.\nMake the parrot ask a different question. Fill in the blanks in the example!\n**Extra** You can also let the parrot ask multiple questions. Type in some more lines of code beneath your own code.\n" - story_text: "Create your own online pet parrot that will copy you!\n" - example_code_2: "```\n{print} Im Hedy the parrot\n{ask} _\n{echo}\n{echo}\n" + story_text: | + Create your own online pet parrot that will copy you! + example_code: | + ``` + {print} Im Hedy the parrot + {ask} whats your name? + {echo} + {echo} + ``` + story_text_2: | + ### Exercise + Copy the example code to your input screen by clicking on the yellow button. + Make the parrot ask a different question. Fill in the blanks in the example! + **Extra** You can also let the parrot ask multiple questions. Type in some more lines of code beneath your own code. + example_code_2: | + ``` + {print} Im Hedy the parrot + {ask} _ + {echo} + {echo} + start_code: | + {print} Im Hedy the parrot + {ask} What is your name? + {echo} + {echo} 2: - story_text_2: "### Exercise\nFirstly, finish line 2 with an `{is}` and an `{ask}` command.\nThen fill in a `{sleep}` command on line 4 and 6 to let the parrot stay quiet for a little bit.\n\n**Extra** Can you make the parrot ask for more then only your name by adding more lines of code?\n" - story_text: "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.\nWe will also make the parrot more life-like by adding `{sleep}` commands after something is said.\n" + story_text: | + 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. + example_code: | + ``` + {print} Im Hedy the parrot + name _ _ what is your name? + {print} name + _ + {print} squawk + _ + {print} name + ``` + story_text_2: | + ### 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? start_code: '{print} Im Hedy the parrot!' - example_code: "```\n{print} Im Hedy the parrot\nname _ _ what is your name?\n{print} name\n_\n{print} squawk\n_\n{print} name\n```\n" 3: - story_text: "Teach your parrot a new word with `{add}`.\n### Exercise\nCan you add the `{add} {to}` command to get the code to work?\n" - example_code: "```\nwords {is} squawk, Hedy\n{print} Train your parrot!\nnew_word {is} {ask} Which word do you want to teach them?\n_ new_word _ words\n{print} 🧒 Say new_word, Hedy!\n{print} 🦜 words {at} {random}\n```\n" + story_text: | + Teach your parrot a new word with `{add}`. + ### Exercise + Can you add the `{add} {to}` command to get the code to work? + example_code: | + ``` + words {is} squawk, Hedy + {print} Train your parrot! + new_word {is} {ask} Which word do you want to teach them? + _ new_word _ words + {print} 🧒 Say new_word, Hedy! + {print} 🦜 words {at} {random} + ``` start_code: '# place your code here' 4: - story_text: "In this level we have to use quotation marks with the commands `{ask}` and `{print}`.\n### Exercise\nComplete the code by filling in quotation marks on the blanks.\n" + story_text: | + 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. + example_code: | + ``` + words {is} squawk, Hedy + {print} _ Train your parrot! _ + new_word {is} {ask} _ Which word do you want to teach them? _ + {add} new_word {to_list} words + {print} _ 🧒 Say _ new_word _, Hedy!_ + {print} _ 🦜 _ words {at} {random} + ``` start_code: '# Write your code here' - example_code: "```\nwords {is} squawk, Hedy\n{print} _ Train your parrot! _\nnew_word {is} {ask} _ Which word do you want to teach them? _\n{add} new_word {to_list} words\n{print} _ 🧒 Say _ new_word _, Hedy!_\n{print} _ 🦜 _ words {at} {random}\n```\n" 5: - story_text: "Reward your parrot if it says the correct word!\n\n### Exercise\nFinish the code by filling in the 4 missing commands.\n" - example_code: "```\nwords {is} squawk, Hedy\n{print} 'Train your parrot!'\nnew_word {is} {ask} 'Which word do you want to teach them?'\n{add} new_word {to_list} words\nsaid_word {is} words {at} {random}\n{print} '🧒 Say ' new_word ', Hedy!'\n{print} '🦜 ' said_word\n_ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪'\n_ _ '🧒 No, Hedy! Say ' new_word\n```\n" + story_text: | + Reward your parrot if it says the correct word! + + ### Exercise + Finish the code by filling in the 4 missing commands. + example_code: | + ``` + words {is} squawk, Hedy + {print} 'Train your parrot!' + new_word {is} {ask} 'Which word do you want to teach them?' + {add} new_word {to_list} words + said_word {is} words {at} {random} + {print} '🧒 Say ' new_word ', Hedy!' + {print} '🦜 ' said_word + _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' + _ _ '🧒 No, Hedy! Say ' new_word + ``` start_code: '# place your code here' - description: Create your own online pet parrot that will copy you! - name: Parrot - default_save_name: Parrot - rock: + piggybank: + name: Piggy Bank + default_save_name: Piggy Bank + description: Count your pocketmoney! levels: - 15: + 12: + story_text: | + In this adventure you learn how to make a digital piggy bank. + + ### Exercise + Finish the code to calculate how much money you have and how long you need to save up to buy what you want! + **Extra** Maybe you have already saved some money? Deduct that from the amount you will have to save up. + example_code: | + ``` + {print} 'The digital piggy bank' + wish = {ask} 'What would you like to buy?' + price = {ask} 'How much does that cost?' + saved = {ask} 'How much money have you saved already?' + allowance = {ask} 'How much pocket money do you get per week?' + to_save = price - saved + weeks = to_save / allowance + {print} 'You can buy a ' _ ' in ' _ ' weeks.' + ``` start_code: '# place your code here' - story_text: "### Exercise\nPlay until you beat the computer! But first, finish the example code...\n" - example_code: "```\nwon = 'no'\noptions = 'rock', 'paper', 'scissors'\n{while} won == 'no'\n your_choice = {ask} 'What do you choose?'\n computer_choice = options {at} {random}\n {print} 'you chose ' your_choice\n {print} 'the computer chose ' computer_choice\n {if} computer_choice == your_choice\n {print} 'Tie!'\n {if} computer_choice == 'rock' {and} your_choice == 'scissors'\n {print} 'You lose!'\n {if} computer_choice == 'rock' {and} your_choice == 'paper'\n {print} 'You win!'\n won = 'yes'\n_\n```\n" - 2: - story_text: "In this level you can practise using the variables, so that you can make the rock, paper, scissors game in the next level!\n### Exercise\nFinish the code by filling in the **variable** on the blanks.\nThis 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!\n" + 14: + story_text: | + ### Exercise + In this level you can let Hedy tell you if you have saved up enough money! + Finish this code by filling in the blanks! + example_code: | + ``` + _ calculate_budget {with} wish, money, allowance + to_save = wish - money + weeks = to_save / allowance + {if} wish _ money + {print} 'You need to save up some more!' + {print} 'Youll need ' weeks ' more weeks.' + {else} + {print} 'Great! You have enough' + {print} 'Lets go shopping!' + + money = {ask} 'How much money have you saved?' + wish = {ask} 'How much money do you need?' + allowance = {ask} 'How much pocket money do you get each week?' + + {call} _ + ``` start_code: '# place your code here' - example_code: "```\nchoice {is} rock\n{print} I choose _\n```" - 1: - example_code_2: "```\n{print} what do you choose?\n{ask} choose from _\n{echo} so your choice was:\n```\n" - story_text_2: "### Exercise\nInstead of using words, you could also use emojis: ✊✋✌\nCan you create a code using emojis?\n" - start_code: "{print} Welcome to your own rock scissors paper!\n{ask} What will you choose?\n" - example_code: "```\n{print} what do you choose?\n{ask} choose from rock, paper or scissors\n{echo} so your choice was:\n```\n" - story_text: "In level 1 you can start with a rock, paper, scissors game.\n\nWith `{ask}` you can make a choice, and with `{echo}` you can repeat that choice.\n" - 3: - example_code_2: "```\nchoices {is} rock, paper, scissors\nplayer_1 {is} {ask} Name of player 1:\n_\n```\n" - story_text: "You can use the `{at} {random}` command to let the computer pick rock, paper or scissors!\n\n### Exercise\nFinish the code by using the `{at} {random}` command.\n" - start_code: '{print} Welcome to your own rock scissors paper!' - story_text_2: "**Extra** Make a two player game. Firstly ask the two players to fill in their names. Then let the computer randomly pick their choices.\n" - example_code: "```\nchoices {is} rock, paper, scissors\n{print} choices _\n```\n" + pressit: + name: Key presses + default_save_name: Pressed + description: Try linking a keyboard key to a command! + levels: 5: - story_text: "In this level we can determine whether it's a tie or not. For that you need the new `{if}` code.\n\n### Exercise\nFinish the code by filling in the blanks:\n* Let the computer pick a random option\n* Ask the player what they want to choose\n* Fill in the correct variables in line 4 and 5\n* Finish line 6 so that Hedy can check whether it's a tie or not.\n" - start_code: "{print} 'Welcome to your own rock scissors paper!'" - example_code: "```\noptions {is} rock, paper, scissors\ncomputer_choice {is} _\nchoice {is} _\n{print} 'you chose ' _\n{print} 'computer chose ' _\n{if} _ {is} _ {print} 'tie!' {else} {print} 'no tie'\n```\n\nFill in the correct code on the blanks to see if it is a draw.\n" - 13: + story_text: | + In this level there is another new keyword: `{pressed}`! + With `{pressed}` you can use keys on your keyboard to control what lines are used. + + ### Exercise + Look at the example and add one more line of code that reacts to a key press. + example_code: | + ``` + {print} 'Do you want a good (g) or bad (b) ending?' + {if} g {is} {pressed} {print} 'They lived happily ever after ❤' + {else} {print} 'The prince was eaten by a hippopotamus 😭' + ``` + story_text_2: | + You can also link turtle commands to keys. + + ### Exercise + Copy the lines a few times so you can create a larger drawing. + example_code_2: | + ``` + {if} y {is} {pressed} {forward} 15 + {else} {turn} 90 + ``` start_code: '# place your code here' - story_text: "With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code.\n\n### Exercise\nFinish the code such that a winner is always decided on. Run your code a few times to verify there is always a winner printed.\n" - example_code: "```\noptions = 'rock', 'paper', 'scissors'\nyour_choice = {ask} 'What do you choose?'\ncomputer_choice = options {at} {random}\n{print} 'You choose ' your_choice\n{print} 'The computer chooses ' computer_choice\n{if} computer_choice {is} your_choice\n {print} 'Tie'\n{if} computer_choice {is} 'rock' {and} your_choice {is} 'paper'\n {print} 'You win!'\n{if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors'\n {print} 'The computer wins!'\n_\n```\n" - 9: - example_code: "```\nchoices = rock, paper, scissors\nyour_choice {is} {ask} 'What do you choose?'\n{print} 'You choose ' your_choice\ncomputer_choice {is} choices {at} {random}\n{print} 'The computer chooses ' computer_choice\n{if} computer_choice {is} your_choice\n {print} 'Tie'\n{if} computer_choice {is} rock\n {if} your_choice {is} paper\n {print} 'You win!'\n {if} your_choice {is} scissors\n {print} 'You lose!'\n# finish this code\n```\n" + 7: + story_text: | + Now that you have learned about `{repeat}`, we can press keys multiple times. + You can use it to make the turtle walk forward and turn. + + ### Exercise + The code you have seen in level 5 only checks the key once. Copy the example code and add a `{repeat}` to it, so that you can press the keys many times. + Use this code to draw something nice. + example_code: | + ``` + {if} x {is} {pressed} {forward} 15 {else} {turn} 90 + ``` start_code: '# place your code here' - story_text: "In this level you can program the whole rock, paper, scissors game by nesting the `{if}` commands. \n\n### Exercise\nCan you finish the code? The program must tell who has won for every combination.\n\n**Extra** Want to play more than one game? Expand the code so that you can play multiple rounds. You can even use an `{ask}` to ask the user how many rounds they want to play.\n" - 10: - story_text: "### Exercise\nIn the previous levels you have often made your own rock paper scissors game. Can you finish the code and use the `{for}` command properly to get the game to work?\n" + 9: + story_text: | + Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. + + ### Exercise + Finish the code. Each time a random letter should be chosen, which you have to press. You get a point for a correct press, and and two points deduction for a wrong press. + **Extra** Clear the screen after each letter, and show the user how many points they have scored. + example_code: | + ``` + points = 0 + letters = a, b, c, d, e + {repeat} 10 {times} + letter = _ _ _ + {print} 'Press the letter ' letter + {if} letter {is} {pressed} + _ + _ + _ + ``` start_code: '# place your code here' - example_code: "```\nchoices = _\nplayers = _\n{for} _\n```\n" - 4: - story_text: "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.\n### Exercise\nCopy your code from the previous level and make it work by using quotation marks after each `{print}` or `{ask}` command.\n" - start_code: "{print} 'Welcome to your own rock scissors paper!'" - name: Rock, paper, scissors - default_save_name: Rock_2 - description: Make your own rock, paper, scissors game - while_command: - name: '{while}' + print_command: + name: '{print}' + default_save_name: print + description: Introduction print command levels: - 15: - story_text: "We are going to learn a new loop, the `{while}` loop! We continue the loop as long as the statement is true.\nSo don't forget to change the value in the loop.\n\nIn the example code, we continue until a correct answer has been given.\nIf the correct answer is never given, the loop never ends!" - start_code: "answer = 0\n{while} answer != 25\n answer = {ask} 'What is 5 times 5?'\n{print} 'A correct answer has been given'" - example_code: "```\nanswer = 0\n{while} answer != 25\n answer = {ask} 'What is 5 times 5?'\n{print} 'A correct answer has been given'\n```\n" - description: while - default_save_name: while_command - elif_command: - description: elif + 1: + story_text: | + ## The print command + You can print text to the screen using the `{print}` command. + example_code: | + ``` + {print} Hi there, programmer! + {print} Welcome to Hedy! + ``` + story_text_2: | + ### Exercise + In Hedy you will find exercises in every adventure. An exercise allows you to practise the new commands and concepts, and lets you give your own twist to the example codes. + In this exercise you will see a pink blank space. You have to fill something in the place of the blank space before the code can be ran. + + Fill in the `{print}` command in the blank space and then add five more lines of code. Each line has to start with a `{print}` command. + Have fun! + example_code_2: | + ``` + _ Hello! + ``` + start_code: | + {print} Welcome to Hedy! + 18: + story_text: |- + We arrived at real Python code! That means we need to use parentheses with `{print}` and `{range}` from now on. + It also means you can use Hedy code from this level in any Python environment as long as you use the English commands. If you haven't until now, you can switch the toggle in the commands menu to do so. + example_code: | + ``` + {print}('Hello!') + {for} i {in} {range}(1, 10): + {print}('This is line ', i) + ``` + story_text_2: If you want to print more than one item, you need to separate them by commas. + example_code_2: | + ``` + temperature = 25 + {print}('It is ', temperature, ' degrees outside') + ``` + start_code: |- + name = 'Hedy' + {print}('My name is ', name) + quizmaster: + name: Quizmaster + default_save_name: Quizmaster + description: Make your own quiz! levels: - 17: - story_text: "In this level you can also use a new command: `{elif}`. `{elif}` is a combination of the keywords `{else}` and `{if}` and you need it when you want to make 3 (or more!) options.\nCheck it out!\n" - example_code: "```\nprices = ['1 million dollars', 'an apple pie', 'nothing']\nyour_price = prices[{random}]\n{print} 'You win ' your_price\n{if} your_price == '1 million dollars' :\n {print} 'Yeah! You are rich!'\n{elif} your_price == 'an apple pie' :\n {print} 'Lovely, an apple pie!'\n{else}:\n {print} 'Better luck next time..'\n```\n" - start_code: "prices = ['1 million dollars', 'an apple pie', 'nothing']\nyour_price = prices[{random}]\n{print} 'You win ' your_price\n{if} your_price == '1 million dollars' :\n {print} 'Yeah! You are rich!'\n{elif} your_price == 'an apple pie' :\n {print} 'Lovely, an apple pie!'\n{else}:\n {print} 'Better luck next time..'" - name: '{elif}' - default_save_name: elif - for_command: - default_save_name: for + 14: + story_text: | + ### Exercise + In this adventure you can make your own quiz! Fill in the blanks, add more questions and enjoy your own quiz! + You can make a quiz about anything you like: your hobby, your favorite animal, your favorite book or anything at all! + example_code: | + ``` + {print} 'Make your own quiz' + points_a = 0 + points_b = 0 + {print} 'Question' + {print} 'Answer option A' + {print} 'Answer option B' + answer = {ask} 'Which answer?' + {if} answer == 'A' + points_a = points_a + 1 + {if} answer == 'B' + points_b = points_b + 1 + {print} 'End of the quiz!' + {print} 'Lets see the results!' + {if} points_a > points_b + {print} 'You belong to the A club' + {if} points_b > points_a + {print} 'You belong to the B club' + ``` + start_code: '# place your code here' + quotation_marks: + name: '''quotation marks''' + default_save_name: quotation_marks + description: Introduction quotation marks levels: - 11: - start_code: "{for} counter {in} {range} 1 {to} 10\n {print} counter\n{print} 'Ready or not. Here I come!'" - example_code: "```\n{for} counter {in} {range} 1 {to} 10\n {print} counter\n{print} 'Ready or not. Here I come!'\n```\n" - story_text: "In this level, we add a new form of the `{for}`. In earlier levels, we used `{for}` with a list, but we can also use `{for}` with numbers.\nWe do that by adding a variable name, followed by `{in}` `{range}`. We then write the number to start at, `{to}` and the number to end at.\n\nTry the example to see what happens! In this level again, you will need to use indentations in lines below the `{for}` statements." - 10: - start_code: "animals = dog, cat, blobfish\n{for} animal {in} animals\n {print} 'I love ' animal" - example_code: "```\nanimals = dog, cat, blobfish\n{for} animal {in} animals\n {print} 'I love ' animal\n```\n" - story_text: "## For\nIn this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements.\n`{for}` creates a block, like `{repeat}` and `{if}` so all lines in the block need to start with 4 spaces." - 17: - start_code: "{for} i {in} {range} 1 {to} 10:\n {print} i\n{print} 'Ready or not, here I come!'" - story_text: "Now we are going to change indentation a little bit. Every time that we need an indentation, we need `:` at the line before the indentation.\n" - example_code: "```\n{for} i {in} {range} 1 {to} 10:\n {print} i\n{print} 'Ready or not, here I come!'\n```\n" - name: '{for}' - description: for command + 4: + story_text: | + ## '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! + example_code: | + ``` + {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 + ``` + story_text_2: | + ## 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 remove those apostrophes and change the spelling to I am or What is. + Check out the example code to see the wrong way of using apostrophes. + example_code_2: | + ``` + _ This is the wrong way of using apostrophes _ + {print} 'I'm babysitting my sister's kids' + {print} 'What's more fun than that?' + ``` + start_code: |- + {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 'from now on' + 12: + story_text: | + **All texts need to be in quotation marks** + For this level on you will also have to use quotation marks when storing a text with `=`: + example_code: | + ``` + name = 'Hedy the Robot' + {print} 'Hello ' name + ``` + story_text_2: | + **All items in lists need quotation marks too** + Lists are texts, so they need quotation marks too. Mind that each single item on the list has quotation marks. + This allows you to save two words as 1 item on the list, for example 'Iron Man'. + example_code_2: | + ``` + superheroes = 'Spiderman', 'Batman', 'Iron Man' + {print} superheroes {at} {random} + ``` + story_text_3: | + **All text after `{if}` comparisons need quotation marks too** + example_code_3: | + ``` + name = {ask} 'What is your name?' + {if} name = 'Hedy the Robot' + {print} 'Hi there!' + ``` + story_text_4: | + **Numbers don't need quotation marks** + For numbers, you do not use quotation marks in the `=`: + example_code_4: | + ``` + score = 25 + {print} 'You got ' score + ``` + start_code: |- + name = {ask} 'What is your name?' + {if} name = 'Hedy the Robot' + {print} 'Hi there!' random_command: - levels: - 3: - story_text_3: "### Exercise\nTry out the `{at} {random}` command by making your own gameshow (like the ones on tv) where you choose a door or suitcase and it contains a big price!\nCan you do it? We have already put the first lines into the example code.\n" - story_text: "## At random\nIn this level you can make a list using the `{is}` command. You can let the computer choose a random item from that list. You do that with `{at} {random}`.\n" - example_code: "```\nanimals {is} dogs, cats, kangaroos\n{print} animals {at} {random}\n```\n" - story_text_2: "You can use the `{at} {random}` command in a sentence as well.\n" - example_code_2: "```\nfood {is} sandwich, slice of pizza, salad, burrito\n{print} I am going to have a food {at} {random} for lunch.\n```\n" - example_code_3: "```\n{print} The big gameshow!\n{print} There are 3 suitcases in front of you...\nchosen {is} {ask} Which suitcase do you choose?\nprices {is} _\n_\n```\n" - start_code: "animals {is} dog, cat, kangaroo\n{print} animals {at} {random}\n" - 16: - story_text: "We are going to make lists the Python way, with square brackets around the lists! We also keep the quotation marks around each item like we have learned in previous levels.\nWe use square brackets to point out a place in a list. For example: `friends[1]` is the first name on the list of friends, as you can see in the first part of the example code.\nThe second part of the example code shows you that we can also match 2 lists using the variable i." - story_text_2: "Now that you've learned to use the brackets in lists, you can also start using the {at} {random} command in the Python way!\nYou simply type the name of your list with `[random]` behind it!" - example_code: "```\nfriends = ['Ahmed', 'Ben', 'Cayden']\n{print} friends[1] ' is the first friend on the list.'\n{print} friends[2] ' is the second friend on the list.'\n{print} friends[3] ' is the third friend on the list.'\n#now we will match 2 lists using the variable i\nlucky_numbers = [15, 18, 6]\n{for} i {in} {range} 1 {to} 3\n {print} friends[i] 's lucky number is ' lucky_numbers[i]\n```\n" - example_code_2: "```\nfruit = ['apple', 'banana', 'cherry']\n{print} fruit[random]\n```" - start_code: "friends = ['Ahmed', 'Ben', 'Cayden']\n{print} friends[1] ' is the first friend on the list.'\n{print} friends[2] ' is the second friend on the list.'\n{print} friends[3] ' is the third friend on the list.'\n#now we will match 2 lists using the variable i\nlucky_numbers = [15, 18, 6]\n{for} i {in} {range} 1 {to} 3\n {print} friends[i] 's lucky number is ' lucky_numbers[i]" name: '{random}' default_save_name: random_command description: introducing at random command - debugging: levels: - 11: - story_text: "### Exercise\nDebug this calender program. The output of this program is supposed to look like a list of dates.\nFor example:\n\n```\nHedy calender\nHere are all the days of November\nNovember 1\nNovember 2\nNovember 3\n```\nAnd so on.\n\nMind that you have to test your code extra carefully for the month February, because the amount of days in this month changes in leap years." - example_code: "**Warning! This code needs to be debugged!**\n```\nprint 'Hedy calender'\nmonths_with_31 days = January, March, May, July, September, October, December\nmonths_with_30_days = April, June, August, November\nmonth = ask 'Which month would you like to see?'\nif month in months_with_31_days\n days = 31\n if month in months_with30_days\n days = 30\nif month = February\n leap_years = 2020, 2024, 2028, 2036, 2040, 2044, 2028\n year = ask 'What year is it?'\nif year in leap_years\n days = 29\nelse\n days = 28\n\nprint 'Here are all the days of ' moth\nfor i in range 1 to days\n print month i\n```\n" - start_code: "print 'Hedy calender'\nmonths_with_31 days = January, March, May, July, September, October, December\nmonths_with_30_days = April, June, August, November\nmonth = ask 'Which month would you like to see?'\nif month in months_with_31_days\n days = 31\n if month in months_with30_days\n days = 30\nif month = February\n leap_years = 2020, 2024, 2028, 2036, 2040, 2044, 2028\n year = ask 'What year is it?'\nif year in leap_years\n days = 29\nelse\n days = 28\n\nprint 'Here are all the days of ' moth\nfor i in range 1 to days\n print month i\n" - 10: - start_code: "names = Muad Hasan Samira Noura\nactivities = fly a kite, go swimming, go hiking, catch tan in the sun\n{for} name {is} names\n{print} At the beach name loves to activity at random\n" - story_text: "### Exercise\nDebug this code. Good luck!" - example_code: "**Warning! This code needs to be debugged!**\n```\nnames = Muad Hasan Samira Noura\nactivities = fly a kite, go swimming, go hiking, catch tan in the sun\n{for} name {is} names\n{print} At the beach name loves to activity {at} {random}\n```\n" - 2: - example_code: "**Warning! This code needs to be debugged!**\n```\ndestination {ask} Where are you going on holidays?\n{print} The flight to dstination leaves at 3 pm.\n{ask} Did you check in your luggage yet?\n{echo}\n{print} Let me print your boarding pass for you.\n{sleep}\nHere you go! Have a nice trip!\n```\n" - start_code: "destination {ask} Where are you going on holidays?\n{print} The flight to dstination leaves at 3 pm.\n{ask} Did you check in your luggage yet?\n{echo}\n{print} Let me print your boarding pass for you.\n{sleep}\nHere you go! Have a nice trip!\n" - story_text: "Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code.\nThat means that in these debugging adventures, we will give you a code that does not work yet.\nYou will have to figure out what's wrong and correct the mistakes.\n\n### Exercise\nDebug this code. Good luck!" - 15: - example_code: "**Warning! This code needs to be debugged!**\n```\nnames = 'Tanya', 'Romy', 'Kayla', 'Aldrin', 'Ali'\nverbs='walking', 'skipping', 'cycling', 'driving', 'running'\nlocations = 'on a mountaintop', 'in the supermarket', 'to the swimming pool'\nhiding_spots = 'behind a tree', under a table', in a box'\nsounds = 'a trumpet', 'a car crash', 'thunder'\ncauses_of_noise = 'a television', 'a kid with firecrackers', 'a magic elephant', 'a dream'\n\nchosen_ name = names at random\nchosen_verb = verbs at random\nchosen_location = 'locations at random'\nchosen_sounds = noises at random\nchosen_spot = hiding_spots random\nchosen_causes = causes_of_noise at random\n\nprint chosen_name ' was ' chosen_verb ' ' chosen_location\nprint 'when they suddenly heard a sound like ' sounds at random\nprint chosen_name ' looked around, but they couldn't discover where the noise came from'\nprint chosen_name ' hid ' chosen_spot'\nprint 'They tried to look around, but couldn't see anything from there'\nhidden = 'yes'\nwhile hidden = 'yes'\n print chosen_name 'still didn't see anything'\nanswer = ask 'does ' chosen_name ' move from their hiding spot?'\n if answer = 'yes'\n hidden == 'no'\nprint 'chosen_name moved from' chosen_spot\nprint 'And then they saw it was just' chosen_cause\nprint chosen_name 'laughed and went on with their day'\nprint The End\n```\n" - start_code: "names = 'Tanya', 'Romy', 'Kayla', 'Aldrin', 'Ali'\nverbs='walking', 'skipping', 'cycling', 'driving', 'running'\nlocations = 'on a mountaintop', 'in the supermarket', 'to the swimming pool'\nhiding_spots = 'behind a tree', under a table', in a box'\nsounds = 'a trumpet', 'a car crash', 'thunder'\ncauses_of_noise = 'a television', 'a kid with firecrackers', 'a magic elephant', 'a dream'\n\nchosen_ name = names at random\nchosen_verb = verbs at random\nchosen_location = 'locations at random'\nchosen_sounds = noises at random\nchosen_spot = hiding_spots random\nchosen_causes = causes_of_noise at random\n\nprint chosen_name ' was ' chosen_verb ' ' chosen_location\nprint 'when they suddenly heard a sound like ' sounds at random\nprint chosen_name ' looked around, but they couldn't discover where the noise came from'\nprint chosen_name ' hid ' chosen_spot'\nprint 'They tried to look around, but couldn't see anything from there'\nhidden = 'yes'\nwhile hidden = 'yes'\n print chosen_name 'still didn't see anything'\nanswer = ask 'does ' chosen_name ' move from their hiding spot?'\n if answer = 'yes'\n hidden == 'no'\nprint 'chosen_name moved from' chosen_spot\nprint 'And then they saw it was just' chosen_cause\nprint chosen_name 'laughed and went on with their day'\nprint The End\n" - story_text: "### Exercise\nDebug this random children's story. Good luck!" - 4: - story_text: "### Exercise\nDebug this code. Good luck!" - example_code: "**Warning! This code needs to be debugged!**\n```\n{print} 'Welcome to the online library!\n{ask} What genre of books do you like?\n{print} You like genre\nauthor {is} {ask} 'Who's your favorite author?'\n{print} 'author is your favorite author'\n{print} Hmmm... i think you should try... books {at} {random}\n```\n" - start_code: "{print} 'Welcome to the online library!\n{ask} What genre of books do you like?\n{print} You like genre\nauthor {is} {ask} 'Who's your favorite author?'\n{print} 'author is your favorite author'\n{print} Hmmm... I think you should try... books {at} {random}\n" - 9: - start_code: "{print} 'Welcome to our sandwich shop'\namount 'How many sandwiches would you like to buy?'\n{repeat} amount {times}\n{ask} {is} {ask} 'What kind or bread would you like your sandwich to be?'\ntypes_of_bread {is} white, wheat, rye, garlic, gluten free\n{if} chosen_bread in types_of_bread\n{print} 'Lovely!'\n{else}\n'I'm sorry we don't sell that'\ntopping {is} {ask} 'What kind of topping would you like?'\nsauce {is} {ask} 'What kind of sauce would you like?'\n{print} One chosen_bread with topping and sauce.\nprice = amount * 6\n{print} 'That will be 'price dollar' please'\n" - story_text: "### Exercise\nDebug this code. Good luck!" - example_code: "**Warning! This code needs to be debugged!**\n```\n{print} 'Welcome to our sandwich shop'\namount 'How many sandwiches would you like to buy?'\n{repeat} amount {times}\n{ask} {is} {ask} 'What kind or bread would you like your sandwich to be?'\ntypes_of_bread {is} white, wheat, rye, garlic, gluten free\n{if} chosen_bread in types_of_bread\n{print} 'Lovely!'\n{else}\n'I'm sorry we don't sell that'\ntopping {is} {ask} 'What kind of topping would you like?'\nsauce {is} {ask} 'What kind of sauce would you like?'\n{print} One chosen_bread with topping and sauce.\nprice = amount * 6\n{print} 'That will be 'price dollar' please'\n```\n" - 17: - example_code: "**Warning! This code needs to be debugged!**\n```\ndefine food_order\n toppings = ask 'pepperoni, tuna, veggie or cheese?'\n size = ask 'big, medium or small?'\n number_of_pizza = ask 'How many these pizzas would you like?'\n\n print 'YOU ORDERED'\n print number_of_pizzas ' size ' topping ' pizza'\n\ndefine drinks_order\n drink = ask 'water, coke, icetea, lemonade or coffee?'\n number_of_drinks = ask 'How many of these drinks would you like?'\n\n print 'YOU ORDERED'\n print number_of_drinks ' ' drink\n\n'Welcome to Hedy pizza'\nmore_food = ask 'Would you like to order a pizza?'\nwhile more_food = 'yes'\n return food_order\n more_food = ask 'Would you like to order a pizza?'\nmore_drinks = ask 'Would you like to order some drinks?'\nwhile more_drinks == 'yes'\n call drink_order\n more_drinks == ask 'Would you like to order more drinks?'\n\n\nprint 'Thanks for ordering!'\n```\n" - start_code: "\n define food_order\n toppings = ask 'pepperoni, tuna, veggie or cheese?'\n size = ask 'big, medium or small?'\n number_of_pizza = ask 'How many these pizzas would you like?'\n\n print 'YOU ORDERED'\n print number_of_pizzas ' size ' topping ' pizza'\n\n define drinks_order\n drink = ask 'water, coke, icetea, lemonade or coffee?'\n number_of_drinks = ask 'How many of these drinks would you like?'\n\n print 'YOU ORDERED'\n print number_of_drinks ' ' drink\n\n 'Welcome to Hedy pizza'\n more_food = ask 'Would you like to order a pizza?'\n while more_food = 'yes'\n return food_order\n more_food = ask 'Would you like to order a pizza?'\n more_drinks = ask 'Would you like to order some drinks?'\n while more_drinks == 'yes'\n call drink_order\n more_drinks == ask 'Would you like to order more drinks?'\n\n\n print 'Thanks for ordering!'\n" - story_text: "### Exercise\nDebug this code. Good luck!" - 5: - story_text: "### Exercise\nDebug this code. Good luck!" - example_code: "**Warning! This code needs to be debugged!**\n```\n{print} Welcome to Swimming Pool Hedy!\nclass {is} {ask} 'Are you here to join a class today?'\n{if} class yes\n {print} 'Great! You are joining a class!'\n {print} {else} 'You will not be joining a class'\ndiscount {is} {ask} 'Do you have a discount code?'\n{if} discount {is} yes\ndiscount_answer {is} {ask} 'What is your discount code?'\ndiscount_codes = Senior4231, Student8786, NewMember6709\n{if} discount_answer {is} {in} discount_codes\n {print} 'That will be $3,50'\n {else} 'That code is not valid'\n{else} 'That will be $5,50'\n{print} 'Have a nice swim!'\n```\n" - start_code: "{print} Welcome to Swimming Pool Hedy!\nclass {is} {ask} 'Are you here to join a class today?'\n{if} class yes\n {print} 'Great! You are joining a class!'\n {print} {else} 'You will not be joining a class'\ndiscount {is} {ask} 'Do you have a discount code?'\n{if} discount {is} yes\ndiscount_answer {is} {ask} 'What is your discount code?'\ndiscount_codes = Senior4231, Student8786, NewMember6709\n{if} discount_answer {is} {in} discount_codes\n {print} 'That will be $3,50'\n {else} 'That code is not valid'\n{else} 'That will be $5,50'\n{print} 'Have a nice swim!'\n" + 3: + story_text: | + ## At random + In this level you can make a list using the `{is}` command. You can let the computer choose a random item from that list. You do that with `{at} {random}`. + example_code: | + ``` + animals {is} dogs, cats, kangaroos + {print} animals {at} {random} + ``` + story_text_2: | + You can use the `{at} {random}` command in a sentence as well. + example_code_2: | + ``` + food {is} sandwich, slice of pizza, salad, burrito + {print} I am going to have a food {at} {random} for lunch. + ``` + story_text_3: | + ### Exercise + Try out the `{at} {random}` command by making your own gameshow (like the ones on tv) where you choose a door or suitcase and it contains a big price! + Can you do it? We have already put the first lines into the example code. + example_code_3: | + ``` + {print} The big gameshow! + {print} There are 3 suitcases in front of you... + chosen {is} {ask} Which suitcase do you choose? + prices {is} _ + _ + ``` + start_code: | + animals {is} dog, cat, kangaroo + {print} animals {at} {random} + 16: + story_text: |- + We are going to make lists the Python way, with square brackets around the lists! We also keep the quotation marks around each item like we have learned in previous levels. + We use square brackets to point out a place in a list. For example: `friends[1]` is the first name on the list of friends, as you can see in the first part of the example code. + The second part of the example code shows you that we can also match 2 lists using the variable i. + example_code: | + ``` + friends = ['Ahmed', 'Ben', 'Cayden'] + {print} friends[1] ' is the first friend on the list.' + {print} friends[2] ' is the second friend on the list.' + {print} friends[3] ' is the third friend on the list.' + #now we will match 2 lists using the variable i + lucky_numbers = [15, 18, 6] + {for} i {in} {range} 1 {to} 3 + {print} friends[i] 's lucky number is ' lucky_numbers[i] + ``` + story_text_2: |- + Now that you've learned to use the brackets in lists, you can also start using the {at} {random} command in the Python way! + You simply type the name of your list with `[random]` behind it! + example_code_2: |- + ``` + fruit = ['apple', 'banana', 'cherry'] + {print} fruit[random] + ``` + start_code: |- + friends = ['Ahmed', 'Ben', 'Cayden'] + {print} friends[1] ' is the first friend on the list.' + {print} friends[2] ' is the second friend on the list.' + {print} friends[3] ' is the third friend on the list.' + #now we will match 2 lists using the variable i + lucky_numbers = [15, 18, 6] + {for} i {in} {range} 1 {to} 3 + {print} friends[i] 's lucky number is ' lucky_numbers[i] + repeat_command: + name: '{repeat}' + default_save_name: repeat_command + description: repeat command + levels: + 7: + story_text: | + ## Repeat! Repeat! Repeat! + Level 7 adds the `{repeat}` command. `{repeat}` can be used to execute one line of code multiple times. Like this: + + ### Exercise + Play around with the repeat command. Can you make the happy birthday song in only 3 lines of code instead of 4 now? + example_code: | + ``` + {repeat} 3 {times} {print} 'Hedy is fun!' + ``` + start_code: | + {print} 'happy birthday to you' + {print} 'happy birthday to you' + {print} 'happy birthday dear Hedy' + {print} 'happy birthday to you' 8: - example_code: "**Warning! This code needs to be debugged!**\n```\n{print} 'Welcome to Manicures and Pedicures by Hedy'\nbodypart = {ask} 'Are you getting your fingernails or toenails done today? Or both?'\n{if} bodyparts {is} both\n {print} That will be $25'\n price = 25\n {else}\n {print} That will be $18'\n price = 18\ncolor = {ask} What color would you like?\nsparkles = {ask} 'Would you like some sparkles with that?'\n{if} sparkles {is} yes\n {print} 'We charge $3 extra for that'\nprice = price + 3\n{else} {print} 'No sparkles' {print} 'So no extra charge'\n{sleep} 5\n{print} 'All done! That will be $' price ' please!'\n{print} 'Thank you! Byebye!'\n" - story_text: "### Exercise\nDebug this code. Good luck!" - start_code: "{print} 'Welcome to Manicures and Pedicures by Hedy'\nbodypart = {ask} 'Are you getting your fingernails or toenails done today? Or both?'\n{if} bodyparts {is} both\n {print} That will be $25'\n price = 25\n {else}\n {print} That will be $18'\n price = 18\ncolor = {ask} What color would you like?\nsparkles = {ask} 'Would you like some sparkles with that?'\n{if} sparkles {is} yes\n {print} 'We charge $3 extra for that'\nprice = price + 3\n{else} {print} 'No sparkles' {print} 'So no extra charge'\n{sleep} 5\n{print} 'All done! That will be $' price ' please!'\n{print} 'Thank you! Byebye!'\n" + story_text: | + ### Repeat commands and indentation + In this level you can repeat multiple lines of code with only 1 repeat command. + You do this by making a block of lines that you want to repeat. + The lines in this block will need **indentation** . + That means putting four spaces at the beginning of each line. You will also have to indent when you just want to create a block of one line. + example_code: | + ``` + {repeat} 5 {times} + {print} 'Hello everyone' + {print} 'This is all repeated 5 times' + ``` + start_code: |- + {repeat} 5 {times} + {print} 'Hello everyone' + {print} 'This will be printed 5 times' + 9: + story_text: | + In this level you can not only use multiple lines with `{if}` and `{repeat}`, but you can also put them together! + In the example you see an `{if}` command within a `{repeat}` command. It is also allowed the other way around, and an `{if}` is also allowed in an `{if}` and a `{repeat}` in a `{repeat}`. + Give it a try! + example_code: | + ``` + {repeat} 3 {times} + food = {ask} 'What do you want?' + {if} food {is} pizza + {print} 'nice!' + {else} + {print} 'pizza is better' + ``` + start_code: |- + {repeat} 3 {times} + food = {ask} 'What do you want?' + {if} food {is} pizza + {print} 'nice!' + {else} + {print} 'pizza is better' + repeat_command_2: + name: '{repeat} 2' + default_save_name: repeat_command_2 + description: repeat command 2 + levels: 7: - start_code: "Are you sleeping?\nBrother John!\nMorning bells are ringing!\nDing, dang, dong!\n" - example_code: "**Warning! This code needs to be debugged!**\n```\nAre you sleeping?\nBrother John!\nMorning bells are ringing!\nDing, dang, dong!\n```\n" - story_text: "### Exercise\nSurprise! This program looks more like an output than a code. And yet, we don't want you to just add `{print}` commands in front of each line.\nFix this program to turn it into the nursery rhyme 'Brother John (Frère Jacques)' by using the {repeat} command of course!" - 13: - start_code: "defin movie_recommendation with name\n action_movies == 'Die Hard', 'Fast and Furious', 'Inglorious Bastards'\n romance_movies = 'Love Actually', 'The Notebook', 'Titanic'\n comedy_movies = 'Mr Bean' 'Barbie''Deadpool'\n kids_movies = 'Minions', 'Paddington', 'Encanto'\n if name is 'Camila' or name is 'Manuel'\n recommended_movie = kids_movie at random\n if name is 'Pedro' or 'Gabriella'\n mood = ask 'What you in the mood for?'\n if mood is 'action'\n recommended_movie = comedy_movies at random\n if mood is 'romance'\n recommended_movie = romance_movies\n if mood is 'comedy'\n recommended_movie = comedy_movies at random\n\nprint 'I would recommend ' recommended_movie ' for ' name\n\nname = ask 'Who is watching?'\nrecommendation = ask 'Would you like a recommendation?'\nif recommendaion is 'yes'\nprint movie_recommendation with name\nelse\nprint 'No problem!'\n" - example_code: "**Warning! This code needs to be debugged!**\n```\ndefin movie_recommendation with name\n action_movies == 'Die Hard', 'Fast and Furious', 'Inglorious Bastards'\n romance_movies = 'Love Actually', 'The Notebook', 'Titanic'\n comedy_movies = 'Mr Bean' 'Barbie''Deadpool'\n kids_movies = 'Minions', 'Paddington', 'Encanto'\n if name is 'Camila' or name is 'Manuel'\n recommended_movie = kids_movie at random\n if name is 'Pedro' or 'Gabriella'\n mood = ask 'What you in the mood for?'\n if mood is 'action'\n recommended_movie = comedy_movies at random\n if mood is 'romance'\n recommended_movie = romance_movies\n if mood is 'comedy'\n recommended_movie = comedy_movies at random\n\nprint 'I would recommend ' recommended_movie ' for ' name\n\nname = ask 'Who is watching?'\nrecommendation = ask 'Would you like a recommendation?'\nif recommendaion is 'yes'\nprint movie_recommendation with name\nelse\nprint 'No problem!'\n```\n" - story_text: "### Exercise\nDebug this code. Good luck!" - 18: - start_code: "\n animals = ['pig', 'dog', 'cow']\n sounds = ['oink', 'woof', 'moo']\n for i in range 1 to 3\n animal = animals[i]\n sound = sounds[i]\n print 'Old McDonald had a farm'\n print 'E I E I O!'\n print 'and on that farm he had a ' animal\n print 'E I E I O!'\n print 'with a ' sound sound ' here'\n print 'and a ' sound sound ' there'\n print 'here a ' sound\n print 'there a ' sound\n print 'everywhere a ' sound sound\n" - story_text: "### Exercise\nDebug this Old MacDonald program from level 16. Good luck!" - example_code: "**Warning! This code needs to be debugged!**\n```\nanimals = ['pig', 'dog', 'cow']\nsounds = ['oink', 'woof', 'moo']\nfor i in range 1 to 3\n animal = animals[i]\n sound = sounds[i]\n print 'Old McDonald had a farm'\n print 'E I E I O!'\n print 'and on that farm he had a ' animal\n print 'E I E I O!'\n print 'with a ' sound sound ' here'\n print 'and a ' sound sound ' there'\n print 'here a ' sound\n print 'there a ' sound\n print 'everywhere a ' sound sound\n```\n" - 14: - example_code: "**Warning! This code needs to be debugged!**\n```\ndefine calculate_heartbeat\n print 'Press your fingertips gently against the side of your neck'\n print '(just under your jawline)'\n print 'Count the number of beats you feel for 15 seconds'\n beats == ask 'How many beats do you feel in 15 seconds?'\n heartbeat = beats*4\n print 'Your heartbeat is ' heartbeat\n if heartbeat >= 60 or heartbeat <= 100\n print 'Your heartbeat seems fine'\n else\n if heartbeat > 60\n print 'Your heartbeat seems to be too low'\n if heartbeat < 100\n print 'Your heartbeat seems to be too high'\n print 'You might want to contact a medical professional'\n\nmeasure_heartbeat = ask 'Would you like to measure your heartbeat?'\nif measure_heartbeat = 'yes'\n call measure_heartbeat\nelse\n 'no problem'\n```\n" - story_text: "### Exercise\nDebug this code. Good luck!" - start_code: "define calculate_heartbeat\n print 'Press your fingertips gently against the side of your neck'\n print '(just under your jawline)'\n print 'Count the number of beats you feel for 15 seconds'\n beats == ask 'How many beats do you feel in 15 seconds?'\n heartbeat = beats*4\n print 'Your heartbeat is ' heartbeat\n if heartbeat >= 60 or heartbeat <= 100\n print 'Your heartbeat seems fine'\n else\n if heartbeat > 60\n print 'Your heartbeat seems to be too low'\n if heartbeat < 100\n print 'Your heartbeat seems to be too high'\n print 'You might want to contact a medical professional'\n\nmeasure_heartbeat = ask 'Would you like to measure your heartbeat?'\nif measure_heartbeat = 'yes'\n call measure_heartbeat\nelse\n 'no problem'\n" - 12: - story_text: "### Exercise\nDebug this code. Good luck!" - example_code: "**Warning! This code needs to be debugged!**\n```\ndefine greet\ngreetings = 'Hello', 'Hi there', 'Goodevening'\n print greetings at random\n\ndefine take_order\n food = ask 'What would you like to eat?'\n print 'One food'\n drink = 'What would you like to drink?'\n print 'One ' drink\n more = ask 'Would you like anything else?'\n if more is 'no'\n print 'Alright'\n else\n print 'And ' more\nprint 'Thank you'\n\nprint 'Welcome to our restaurant'\npeople = ask 'How many people are in your party tonight?'\nfor i in range 0 to people\n call greet_costumer\n```\n" - start_code: "define greet\ngreetings = 'Hello', 'Hi there', 'Goodevening'\n print greetings at random\n\ndefine take_order\n food = ask 'What would you like to eat?'\n print 'One food'\n drink = 'What would you like to drink?'\n print 'One ' drink\n more = ask 'Would you like anything else?'\n if more is 'no'\n print 'Alright'\n else\n print 'And ' more\nprint 'Thank you'\n\nprint 'Welcome to our restaurant'\npeople = ask 'How many people are in your party tonight?'\nfor i in range 0 to people\n call greet_costumer\n" + story_text: | + ## Repeat with other commands and with variables + You have practiced the `{repeat}` command in combination with the `{print}` command now, but did you know you could also use other commands with `{repeat}` ? + In this example code you can see that `{repeat}` can also be used with an `{ask}`, `{if}` or `{else}` command. + example_code: | + ``` + {repeat} 2 {times} answer = {ask} 'Did you know you could ask a question multiple times?' + {if} answer {is} yes {repeat} 2 {times} {print} 'You knew that already!' + {else} {repeat} 3 {times} {print} 'You have learned something new!' + ``` + story_text_2: | + Another interesting thing you can do with the `{repeat}` command is using variables to set the amount of times something should be repeated. In the example code you can see that we first ask the person how old they are. + Then, in line 3, the question is repeated 'age' times. So we have used the variable 'age' with the `{repeat}` command. + example_code_2: | + ``` + {print} 'Yay! It is your birthday!' + age = {ask} 'How old are you now?' + {repeat} age {times} {print} 'Hip Hip Hurray!' + ``` + start_code: |- + {repeat} 2 {times} answer = {ask} 'Did you know you could ask a question multiple times?' + {if} answer {is} yes {repeat} 2 {times} {print} 'You knew that already!' + {else} {repeat} 3 {times} {print} 'You have learned something new!' + 8: + story_text: | + ### In the block or not? + In this level you have to think carefully which lines of code should be in the block and which shouldn't. + For example: If you want to sing the song *the muffin man*. You only want the line with 'the muffin man' to be repeated twice. + This means the last line shouldn't start with indentation as it doesn't belong to the block. + If you do start the last line with indentation the song will turn out wrong. + + ### Exercise + Each line in the example code starts with a blank. Remove the blanks and try to figure out which line need indentation and which don't to make the muffin man song. + example_code: | + ``` + _ {print} 'Do you know the muffin man?' + _ {repeat} 2 {times} + _ {print} 'The muffin man' + _ {print} 'Do you know the muffin man, who lives on Drury Lane?' + ``` + start_code: |- + {repeat} 3 {times} + {print} 'This line will be repeated...' + {print} 'This one too...' + {print} 'but this one will not!' + restaurant: + name: Restaurant + default_save_name: Restaurant + description: Create your own virtual restaurant + levels: 1: - story_text: "Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code.\nThat means that in these debugging adventures, we will show you code that does not work yet.\nYou will have to figure out what's wrong and correct the mistakes.\n\n### Exercise\nDebug this code. Good luck!" - start_code: "{print} I love programming\nDo you love programming too?\n{echo}\n{print} What are your hobbies?\n{echo} Your hobbies are\n" - example_code: "**Warning! This code needs to be debugged!**\n```\n{print} I love programming\nDo you love programming too?\n{echo}\n{print} What are your hobbies?\n{echo} Your hobbies are\n```\n" - 16: - story_text: "### Exercise\nDebug this code. Good luck!\nTip: Make sure that you only see your score once in the end." - start_code: "country = ['The Netherlands', 'Poland', 'Turkey', 'Zimbabwe', 'Thailand', 'Brasil', 'Peru', 'Australia', 'India', 'Romania' ]\ncapitals = 'Amsterdam', 'Warshaw' 'Istanbul', 'Harare', 'Bangkok', 'Brasilia', 'Lima', 'Canberra', 'New Delhi', 'Bucharest'\nscore = 0\nfor i in range 0 to 10\n answer = ask 'What's the capital of ' countries[i]\n correct = capital[i]\n if answer = correct\n print 'Correct!'\n score = score + 1\n else\n print 'Wrong,' capitals[i] 'in the capital of' countries[i]\n print 'You scored ' score ' out of 10'\n" - example_code: "**Warning! This code needs to be debugged!**\n```\ncountry = ['The Netherlands', 'Poland', 'Turkey', 'Zimbabwe', 'Thailand', 'Brasil', 'Peru', 'Australia', 'India', 'Romania' ]\ncapitals = 'Amsterdam', 'Warshaw' 'Istanbul', 'Harare', 'Bangkok', 'Brasilia', 'Lima', 'Canberra', 'New Delhi', 'Bucharest'\nscore = 0\nfor i in range 0 to 10\n answer = ask 'What's the capital of ' countries[i]\n correct = capital[i]\n if answer = correct\n print 'Correct!'\n score = score + 1\n else\n print 'Wrong,' capitals[i] 'in the capital of' countries[i]\n print 'You scored ' score ' out of 10'\n\n```\n" + story_text: | + In level 1 you can make your own virtual restaurant and take your guests' orders. + example_code: | + ``` + {print} Welcome to Hedy's restaurant 🍟 + _ What would you like to order? + {echo} So you would like to order + {print} Thank you for your order! + {print} It's on its way! + ``` + story_text_2: | + ### Exercise + Copy the example code into your input screen by clicking the yellow button. + Firstly, fill in the correct command on the blanks to make to code work properly. + Then add at least 4 more lines of code to the restaurant program. + Ask the costumer what they would like to drink and ask if they want to pay with cash or card. + Lastly, think of a nice way to say goodbye to your costumer. + start_code: '# place your code here' + 2: + story_text: | + 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! + example_code: | + ``` + {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! + ``` + story_text_2: | + ### 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.? + start_code: '# place your code here' 3: - start_code: "movie_choices {is} dracula, fast and furious, home alone, barbie\nchosen_movie {is} movies {at} {random}\n{print} Tonight we will watch chosen _movies\nlike {ask} Do you like that movie?\n{print} Tomorrow we will watch something else.\n{add} chosen_movie {to} movie_choices\n{print} Tomorrow we will watch tomorrows_movie\ntomorrows_movie {is} movie_choices {at} {random}\nI'll go get the popcorn! {print}\n" - example_code: "**Warning! This code needs to be debugged!**\n```\nmovie_choices {is} dracula, fast and furious, home alone, barbie\nchosen_movie {is} movies {at} {random}\n{print} Tonight we will watch chosen _movies\nlike {ask} Do you like that movie?\n{print} Tomorrow we will watch something else.\n{add} chosen_movie {to} movie_choices\n{print} Tomorrow we will watch tomorrows_movie\ntomorrows_movie {is} movie_choices {at} {random}\nI'll go get the popcorn! {print}\n```\n" - story_text: "Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code.\nThat means that in these debugging adventures, we will give you a code that does not work yet.\nYou will have to figure out what's wrong and correct the mistakes.\n\n### Exercise\nDebug this code. Good luck!" + story_text: | + Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! + Simply add lists of your favorite (or least favorite) meals and Hedy can randomly choose your dinner. + You can also have a bit of fun, by letting Hedy choose the price for your dinner as well! What will you get? + example_code: | + ``` + dishes {is} spaghetti, brussels sprouts, hamburgers + {print} You will have dishes {at} {random} tonight! + prices {is} 1 euro, 10 euros, 100 euros + {print} That will be prices {at} {random} please. + ``` + story_text_2: | + ### Exercise + Now make your own version of the random restaurant. + Make a list of starts, mains, desserts, drinks and prices yourself. + Then use `{print}` and `{at} {random}` commands to tell the costumer what will be on their menu tonight. + example_code_2: | + ``` + {print} Welcome to your own random restaurant! + starters {is} _ + mains {is} _ + desserts {is} _ + drinks {is} _ + prices {is} _ + _ + ``` + start_code: '# place your code here' + 4: + story_text: | + In this level you have to use quotation marks 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. + example_code: | + ``` + _ 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! + ``` + start_code: '# place your code here' + 5: + story_text: | + ### Exercise + The example code shows how you could program that you've run out of a menu item in your restaurant. + Copy your own restaurant code from the previous levels. Create a problem in your restaurant and code it, like the example code did. + For instance, you could also run out of a menu item, or you don't take credit cards, or the ice cream machine is broken. + + **Extra** Have you programmed the problem and programmed appropriate responses? Then try to add more `{if}` and `{else}` commands into your code. + Try to add an `{if}` after every `{ask}` command in your code to make the code as interactive as possible! + example_code: | + ``` + drinks_in_stock {is} water, lemonade, cola, orange juice + drink {is} {ask} 'What would you like to drink?' + {if} drink {in} drinks_in_stock {print} 'One ' drink 'coming up!' + {else} {print} 'Sorry, we do not sell that' + ``` + start_code: '# place your code here' 6: - start_code: "{print} 'Vending machine'\nchosen_product = {ask} 'Please select a product'\n1_dollar_products = coke orange juice water\n2_dollar_products = chocolate, cookie, museli bar\n3dollar_prodcuts = potato chips, beef jerky, banana bread\n{if} chosen {is} {in} 1_dollar_products\nprice = 1\n{if} chosen_product {is} 2_dollar_products\nprice = 2\n{else} chosen_product {in} 3_dollar_products\nprice = 3\namount_of_products = '{ask} How many of ' chosen_product would you like to have?'\ntotal = price + amount_of_product\n{print} 'That will be $' price 'please'\n" - example_code: "**Warning! This code needs to be debugged!**\n```\n{print} 'Vending machine'\nchosen_product = {ask} 'Please select a product'\n1_dollar_products = coke orange juice water\n2_dollar_products = chocolate, cookie, museli bar\n3dollar_prodcuts = potato chips, beef jerky, banana bread\n{if} chosen {is} {in} 1_dollar_products\nprice = 1\n{if} chosen_product {is} 2_dollar_products\nprice = 2\n{else} chosen_product {in} 3_dollar_products\nprice = 3\namount_of_products = '{ask} How many of ' chosen_product would you like to have?'\ntotal = price + amount_of_product\n{print} 'That will be $' price 'please'\n```\n" - story_text: "### Exercise\nDebug this code. Good luck!" - default_save_name: debugging - description: debugging adventure - name: debugging - calculator: - levels: - 14: - example_code: "```\n{define} calculate_mean_grade\n total = 0\n {for} i {in} {range} 1 {to} 4\n grade = {ask} _\n total = total + _\n return _ / 4\n\nmean_grade = {call} _\n{print} 'Your mean grade is ' mean_grade\n```\n" - start_code: "{define} calculate_mean_grade\n total = 0\n {for} i {in} {range} 1 {to} 4\n grade = {ask} _\n total = total + _\n return _ / 4\n\nmean_grade = {call} _\n{print} 'Your mean grade is ' mean_grade\n" - story_text: "In this adventure you will build a calculator that calculates your mean grade for you. If you get your calculator to work, you can move on to the next adventure, which allows you to add two extra features.\n\n### Exercise 1\nFill in the blanks to get the calculator to work.\n* Start with the fourth line, add a question to figure out what grade the student got.\n* In the fifth line you'll want to calculate the total of all grades, so the total = total + grade.\n* Then we get to set the return value. We want to return the mean, so the total devided by the amount of tests (4).\n* Lastly we finish the code by calling the function in line 8.\n\nDid you get it? Awesome! Would you like to add even more to your calculator? **This adventure continues in the next tab!**\n" + story_text: | + In this level you can use maths to calculate the total price of your customer's order, which can make your virtual restaurant more realistic. + But you can also add many more things to your virtual restaurant, for example more courses. + + ### Exercise + You can add many more things to your virtual restaurant. For example, can you... + - ask how many people are coming and multiply the price by that amount? + - add another course? + - give people a discount when they enter a (secret) couponcode? + - add a children's menu? + - think of other fun things to add? + example_code: | + You can make a simple restaurant code, like this: + ``` + {print} 'Welcome to Restaurant Chez Hedy' + {print} 'Here is our menu:' + {print} 'Our main courses are pizza, lasagne, or spaghetti' + main = {ask} 'Which main course would you like?' + price = 0 + {if} main {is} pizza price = 10 + {if} main {is} lasagne price = 12 + {if} main {is} spaghetti price = 8 + {print} 'You have ordered ' main + {print} 'That will be ' price ' dollars, please' + {print} 'Thank you, enjoy your meal!' + ``` + start_code: '# place your code here' + 7: + story_text: | + In this level you've learned how to use the `{repeat}` command to repeat a line of code a certain amount of times. + You can use that in your restaurant to `{ask}` multiple people what they'd like to eat. + + ### Exercise + Can you complete the code? Hedy needs to repeat this question as many times as there are people. So if there are 5 people, the question needs to be asked 5 times. + **Extra** Expand your code with more questions, for example about drinks or sauce. + example_code: | + ``` + {print} 'Welcome to Restaurant Chez Hedy' + people = {ask} 'How many people are joining us today?' + ``` + start_code: '# place your code here' + 8: + story_text: | + In this level you can make your virtual restaurant more elaborate by repeating multiple lines of code. Like this: + example_code: | + ``` + {print} 'Welcome to Restaurant Chez Hedy!' + people = {ask} 'How many people will be joining us today?' + {print} 'Great!' + {repeat} people {times} + food = {ask} 'What would you like to order?' + {print} food + {print} 'Thank you for ordering!' + {print} 'Enjoy your meal!' + ``` + story_text_2: | + ### Exercise + This code can be expanded with more items on the menu, for example offering drinks, and/or multiple courses or desserts. Add at least one more item. + **Extra** Add even more items, as many options as you like! + start_code: '# place your code here' 9: - story_text: "In level 6 you created a calculator, in this level you can expand that code so it asks multiple questions.\n\n### Exercise 1\nCan you finish line 10 to make to program work?\n\n### Exercise 2\nGive the player feedback when the enter a right or wrong answer. To achieve that, expand your program with an `{else}`.\n" - start_code: "{print} 'Welcome to this calculator!'" - example_code: "```\nscore = 0\n{repeat} 10 {times}\n numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n number1 = numbers {at} {random}\n number2 = numbers {at} {random}\n correct_answer = number1 * number2\n {print} 'What is ' number1 ' times ' number2 '?'\n answer = {ask} 'Type your answer here...'\n {print} 'Your answer is' answer\n {if} _ {is} _\n score = score + 1\n{print} 'Great job! Your score is... ' score ' out of 10!'\n```\n" + story_text: "In this level you can use nesting to make your restaurant more realistic and more fun!\n\n### Exercise\nThe indentation was removed in the example code. \nCan you figure out how much indentation each line needs in order for the code to work properly?\nIf the customer orders\ + \ pizza, Hedy shouldn't ask what sauce the costumer wants.\n\n**Extra** A restaurant does not stock all sauces. Make a list of available sauces and give a reply with each order whether you sell it.
\n**Extra** Pizzas have toppings. Ask customers what they want.
\n**Extra** Do\ + \ customers want a drink? Ask them too!
\n" + example_code: | + ``` + {print} 'Welcome to Restaurant Chez Hedy!' + people = {ask} 'How many people will be joining us today?' + {print} 'Great!' + price = 0 + {repeat} people {times} + _ food = {ask} 'What would you like to order?' + _ {print} food + _ {if} food {is} fries + _ price = price + 3 + _ sauce = {ask} 'What kind of sauce would you like with your fries?' + _ {if} sauce {is} no + _ {print} 'no sauce' + _ {else} + _ price = price + 1 + _ {print} 'with ' sauce + _ {if} food {is} pizza + _ price = price + 4 + {print} 'That will be ' price ' dollar' + {print} 'Enjoy your meal!' + ``` + start_code: '# place your code here' 10: - example_code: "```\nnumbers = 1, 2, 3\n{for} number1 {in} numbers\n {for} number2 {in} numbers\n answer = {ask} 'How much is ' number2 ' times ' number1 '?'\n correct = number1 * number2\n {if} answer {is} correct\n {print} 'Great job!'\n {else}\n {print} 'That is wrong. The right answer is ' correct\n```\n" - story_text: "This calculator game helps you practise your tables of multiplication!\n### Exercise\nCan you add more numbers to the list, so you can practise the multiplication tables until 10?\n" + story_text: | + In this level you'll learn how to easily ask orders for different courses. + + ### Exercise 1 + Finish the code with an `{ask}` on the blanks such that the customer is asked what they want to eat for each course. + example_code: "```\ncourses = appetizer, main course, dessert\n{for} course {in} courses\n {print} 'What is your order for ' course '?'\n _ \n _\n```\n" + story_text_2: | + ### Exercise + Of course, you could also order for multiple people! + Can you add the correct amount of indentation before each line to make the code work properly? + Tip: some lines don't need any indentation at all. + example_code_2: | + ``` + _ courses = appetizer, main course, dessert + _ names = Timon, Onno + _ {for} name {in} names + _ {for} course {in} courses + _ food = {ask} name ', what would you like to eat as your ' course '?' + _ {print} name ' orders ' food ' as their ' course + ``` + start_code: courses = appetizer, main course, dessert + 11: + story_text: | + We can use the `{for}` with `{range}` to print the orders from multiple customers in an orderly manner. + + ### Exercise + Finish the restaurant code, so that you can ask for the order of multiple people. Print the order number each time: 'Order 1', 'Order 2', etc. + Are you not sure how to go about this? Have a peek at your level 8 code. + + **Extra** In level 9 the restaurant also used prices. You can add that here too! + example_code: | + ``` + {print} 'Welcome to Restaurant Hedy!' + people = {ask} 'For how many people would you like to order?' + {print} 'So you want to order for ' people ' people.' + {print} "Let's go!" + ``` start_code: '# place your code here' - 6: - start_code: "number_1 = {ask} 'Fill in the first number:'\nnumber_2 = {ask} 'Fill in the second number:'\ncorrect_answer = number_1 * number_2\n{print} number_1 ' times ' number_2 ' is ' correct_answer\n" - example_code_3: "```\nnumbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\nnumber_1 = _\nnumber_2 = _\ncorrect_answer = number_1 * number_2\ngiven_answer = {ask} 'What is ' number_1 ' times ' number_2 '?'\n{if} _\n{else} _\n```" - story_text_2: "### Exercise\nThe calculator above will calculate the answer for you, but you can also make a program to test your own maths skills, like this:\nFill in the blanks to make it complete!\n" - story_text: "Now that you can do maths, you can make a calculator yourself!\n" - example_code: "```\nnumber_1 = {ask} 'Fill in the first number:'\nnumber_2 = {ask} 'Fill in the second number:'\ncorrect_answer = number_1 * number_2\n{print} number_1 ' times ' number_2 ' is ' correct_answer\n```\n" - example_code_2: "```\ncorrect_answer = 11 * 27\nanswer = {ask} 'How much is 11 times 27?'\n{if} answer {is} _ {print} 'good job!'\n{else} {print} 'Wrong! It was ' _\n```\n" - story_text_3: "**Extra** You can also let the computer do random products on its own using `{random}`.\n" - 13: - story_text: "### Exercise 1\nLet's make the practice program a bit harder. The player now has to answers two questions correctly. Fill out the blanks to complete the program.\n\n### Exercise 2 Extra\nSometimes, calculations have multiple correct answers. For example, 10 can be divided by 5 and by 2. So the question 'What number divides 10?' can be answered by 2 and by 5.\nAsk for a calculation that has multiple correct answers, ask the player to answer it, and determine if it is correct using `{or}`.\nEmpty the programming field and create your own solution.\n" - start_code: '# Write your code here' - example_code: "```\nanswer1 = {ask} 'What is 10 times 7?'\nanswer2 = {ask} 'What is 6 times 7?'\n{if} _ _ _ _ _ _ _\n {print} _\n```\n" 12: - story_text: "In this level, you can make a calculator that works for decimal numbers.\n\n### Exercise 1\nFill out the blanks to complete the calculator. Remember to use a period and not a comma for decimal numbers.\n\n### Exercise 2\nCreate a new mathematics practice program, but now use decimal numbers.\nCreate a list of numbers, choose two to multiple and let the player answer.\nAnd of course you have to validate the answer! **Extra** Increase the difficulty by adding lives: A player loses a life for a wrong answer and after three wrong answers the game ends.\n" + story_text: | + From this level on you can use decimal numbers to make you menu more realistic. + + ### Exercise + Can you think of a code to give your friends and family a 15% discount? + example_code: | + ``` + price = 0.0 + food = {ask} 'What would you like to order?' + drink = {ask} 'What would you like to drink?' + {if} food {is} 'hamburger' + price = price + 6.50 + {if} food {is} 'pizza' + price = price + 5.75 + {if} drink {is} 'water' + price = price + 1.20 + {if} drink {is} 'soda' + price = price + 2.35 + {print} 'That will be ' price ' dollar, please' + ``` + start_code: '# place your code here' + 13: + story_text: | + In this level you will learn new commands to extend your code even further. + + ### Exercise 1 + Place a `{and}` and a `{or}` in the logical place in the program. + + ### Exercise 2 + Expand your restaurant with at least one more `{and}` and one `{or}`. + For example, create a special discount coupon that only applies to pizza, or give your customer a free drink + with fries and pancakes. Or something completely different of course! + example_code: | + ``` + price = 10 + food = {ask} 'What would you like to eat?' + drinks = {ask} 'What would you like to drink?' + {if} food {is} 'sandwich' _ drinks {is} 'juice' + {print} 'That is our discount menu' + price = price - 3 + {if} drinks {is} 'water' _ drinks {is} 'juice' + {print} 'That is a healthy choice' + {print} 'That will be ' price ' dollars' + ``` start_code: '# place your code here' - example_code: "```\nnumber1 = {ask} 'What is the first number?'\nnumber2 = {ask} 'What is the second number?'\nanswer = _\n{print} number1 ' plus ' number2 ' is ' _\n```\n" 15: + story_text: | + With the `{while}` you can make sure your costumers can keep adding orders until they are done. + + ### Exercise + Correctly add the `{while}` command to this code. + example_code: | + ``` + {print} 'Welcome at McHedy' + more = 'yes' + _ + order = {ask} 'What would you like to order?' + {print} order + more = {ask} 'Would you like to order anything else?' + {print} 'Thank you!' + ``` start_code: '# place your code here' - example_code: "```\n{define} new_question\n numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n number_1 = numbers {at} {random}\n number_2 = numbers {at} {random}\n correct = number_1 * number_2\n answer = 0\n _\n _\n _\n {print} 'Well done!'\n\n{print} 'Give 10 correct answers to win!'\n{for} i {in} {range} 1 {to} 10\n _\n{print} 'You win!'\n```\n" - story_text: "You can add the `{while}` loop to the calculator game you've learned to make in a previous level.\nThis makes sure the player can't continue to the next question if they answer incorrectly.\n\n### Exercise\nAdd the `{while}` loop in the function, ask the player what number_1 times number_2 is and print their answer.\nThen `{call}` the function.\n" - 11: - start_code: "number = 10\n{for} i {in} {range} 1 {to} 10\n {print} i * number\n" - story_text: "With a `{for}` you can simplify tables of multiplication practise program.\n\n### Exercise 1\nImprove the example code such that it prints a nice multiplication table:
\"1 times 10 is 10\", \"2 times 10 is 20\", etc.\n\n### Exercise 2\nGo back to your level 10 multiplication code, and modify it so that it uses a `{for}` and `{range}`.\n" - example_code: "```\nnumber = 10\n{for} i {in} {range} 1 {to} 10\n {print} i * number\n```\n" - name: Calculator - default_save_name: Calculator - description: Create a calculator - clear_command: - default_save_name: clear_command - description: clear command + rock: + name: Rock, paper, scissors + default_save_name: Rock_2 + description: Make your own rock, paper, scissors game levels: + 1: + story_text: | + In level 1 you can start with a rock, paper, scissors game. + + With `{ask}` you can make a choice, and with `{echo}` you can repeat that choice. + example_code: | + ``` + {print} what do you choose? + {ask} choose from rock, paper or scissors + {echo} so your choice was: + ``` + story_text_2: | + ### Exercise + Instead of using words, you could also use emojis: ✊✋✌ + Can you create a code using emojis? + example_code_2: | + ``` + {print} what do you choose? + {ask} choose from _ + {echo} so your choice was: + ``` + start_code: | + {print} Welcome to your own rock scissors paper! + {ask} What will you choose? + 2: + story_text: | + 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 blanks. + 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! + example_code: |- + ``` + choice {is} rock + {print} I choose _ + ``` + start_code: '# place your code here' + 3: + story_text: | + You can use the `{at} {random}` command to let the computer pick rock, paper or scissors! + + ### Exercise + Finish the code by using the `{at} {random}` command. + example_code: | + ``` + choices {is} rock, paper, scissors + {print} choices _ + ``` + story_text_2: | + **Extra** Make a two player game. Firstly ask the two players to fill in their names. Then let the computer randomly pick their choices. + example_code_2: | + ``` + choices {is} rock, paper, scissors + player_1 {is} {ask} Name of player 1: + _ + ``` + start_code: '{print} Welcome to your own rock scissors paper!' 4: - start_code: "{print} '3'\n{sleep}\n{clear}\n{print} '2'\n{sleep}\n{clear}\n{print} '1'\n{sleep}\n{clear}\n{print} 'SURPRISE!'\n" - example_code: "```\n{print} '3'\n{sleep}\n{clear}\n{print} '2'\n{sleep}\n{clear}\n{print} '1'\n{sleep}\n{clear}\n{print} 'SURPRISE!'\n```\n" - story_text: "Time for a new command! With `{clear}` you can clear all the text form your output screen. This way you can prevent your screen getting too full of text.\nBeware! If you are using a `{clear}` command, remember to use a `{sleep}` above it. Otherwise Hedy will clear your screen without giving you the time to read!\n" - name: '{clear}' - harry_potter: - levels: + story_text: | + 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 + Copy your code from the previous level and make it work by using quotation marks after each `{print}` or `{ask}` command. + start_code: '{print} ''Welcome to your own rock scissors paper!''' + 5: + story_text: | + In this level we can determine whether it's a tie or not. For that you need the new `{if}` code. + + ### Exercise + Finish the code by filling in the blanks: + * Let the computer pick a random option + * Ask the player what they want to choose + * Fill in the correct variables in line 4 and 5 + * Finish line 6 so that Hedy can check whether it's a tie or not. + example_code: | + ``` + options {is} rock, paper, scissors + computer_choice {is} _ + choice {is} _ + {print} 'you chose ' _ + {print} 'computer chose ' _ + {if} _ {is} _ {print} 'tie!' {else} {print} 'no tie' + ``` + + Fill in the correct code on the blanks to see if it is a draw. + start_code: '{print} ''Welcome to your own rock scissors paper!''' + 9: + story_text: "In this level you can program the whole rock, paper, scissors game by nesting the `{if}` commands. \n\n### Exercise\nCan you finish the code? The program must tell who has won for every combination.\n\n**Extra** Want to play more than one game? Expand the code so that you\ + \ can play multiple rounds. You can even use an `{ask}` to ask the user how many rounds they want to play.\n" + example_code: | + ``` + choices = rock, paper, scissors + your_choice {is} {ask} 'What do you choose?' + {print} 'You choose ' your_choice + computer_choice {is} choices {at} {random} + {print} 'The computer chooses ' computer_choice + {if} computer_choice {is} your_choice + {print} 'Tie' + {if} computer_choice {is} rock + {if} your_choice {is} paper + {print} 'You win!' + {if} your_choice {is} scissors + {print} 'You lose!' + # finish this code + ``` + start_code: '# place your code here' 10: - story_text: "### Exercise\nWe can also make a Harry Potter themed fortune teller. Fill in blanks such that 9 lines are printed.\n**Extra** Change the theme of the fortune teller into something else, such as your favorite book, film or tv show.\n" - example_code: "```\nhouses = Gryffindor, Slytherin, Hufflepuff, Ravenclaw\nsubjects = potions, defence against the dark arts, charms, transfiguration\nfears = Voldemort, spiders, failing your OWL test\nnames = Harry, Ron, Hermione\n_\n_ {print} name ' is placed in ' houses {at} {random}\n_ {print} name ' is great at ' subjects {at} {random}\n_ {print} name 's greatest fear is ' fears {at} {random}\n```\n" + story_text: | + ### Exercise + In the previous levels you have often made your own rock paper scissors game. Can you finish the code and use the `{for}` command properly to get the game to work? + example_code: | + ``` + choices = _ + players = _ + {for} _ + ``` start_code: '# place your code here' - default_save_name: Harry Potter - name: Harry Potter - description: Harry Potter adventures - hotel: - levels: 13: - start_code: "{define} welcome_message {with} title, last_name, country, room_number\n {print} 'Welcome to Hotel Hedy, ' title ' ' last_name\n nice_trip {is} {ask} 'Did you have a nice trip from, ' country '?'\n {if} nice_trip {is} 'yes'\n {print} 'Lovely!'\n {else}\n {print} 'Sorry to hear that.'\n {print} 'Hopefully you can take a nice rest in you room.'\n {print} 'Your room number is ' room_number\n\n{print} 'Hello. Please fill in your information to check in.'\ntitle = {ask} 'What is your title (mr, mrs, ms, dr, etc.)?'\nname = {ask} 'What is you last name?'\nhomecountry = {ask} 'What country do you come from?'\n\n{call} welcome_message {with} title, name, homecountry, 105\n" - example_code: "```\n{define} welcome_message {with} title, last_name, country, room_number\n {print} 'Welcome to Hotel Hedy, ' title ' ' last_name\n nice_trip {is} {ask} 'Did you have a nice trip from, ' country '?'\n {if} nice_trip {is} 'yes'\n {print} 'Lovely!'\n {else}\n {print} 'Sorry to hear that.'\n {print} 'Hopefully you can take a nice rest in you room.'\n {print} 'Your room number is ' room_number\n\n{print} 'Hello. Please fill in your information to check in.'\ntitle = {ask} 'What is your title (mr, mrs, ms, dr, etc.)?'\nname = {ask} 'What is you last name?'\nhomecountry = {ask} 'What country do you come from?'\n\n{call} welcome_message {with} title, name, homecountry, 105\n```\n" - story_text: "In the previous adventure you have learned how to use an argument in a function, and you've learned how to combine it with an {ask}.\nYou might have wondered why you would use functions, because the functions in the example were only one line of code.\nNow we will show you what a bigger function looks like and we will use multiple agruments now as well. You'll see how much better it is to use a function once the function gets bigger.\nHere is an example of a function with arguments combined with {ask} commands.\n" - description: hotel - default_save_name: hotel - name: hotel - add_remove_command: - levels: - 3: - example_code_3: "```\n{print} Mystery milkshake\nflavors {is} strawberry, chocolate, vanilla\nhope {is} {ask} What flavor are you hoping for?\n_\nallergies {is} {ask} Are you allergic to any flavors?\n_\n{print} You get a flavors {at} {random} milkshake\n```\n" - start_code: "animals {is} dog, cat, kangaroo\nlike {is} {ask} What is your favorite animal?\n{add} like {to_list} animals\ndislike {is} {ask} What animal do you not like?\n{remove} dislike {from} animals\n{print} I choose animals {at} {random}" - story_text_3: "### Exercise\nTry out the new commands in this virtual restaurant. Add the flavor the player is hoping for to the list and remove the flavors they are allergic to.\n" - example_code: "```\nanimals {is} dog, cat, kangaroo\nlike {is} {ask} What is your favorite animal?\n{add} like {to_list} animals\n{print} I choose animals {at} {random}\n```\n" - example_code_2: "```\nanimals {is} dog, cat, kangaroo\ndislike {is} {ask} What animal do you not like?\n{remove} dislike {from} animals\n{print} I choose animals {at} {random}\n```\n" - story_text: "## Add to\nYou can add items to the list with the `{add} {to}` command. To add an item to a list you can simply type: `{add} penguin {to} animals` or you can use the `{ask}` command like in the example code.\n" - story_text_2: "## Remove from\nIf you can add items to a list, of course you can also take them off. This is done with the `{remove} {from}` command.\n" - description: introducing add to and remove from - default_save_name: add_remove_command - name: '{add} {to} & {remove} {from}' - ask_command: + story_text: | + With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code. + + ### Exercise + Finish the code such that a winner is always decided on. Run your code a few times to verify there is always a winner printed. + example_code: | + ``` + options = 'rock', 'paper', 'scissors' + your_choice = {ask} 'What do you choose?' + computer_choice = options {at} {random} + {print} 'You choose ' your_choice + {print} 'The computer chooses ' computer_choice + {if} computer_choice {is} your_choice + {print} 'Tie' + {if} computer_choice {is} 'rock' {and} your_choice {is} 'paper' + {print} 'You win!' + {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' + {print} 'The computer wins!' + _ + ``` + start_code: '# place your code here' + 15: + story_text: | + ### Exercise + Play until you beat the computer! But first, finish the example code... + example_code: | + ``` + won = 'no' + options = 'rock', 'paper', 'scissors' + {while} won == 'no' + your_choice = {ask} 'What do you choose?' + computer_choice = options {at} {random} + {print} 'you chose ' your_choice + {print} 'the computer chose ' computer_choice + {if} computer_choice == your_choice + {print} 'Tie!' + {if} computer_choice == 'rock' {and} your_choice == 'scissors' + {print} 'You lose!' + {if} computer_choice == 'rock' {and} your_choice == 'paper' + {print} 'You win!' + won = 'yes' + _ + ``` + start_code: '# place your code here' + rock_2: + name: Rock, paper, scissors 2 + default_save_name: rock_2 + description: Part 2 of rock, paper, scissors levels: - 1: - story_text_3: "### Exercise\nTry out the `{ask}` and `{echo}` commands. Firstly, fill in the blanks to make this program work.\nThen ask 2 more questions using the `{ask}` command, after each `{ask}` use an `{echo}` to print the answer on the screen.\n" - story_text: "## The ask command\nNow that you can use the `{print}` command, you are ready to learn the next command: `{ask}`. With the `{ask}` command, you can ask a question. Check it out:\n" - example_code_3: "```\n_ How are you doing?\n_\n```\n" - example_code_2: "```\n{print} Hello!\n{ask} What is your name?\n{echo} hello\n```\n" - example_code: "```\n{print} Hello!\n{ask} What is your name?\n```\n" - story_text_2: "## The `{echo}` command\nIf you want the computer to repeat the answer back to you, you can use the `{echo}` command. The answer will be echoed back at the end of the sentence, so in this example after hello.\n" - start_code: "{print} Hello!\n{ask} What is your name?\n{echo} hello\n" 2: - example_code_2: "```\nfavorite_animals {is} {ask} What is your favorite animal?\n{print} I like favorite_animals\n```\n" - story_text_2: "### Exercise\nIn the previous tab you have practised with setting variables with the `{is}` command.\nYou have created at least 3 variables and used them with a print command.\nNow, instead of setting the variables we want you to make the variables interactive, like we did in our example.\n\nCopy your code from the previous tab and make the variables interactive by using `{ask}` commands.\n" - example_code: "```\nname {is} {ask} What is your name?\n{print} Hello name\nage {is} {ask} How old are you?\n{print} name is age years old.\n```\n" - story_text: "## The ask command\nNow that we can use **variables** in our codes, we no longer need the `{echo}` command.\nWe can use variables to store the answers to our questions and this way we can use the answer to multiple questions in our codes.\nCheck it out:\n\nThis way your code is becoming interactive!\n" - start_code: "name {is} {ask} What is your name?\n{print} Hello name\nage {is} {ask} How old are you?\n{print} name is age years old." - 18: - story_text: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. - example_code: "```\n{print}('My name is Hedy!')\nname = {input}('What is your name?')\n{print}('So your name is ', name)\n```\n" - start_code: "{print}('My name is Hedy!')\nname = {input}('What is your name?')\n{print}('So your name is ', name)\n" - description: Introduction ask command - name: '{ask}' - default_save_name: ask_command - turtle: + story_text: | + 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. + example_code: | + ``` + choice {is} _ + {print} I choose choice + ``` + start_code: '# place your code here' + secret: + name: SuperSpy + default_save_name: SuperSpy + description: Make your own spy code levels: - 9: + 12: + story_text: | + In this adventure you can create your own super spy code. Encode a message that only the right agent can decipher. + If the enemy tries to crack the code, they will get some false info to waste their time. + + ### Exercise 1 + Make your own secret code for your superspy and return both parts only to the real spy. + + ### Exercise 2 + Add a third component to the code, like a piece of clothing or an object. + example_code: | + ``` + name = {ask} 'What is your name?' + {if} name {is} '_' + a = 'Go to the airport ' + {else} + a = 'Go to the trainstation ' + password = {ask} 'What is the password?' + {if} password {is} _ + b = 'tomorrow at 02.00' + {else} + b = 'today at 10.00' + {print} _ _ _ + ``` start_code: '# place your code here' - story_text: "Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures.\n\n### Exercise 1\nThis code creates three black triangles, change that into five pink squares.\n\n **Extra** Create a figure of your own choosing consisting of at least two different shapes types.\n" - example_code: "```\n{color} {black}\n{repeat} 3 {times}\n {repeat} 3 {times}\n {forward} 10\n {turn} 120\n {color} {white}\n {forward} 50\n {color} {black}\n```\n" - 5: - story_text_2: "### Exercise\nFill in the correct numbers in this code to get it to work.\nAfter you've done that, you can try to add the option backwards.\n\n**Extra** Instead of using 'left' and 'right', remake the program with North, East, South and West.\nThis way you could add even more directions like Northeast and Southwest etc.\n" - example_code_2: "```\ndirection {is} {ask} 'Do you want to go left, right, or straight ahead?'\n{if} direction {is} left {turn} _\n{if} direction {is} right {turn} _\n{forward} 100\n```\n" - story_text: "In level 5 you can make a choice with `{if}`. For example between different types of figures.\n" - example_code: "```\n{print} 'Drawing Figures'\nfigure {is} {ask} 'Do you want a square or a triangle?'\n{if} figure {is} triangle angle {is} 120\n{else} angle {is} 90\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n```\n" - start_code: "{print} 'Drawing Figures'\nfigure {is} {ask} 'Do you want a square or a triangle?'\n{if} figure {is} triangle angle {is} 120 {else} angle {is} 90\n{turn} angle\n{forward} 25" + 13: + story_text: | + We can simplify the superspy code with `{and}`, such that we only need one `{if}`. + + ### Exercise 1 + Complete the code by filling the right command on the blank. Tip: The superspy has to answer BOTH questions correctly, before they get the confidential information! + + ### Exercise 2 + We want confuse the enemy even more! Create a list with fake answers and select one at random when a wrong answer is given. + example_code: | + ``` + name = {ask} 'What is your name?' + password = {ask} 'What is your password?' + {if} name {is} 'Agent007' _ password {is} 'TOPSECRET' + {print} 'Go to the airport at 02.00' + {else} + {print} 'Go to the trainstation at 10.00' + ``` + start_code: '# place your code here' + sleep_command: + name: '{sleep}' + default_save_name: sleep_command + description: introducing sleep command + levels: + 2: + story_text: | + 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. + example_code: | + ``` + {print} My favorite colour is... + {sleep} 2 + {print} green! + ``` + start_code: |- + {print} My favorite colour is... + {sleep} 2 + {print} green! + songs: + name: Sing a song! + default_save_name: Song + description: Print a song + levels: 6: - start_code: "{print} 'Drawing figures'" - example_code: "```\nangles = {ask} 'How many angles do you want?'\nangle = 360 / angles\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n{forward} 50\n{turn} angle\n```\n" - story_text: "In this level you can use calculations to draw different figures.\nYou may have learned in school that turning a full circle is 360 degrees. If not, now you know!\nThat's why you also use 90 degrees for a square. 360 divided by 4 is 90.\nNow that we can do math with Hedy, we can draw all the figures we want!\n" + story_text: | + Songs often contain a lot of repetition. Sometimes the repetition is also based on counting. + For example, in the well-known song 'Bottles of beer'. You can program that song with a little math. + + Tip: Use the read aloud function to let Hedy sing the song to you! + + ### Exercise + You can now repeat lines 2 to 7 as many times as you want by copying the lines. + example_code: | + ``` + verse = 99 + {print} verse ' bottles of beer on the wall' + {print} verse ' bottles of beer' + {print} 'Take one down, pass it around' + verse = verse - 1 + {print} verse ' bottles of beer on the wall' + {sleep} + ``` + story_text_2: | + This children's song counts down from 5 little monkeys to 1 monkey. + If you copy line 2 - 7 and paste it under the the code, you can sing the whole song! + example_code_2: | + ``` + number = 6 + number = number - 1 + {print} number ' little monkeys jumping on the bed' + {print} 'One fell off and bumped his head' + {print} 'Mama called the doctor and the doctor said' + {print} 'NO MORE MONKEYS JUMPING ON THE BED!' + {sleep} + ``` + start_code: '{print} ''Lets sing!''' + 7: + story_text: | + Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: + + Baby Shark tututudutudu
+ Baby Shark tututudutudu
+ Baby Shark tututudutudu
+ Baby Shark + + ### Exercise + You can print the song Baby Shark with a `{repeat}`? Finish the code by replacing the blanks? + **Extra** After Baby Shark you can of course also program other songs. There are many songs with repetition! + Can you think of one more song and print it? + example_code: | + ``` + {repeat} _ _ {print} 'Baby Shark tututudutudu' + {print} 'Baby Shark' + ``` + start_code: '{print} ''Baby Shark''' 8: - story_text: "Now that we can repeat several lines, we can make figures more easily.\nWe only have to set the angle once and then use that variable in the `{repeat}`.\n\n### Exercise 1\nThe example code creates a square. Change the code so that it create another figure, such as a triangle or a hexagon. \nThis requires a change to two lines of code.\nTip: An entire circle is 360 degrees.\n\n### Exercise 2\nNow create a drawing consisting of at least two polygons.\n" - story_text_2: "**Extra** We can now improve the program that draws different figures. Finish the code and you can draw any polygon you'd like!\n" - example_code_2: "```\nfigure = {ask} 'How many angles should I draw?'\nangle = 360 / figure\n{repeat} figure {times}\n {turn} _\n {forward} _\n```\n" - start_code: figure = {ask} 'How many angles should I draw?' - example_code: "```\nangle = 90\n{repeat} 4 {times}\n {turn} angle\n {forward} 50\n```\n" - 1: - example_code: "```\n{forward} 20\n{turn} {right}\n{forward} 20\n{turn} {left}\n{forward} 20\n```\n" - story_text: "You can also use Hedy to draw. By combining turns and lines, you can make a square or stairs!\n\nUsing `{forward}` you draw a line forwards. The number behind it determines how far the turtle will walk. `{turn} {right}` turns a quarter turn in clockwise direction, `{turn} {left}` turns counter clockwise.\n\nIf you want to go backwards, you use the `{forward}` command but with a negative number. So for example `{forward} -100`\n\n### Exercise\nThis is the start of a little staircase. Can you make it have 5 steps?\n" - start_code: "{forward} 50\n{turn} {left}" - 2: - start_code: "{print} Turtle race!\nangle {is} 90\n{turn} angle\n{forward} 25" - example_code: "```\nanswer {is} {ask} How many steps should the turtle make?\n{forward} answer\n```\n" - example_code_2: "```\n{print} Drawing figures\nangle {is} 90\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n```\n" - story_text: "In this level you can use variables to make the turtle interactive. For example you can ask the player how many steps the turtle must make.\n" - story_text_2: "Also, in level 1 the turtle could only turn left or right. That is a bit boring!\nIn level 2 he can point his nose in all directions.\n\nUse 90 to turn a quarter. We call this degrees. A full turn is 360 degrees.\n\n### Exercise\nCan you make a figure with this code? Maybe a triangle or a circle?\n" - 4: - start_code: "{print} 'Drawing figures'\nangle {is} 90\n{turn} angle\n{forward} 25" - story_text: "In level 4 you have to use quotation marks with `{print}` and `{ask}`. Also when drawing!\n" - example_code: "```\n{print} _ Drawing figures _\nangle {is} 90\n{turn} angle\n{forward} 25\n{turn} angle\n{forward} 25\n```\n" - example_code_2: "```\n{color} {white}\n{forward} -80\n{color} {green}\n{forward} 50\n{color} {yellow}\n{forward} 50\n{color} {red}\n{forward} 50\n```\n" - story_text_2: "You can also change the color of the lines with the command `{color}`. Check out the example.\nYou 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.\n" - 12: - example_code: "```\n{define} square\n {repeat} 4 {times}\n {turn} _\n {forward} _\n{call} square\n{forward} 50\n{call} square\n{forward} 50\n{call} square\n```\n" - story_text: "We can use functions to draw more complex figures with less code.\n### Exercise 1\nFill the function so that three squares are created. If you want the image to look nicer, you can make the lines between the squares white.\n\n### Exercise 2\nThe code can be made even shorter. Place the final lines into a `{repeat}` so the figure remains the same.\n\n### Exercise 3\nCreate your own drawing with different figures.\nChange both the number of figures with the `{repeat}` and the shape of the figures in the `{define}`\n" - start_code: "{define} square\n {repeat} 4 {times}\n {turn} _\n {forward} _\n{call} square\n{forward} 50\n{call} square\n{forward} 50\n{call} square\n" - 3: - story_text: "In this level you can use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time.\nUse `{at} {random}` to choose a value from a list.\n### Exercise\nCan you copy and paste lines 2 and 3 to create a longer random path?\n" - start_code: "angles {is} 10, 50, 90, 150, 250\n{turn} angles {at} {random}\n{forward} 25" - example_code: "```\nangles {is} 10, 50, 90, 150, 250\n{turn} angles {at} {random}\n{forward} 25\n```\n" + story_text: | + In a previous level you've programmed the song 'Bottles of beer'. But without the `{repeat}` command, you had to copy the verses many times. + In this level you can repeat the song 99 times, just by adding one simple line! + + ### Exercise + Add the right command on the blanks and indent the code correctly. + example_code: | + ``` + verse = 99 + _ 99 {times} + {print} verse ' bottles of beer on the wall' + {print} verse ' bottles of beer' + {print} 'Take one down, pass it around' + verse = verse - 1 + {print} verse ' bottles of beer on the wall' + ``` + start_code: '# place your code here' 10: + story_text: | + With `{for}` you can print make the whole baby shark song (including all the other sharks in the family) in only 6 lines! + + ### Exercise 1 + Can you make the baby shark code even shorter by using a `{for}` command? Finish the example code. + example_code: "```\nfamily = baby, mammy, daddy, grandma, grandpa\n_ _ _ _ \n {print} _\n```\n" + story_text_2: | + ### Exercise 2 + Print the song Five little moneys jumping on the bed. Look up the text if you don't remember. + + **Extra** Print the song Old MacDonald had a farm, and make sure all animals make a different sound, using an `{if}`. + example_code_2: | + ``` + monkeys = 5, 4, 3, 2, 1 + ``` + start_code: '# place your code here' + 11: + story_text: | + In this level you can use the `{for}` with `{range}` to make songs that use counting, like the 5 little monkeys. + + ### Exercise 1 + Fill in the blanks and make the code work! If you don't remember the song text, look it up yourself. + + ### Exercise 2 + The final line of the song is different from the others. Print this line inside the `{for}`, and use an `{if}` to make it work correctly. + example_code: | + ``` + _ monkeys _ _ 5 _ 1 + {print} monkeys ' little monkeys jumping on the bed' + _ + ``` start_code: '# place your code here' - example_code: "```\n{turn} 90\ndistances = 10, 20, 30, 40, 50, 60\n{for} distance {in} distances\n {forward} distance\n```\n```\n" - story_text: "In this level you can make the turtle draw a figure.\nThe turtle will travel the distances in the list, one by one, making bigger and bigger steps.\n### Exercise 1\nAdd a 90 degree turn in the loop, so that a spiral is drawn.\nAdd at least 5 numbers to the list, so the spiral grows larger.\n**(extra)** can you change the spiral into another shape? Experiment with numbers for the turn!\n### Exercise 2\nThe spiral is drawn outwards, make it go inwards?\n" - name: Turtle - description: Make your own drawing - default_save_name: Turtle - quotation_marks: - levels: 12: - start_code: "name = {ask} 'What is your name?'\n{if} name = 'Hedy the Robot'\n {print} 'Hi there!'" - story_text_4: "**Numbers don't need quotation marks**\nFor numbers, you do not use quotation marks in the `=`:\n" - example_code: "```\nname = 'Hedy the Robot'\n{print} 'Hello ' name\n```\n" - example_code_4: "```\nscore = 25\n{print} 'You got ' score\n```\n" - example_code_2: "```\nsuperheroes = 'Spiderman', 'Batman', 'Iron Man'\n{print} superheroes {at} {random}\n```\n" - story_text: "**All texts need to be in quotation marks**\nFor this level on you will also have to use quotation marks when storing a text with `=`:\n" - story_text_3: "**All text after `{if}` comparisons need quotation marks too**\n" - example_code_3: "```\nname = {ask} 'What is your name?'\n{if} name = 'Hedy the Robot'\n {print} 'Hi there!'\n```\n" - story_text_2: "**All items in lists need quotation marks too**\nLists are texts, so they need quotation marks too. Mind that each single item on the list has quotation marks.\nThis allows you to save two words as 1 item on the list, for example 'Iron Man'.\n" - 4: - story_text_2: "## Contractions\nImportant! 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.\nMake sure to remove those apostrophes and change the spelling to I am or What is.\nCheck out the example code to see the wrong way of using apostrophes.\n" - example_code: "```\n{print} 'You need to use quotation marks from now on!'\nanswer {is} {ask} 'What do we need to use from now on?'\n{print} 'We need to use ' answer\n```\n" - story_text: "## 'Quotation marks'\nIn level 4 `{ask}` and `{print}` have changed.\nYou must put text that you want to print between quotation marks.\nThis is useful, because now you can print all the words you want. Also the words you used to store something with `{is}`.\nMost programming languages also use quotation marks when printing, so we are also getting a step closer to real programming!\n" - start_code: "{print} 'You need to use quotation marks from now on!'\nanswer {is} {ask} 'What do we need to use from now on?'\n{print} 'We need to use ' answer 'from now on'" - example_code_2: "```\n_ This is the wrong way of using apostrophes _\n{print} 'I'm babysitting my sister's kids'\n{print} 'What's more fun than that?'\n```\n" - default_save_name: quotation_marks - description: Introduction quotation marks - name: "'quotation marks'" - and_or_command: - name: '{and} & {or}' - default_save_name: and or - levels: - 13: - example_code: "```\nname = {ask} 'what is your name?'\nage = {ask} 'what is your age?'\n{if} name {is} 'Hedy' {and} age {is} 2\n {print} 'You are the real Hedy!'\n```\n" - start_code: "name = {ask} 'what is your name?'\nage = {ask} 'what is your age?'\n{if} name {is} 'Hedy' {and} age {is} 2\n {print} 'You are the real Hedy!'" - story_text: "We are now going to learn `{and}` and `{or}`! If you want to check two statements, you don't have to use two `{if}`s but can use `{and}` and `{or}`.\n\nIf you use `{and}`, both statements, left and right of the `{and}` need to be true. We can also use `{or}`. Then only one statement needs to be correct." - description: introducing and or - secret: - levels: + story_text: | + In this song we can make it even easier to program 'if you're happy and you know it, clap your hands'. Because we can put all of the actions in a variable, check it out: + + ### Exercise + Can you add the right amount of indentation to each line to make the song play correctly? + Tip: Not all lines need indentation + example_code: | + ``` + _ actions = 'clap your hands', 'stomp your feet', 'shout Hurray!' + _ {for} action {in} actions + _ {for} i {in} {range} 1 {to} 2 + _ {print} 'if youre happy and you know it' + _ {print} action + _ {print} 'if youre happy and you know it and you really want to show it' + _ {print} 'if youre happy and you know it' + _ {print} action + ``` + start_code: '# place your code here' 13: - story_text: "We can simplify the superspy code with `{and}`, such that we only need one `{if}`.\n\n### Exercise 1\nComplete the code by filling the right command on the blank. Tip: The superspy has to answer BOTH questions correctly, before they get the confidential information!\n\n### Exercise 2\nWe want confuse the enemy even more! Create a list with fake answers and select one at random when a wrong answer is given.\n" + story_text: | + In the previous adventure you have learned how to use an argument in a function, but did you know that you could combine them with {ask} commands as well? + In this example we have changed the 'My Bonnie' program and made it interactive. You are now asked where Bonnie is. + example_code: | + ``` + {define} song {with} place + {print} 'My Bonnie is ' place + + chosen_place = {ask} 'Where do you want Bonnie to be?' + synonym = {ask} 'What is another word for that?' + + {call} song {with} chosen_place + {call} song {with} synonym + {call} song {with} chosen_place + ``` + start_code: | + {define} song {with} place + {print} 'My Bonnie is ' place + + chosen_place = {ask} 'Where do you want Bonnie to be?' + synonym = {ask} 'What is another word for that?' + + {call} song {with} chosen_place + {call} song {with} synonym + {call} song {with} chosen_place + 16: + story_text: | + In this level, you can program a song like OldMacDonald even more quickly. You can connect the right animal to the right sound by simply putting them in the same place in the list. + The Drunken Sailor is also quickly made in this level. You only need 8 lines for the entire song, check it out! + + ### Exercise + Complete the Old McDonald song by setting the variable `animal` to `animals[i]` and `sound` to `sounds[i]`. + example_code: | + ``` + animals = ['pig', 'dog', 'cow'] + sounds = ['oink', 'woof', 'moo'] + {for} i {in} {range} 1 {to} 3 + animal = _ + sound = _ + {print} 'Old McDonald had a farm' + {print} 'E I E I O!' + {print} 'and on that farm he had a ' animal + {print} 'E I E I O!' + {print} 'with a ' sound sound ' here' + {print} 'and a ' sound sound ' there' + {print} 'here a ' sound + {print} 'there a ' sound + {print} 'everywhere a ' sound sound + ``` + + ``` + lines = ['what shall we do with the drunken sailor', 'shave his belly with a rusty razor', 'put him in a long boat till hes sober'] + {for} line {in} lines + {for} i {in} {range} 1 {to} 3 + {print} line + {print} 'early in the morning' + {for} i {in} {range} 1 {to} 3 + {print} 'way hay and up she rises' + {print} 'early in the morning' + ``` start_code: '# place your code here' - example_code: "```\nname = {ask} 'What is your name?'\npassword = {ask} 'What is your password?'\n{if} name {is} 'Agent007' _ password {is} 'TOPSECRET'\n {print} 'Go to the airport at 02.00'\n{else}\n {print} 'Go to the trainstation at 10.00'\n ```\n" - 12: - story_text: "In this adventure you can create your own super spy code. Encode a message that only the right agent can decipher.\nIf the enemy tries to crack the code, they will get some false info to waste their time.\n\n### Exercise 1\nMake your own secret code for your superspy and return both parts only to the real spy.\n\n### Exercise 2\nAdd a third component to the code, like a piece of clothing or an object.\n" - example_code: "```\nname = {ask} 'What is your name?'\n{if} name {is} '_'\n a = 'Go to the airport '\n{else}\n a = 'Go to the trainstation '\npassword = {ask} 'What is the password?'\n{if} password {is} _\n b = 'tomorrow at 02.00'\n{else}\n b = 'today at 10.00'\n{print} _ _ _\n```\n" + 18: + story_text: | + In level 16 we made songs using lists. These programs however are no longer working properly in this level. The colons from level 17 and the brackets from level 18 still need to be added. + + ### Exercise 1 + The Drunken sailor song is given as sample code, but not yet working. + Can you make sure everything works again? To help you, we've put _ in the places of _some_ errors. + + ### Exercise 2 + Now also look up your Old MacDonald song from level 16, and correct it. + example_code: | + ``` + lines = ['what shall we do with the drunken sailor', 'shave his belly with a rusty razor', 'put him in a long boat till hes sober'] + {for} line {in} lines _ + {for} i {in} {range} 1 {to} 3 _ + {print} _ line _ + {print} 'early in the morning' + {for} i {in} {range} 1 {to} 3 + {print} 'way hay and up she rises' + {print} 'early in the morning' + ``` start_code: '# place your code here' - description: Make your own spy code - default_save_name: SuperSpy - name: SuperSpy songs_2: + name: Sing a song! 2 + default_save_name: Song 2 description: Sing a song 2 levels: 12: - start_code: "{define} twinkle\n {print} 'Twinkle'\n {print} '...'\n\n{call} twinkle\n{print} 'Up above the world so high'\n{print} 'Like a diamond in the sky'\n{call} _\n" - example_code: "```\n{define} twinkle\n {print} 'Twinkle'\n {print} '...'\n\n{call} twinkle\n{print} 'Up above the world so high'\n{print} 'Like a diamond in the sky'\n{call} _\n```\n" - story_text: "Songs contain a lot of repetition. We can capture it with a function!\n### Exercise\nLook at the example code with the function. Fill out the two lines so the full song is printed.\n" - default_save_name: Song 2 - name: Sing a song! 2 - blackjack: - description: Try to get as close to 21 as you can - default_save_name: Blackjack - levels: - 17: - story_text: "Blackjack is a simple game of cards in which you have to get as close to 21 points as possible. You get two cards. Each card is worth their numeral value, and the face cards (Jack, Queen and King) are worth 10 points.\nThe Ace is worth either 1 or 11 points (you can choose). The dealer, your opponent, also gets two cards.\nIf you want, you can get another card, and its points will be added to your total. The dealer can also choose to take another card.\nBut be careful not to get more than 21 points, because if you do, you lose!\nThe player who gets closest to 21, without going over it, wins!\n\nHave fun!\n" - example_code: "```\n{print} 'BLACKJACK'\ncards = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'Jack', 'Queen','King', 'Ace']\npoints = 0\ndealer_points = 0\ncard_1 = cards[{random}]\ncard_2 = cards[{random}]\ncard_3 = cards [{random}]\ndealer_card_1 = cards[{random}]\ndealer_card_2 = cards[{random}]\ndealer_card_3 = cards[{random}]\n# Points for card 1\n{if} card_1 == 'Jack' {or} card_1 == 'Queen' {or} card_1 == 'King':\n points = points + 10\n{elif} card_1 == 'Ace':\n points = points + 11\n{else}:\n points = points + card_1\n# Points for card 2\n{if} card_2 == 'Jack' {or} card_2 == 'Queen' {or} card_2 == 'King':\n points = points + 10\n{elif} card_2 == 'Ace':\n points = points + 11\n{else}:\n points = points + card_2\n# Points for dealer card 1\n{if} dealer_card_1 == 'Jack' {or} dealer_card_1 == 'Queen' {or} dealer_card_1 == 'King':\n dealer_points = dealer_points + 10\n{elif} dealer_card_1 == 'Ace':\n dealer_points = dealer_points + 11\n{else}:\n dealer_points = dealer_points + dealer_card_1\n# Points for dealer card 2\n{if} dealer_card_2 == 'Jack' {or} dealer_card_2 == 'Queen' {or} dealer_card_2 == 'King':\n dealer_points = dealer_points + 10\n{elif} dealer_card_2 == 'Ace':\n dealer_points = dealer_points + 11\n{else}:\n dealer_points = dealer_points + dealer_card_2\n# Two Aces\n{if} card_1 == 'Ace' {and} card_2 == 'Ace':\n points = 12\n{if} dealer_card_1 == 'Ace' {and} dealer_card_2 == 'Ace':\n dealer_points = 12\n# Scoreboard\n{print} 'You have a ' card_1 ' and a ' card_2 ' (' points ' points)'\n{print} 'The dealer has a ' dealer_card_1 ' and a ' dealer_card_2 ' (' dealer_points ' points)'\n# Extra card for the player\nhit = {ask} 'Do you want an extra card?'\n{if} hit == 'yes':\n {if} card_3 == 'Jack' {or} card_3 == 'Queen' {or} card_3 == 'King':\n points = points + 10\n {elif} card_3 == 'Ace':\n {if} points > 11:\n points = points + 11\n {else}:\n points = points + 1\n {else}:\n points = points + card_3\n {print} 'You get an extra ' card_3 ' (' points ' points)'\n{else}:\n {print} 'No extra cards'\n# Winner\n{if} points > 21 {or} dealer_points > points {or} dealer_points == 21:\n {print} 'You lose'\n{elif} dealer_points < 17:\n {print} 'The dealer takes an extra card. It is a... ' dealer_card_3\n {if} dealer_card_3 == 'Jack' {or} dealer_card_3 == 'Queen' {or} dealer_card_3 == 'King':\n dealer_points = dealer_points + 10\n {elif} dealer_card_3 == 'Ace':\n {if} dealer_points < 11:\n dealer_points = dealer_points + 11\n {else}:\n dealer_points = dealer_points + 1\n {else}:\n dealer_points = dealer_points + dealer_card_3\n {print} 'The dealer has ' dealer_points ' points now'\n {if} dealer_points < 21 {and} dealer_points > points:\n {print} 'You lose'\n {else}:\n {print} 'You win'\n{elif} points > dealer_points {and} points < 21:\n {print} 'You win!'\n```\n" - start_code: '# place your code here' - name: Blackjack + story_text: | + Songs contain a lot of repetition. We can capture it with a function! + ### Exercise + Look at the example code with the function. Fill out the two lines so the full song is printed. + example_code: | + ``` + {define} twinkle + {print} 'Twinkle' + {print} '...' + + {call} twinkle + {print} 'Up above the world so high' + {print} 'Like a diamond in the sky' + {call} _ + ``` + start_code: | + {define} twinkle + {print} 'Twinkle' + {print} '...' + + {call} twinkle + {print} 'Up above the world so high' + {print} 'Like a diamond in the sky' + {call} _ tic: + name: Tic Tac Toe default_save_name: Tic + description: Play a game of Tic Tac Toe! levels: 13: - example_code: "```\nplayer = 'x'\nfield = '.', '.', '.', '.', '.', '.', '.', '.', '.'\n\n{for} i {in} {range} 1 {to} 9\n choice = {ask} 'Player ' player ' what spot do you choose?'\n field {at} choice = player\n {clear}\n {print} field {at} 1 field {at} 2 field {at} 3\n {print} field {at} 4 field {at} 5 field {at} 6\n {print} field {at} 7 field {at} 8 field {at} 9\n {if} player = 'x'\n player = 'o'\n {else}\n player = 'x'\n```\n" - story_text: "In this adventure you can program a game of Tic Tac Toe. You can play with two people. Taking turns, you pick a number of the spot (1 - 9) you want to put your sign (x or o) on.\nThe first player that gets 3 in a row (horizontally, vertically or diagonally) wins!\n\n### Exercise 1\nThe game works, but it has some issues. For example, any player can pick any field, even one already taken! Use an `{if}` whether the spot is taken, and if so, warn the player.\n\n### Exercise 2\nThe game also does not decide who has won. You need to add this by checking whether 3 spots in a row have the same same symbol.\n\n### Exercise 3 Extra\nYou don't always have a friend to play with. Can you create a computer opponent?\n" + story_text: | + In this adventure you can program a game of Tic Tac Toe. You can play with two people. Taking turns, you pick a number of the spot (1 - 9) you want to put your sign (x or o) on. + The first player that gets 3 in a row (horizontally, vertically or diagonally) wins! + + ### Exercise 1 + The game works, but it has some issues. For example, any player can pick any field, even one already taken! Use an `{if}` whether the spot is taken, and if so, warn the player. + + ### Exercise 2 + The game also does not decide who has won. You need to add this by checking whether 3 spots in a row have the same same symbol. + + ### Exercise 3 Extra + You don't always have a friend to play with. Can you create a computer opponent? + example_code: | + ``` + player = 'x' + field = '.', '.', '.', '.', '.', '.', '.', '.', '.' + + {for} i {in} {range} 1 {to} 9 + choice = {ask} 'Player ' player ' what spot do you choose?' + field {at} choice = player + {clear} + {print} field {at} 1 field {at} 2 field {at} 3 + {print} field {at} 4 field {at} 5 field {at} 6 + {print} field {at} 7 field {at} 8 field {at} 9 + {if} player = 'x' + player = 'o' + {else} + player = 'x' + ``` start_code: '# Write your code here' 14: - example_code: "```\nsign = 'x'\nopen_spots = 1, 2, 3, 4, 5, 6, 7, 8, 9\ngame = 'on'\nspot_1 = '.'\nspot_2 = '.'\nspot_3 = '.'\nspot_4 = '.'\nspot_5 = '.'\nspot_6 = '.'\nspot_7 = '.'\nspot_8 = '.'\nspot_9 = '.'\n{print} 'TIC TAC TOE!'\n{print} spot_1 spot_2 spot_3\n{print} spot_4 spot_5 spot_6\n{print} spot_7 spot_8 spot_9\n{print} ' '\n{for} i {in} {range} 1 {to} 9\n {if} game != 'over'\n choice = {ask} 'Player ' sign ', which spot?'\n {if} choice {in} open_spots\n {remove} choice {from} open_spots\n {if} choice == 1\n spot_1 = sign\n {if} choice == 2\n spot_2 = sign\n {if} choice == 3\n spot_3 = sign\n {if} choice == 4\n spot_4 = sign\n {if} choice == 5\n spot_5 = sign\n {if} choice == 6\n spot_6 = sign\n {if} choice == 7\n spot_7 = sign\n {if} choice == 8\n spot_8 = sign\n {if} choice == 9\n spot_9 = sign\n {else}\n {print} 'That spot was already taken'\n {print} spot_1 spot_2 spot_3\n {print} spot_4 spot_5 spot_6\n {print} spot_7 spot_8 spot_9\n {print} ' '\n winner = {ask} 'Did you win?'\n {if} winner == 'yes'\n {print} 'Good job, player ' sign '!'\n game = 'over'\n {else}\n {if} sign == 'x'\n sign = 'o'\n {else}\n sign = 'x'\n```\n" - story_text: "In the previous levels you've made a tic tac toe game. Now you've learned how to use the = sign, the == sign and the != sign.\nYou can use this knowledge in your new Tic Tac Toe game, like this:\n" + story_text: | + In the previous levels you've made a tic tac toe game. Now you've learned how to use the = sign, the == sign and the != sign. + You can use this knowledge in your new Tic Tac Toe game, like this: + example_code: | + ``` + sign = 'x' + open_spots = 1, 2, 3, 4, 5, 6, 7, 8, 9 + game = 'on' + spot_1 = '.' + spot_2 = '.' + spot_3 = '.' + spot_4 = '.' + spot_5 = '.' + spot_6 = '.' + spot_7 = '.' + spot_8 = '.' + spot_9 = '.' + {print} 'TIC TAC TOE!' + {print} spot_1 spot_2 spot_3 + {print} spot_4 spot_5 spot_6 + {print} spot_7 spot_8 spot_9 + {print} ' ' + {for} i {in} {range} 1 {to} 9 + {if} game != 'over' + choice = {ask} 'Player ' sign ', which spot?' + {if} choice {in} open_spots + {remove} choice {from} open_spots + {if} choice == 1 + spot_1 = sign + {if} choice == 2 + spot_2 = sign + {if} choice == 3 + spot_3 = sign + {if} choice == 4 + spot_4 = sign + {if} choice == 5 + spot_5 = sign + {if} choice == 6 + spot_6 = sign + {if} choice == 7 + spot_7 = sign + {if} choice == 8 + spot_8 = sign + {if} choice == 9 + spot_9 = sign + {else} + {print} 'That spot was already taken' + {print} spot_1 spot_2 spot_3 + {print} spot_4 spot_5 spot_6 + {print} spot_7 spot_8 spot_9 + {print} ' ' + winner = {ask} 'Did you win?' + {if} winner == 'yes' + {print} 'Good job, player ' sign '!' + game = 'over' + {else} + {if} sign == 'x' + sign = 'o' + {else} + sign = 'x' + ``` start_code: '# place your code here' - 17: - example_code: "```\nsign = 'x'\nopen_spots = [1, 2, 3, 4, 5, 6, 7, 8, 9]\ngame = 'on'\nspot_1 = '.'\nspot_2 = '.'\nspot_3 = '.'\nspot_4 = '.'\nspot_5 = '.'\nspot_6 = '.'\nspot_7 = '.'\nspot_8 = '.'\nspot_9 = '.'\n{print} 'TIC TAC TOE!'\n{print} spot_1 spot_2 spot_3\n{print} spot_4 spot_5 spot_6\n{print} spot_7 spot_8 spot_9\n{print} ' '\n{while} game != 'over':\n choice = {ask} 'Player ' sign ', which spot?'\n {if} choice {in} open_spots:\n {remove} choice {from} open_spots\n {if} choice == 1:\n spot_1 = sign\n {if} choice == 2:\n spot_2 = sign\n {if} choice == 3:\n spot_3 = sign\n {if} choice == 4:\n spot_4 = sign\n {if} choice == 5:\n spot_5 = sign\n {if} choice == 6:\n spot_6 = sign\n {if} choice == 7:\n spot_7 = sign\n {if} choice == 8:\n spot_8 = sign\n {if} choice == 9:\n spot_9 = sign\n {else}:\n {print} 'That spot was already taken'\n {print} spot_1 spot_2 spot_3\n {print} spot_4 spot_5 spot_6\n {print} spot_7 spot_8 spot_9\n {print} ' '\n {if} spot_1 == spot_2 {and} spot_2 == spot_3 {and} spot_1 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_4 == spot_5 {and} spot_5 == spot_6 {and} spot_4 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_7 == spot_8 {and} spot_8 == spot_9 {and} spot_7 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_1 == spot_4 {and} spot_4 == spot_7 {and} spot_1 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_2 == spot_5 {and} spot_5 == spot_8 {and} spot_2 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_3 == spot_6 {and} spot_6 == spot_9 {and} spot_3 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_1 == spot_5 {and} spot_5 == spot_9 {and} spot_1 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {elif} spot_3 == spot_5 {and} spot_5 == spot_7 {and} spot_3 != '.':\n {print} 'Player ' sign ' wins!'\n game = 'over'\n {else}:\n {if} sign == 'x':\n sign = 'o'\n {else}:\n sign = 'x'\n```\n" - start_code: '# place your code here' - story_text: "In the previous levels the tic tac toe game had an annoying feature. After every move, you had to fill in yourself if you had won or not.\nThis made the game playable, but also quite slow. In this level we have learned the `{elif}` command, that could solve that problem.\nTo use the `{elif}` to let Hedy check whether or not a player has won is fun, but it also requires a fair amount of extra lines.\n\nIn the example code you see that we added the requirements to win (3 spots in a row horizontally, vertically or diagonally).\nYou can find them in line 46 to 69. You can see that each time the requirement is met (so if a player has won) the variable game is set to 'over'.\nThis means that the `{while}` loop will be stopped and the game ends.\n" 15: + story_text: | + In this level you can improve your Tic Tac Toe game with the {while} loop. With this loop you can combine the `{if} game != 'over'` and the `{for} i {in} {range} 1 {to} 9` into one simple line. + Check it out: + example_code: | + ``` + sign = 'x' + open_spots = 1, 2, 3, 4, 5, 6, 7, 8, 9 + game = 'on' + spot_1 = '.' + spot_2 = '.' + spot_3 = '.' + spot_4 = '.' + spot_5 = '.' + spot_6 = '.' + spot_7 = '.' + spot_8 = '.' + spot_9 = '.' + {print} 'TIC TAC TOE!' + {print} spot_1 spot_2 spot_3 + {print} spot_4 spot_5 spot_6 + {print} spot_7 spot_8 spot_9 + {print} ' ' + {while} game != 'over' + choice = {ask} 'Player ' sign ', which spot?' + {if} choice {in} open_spots + {remove} choice {from} open_spots + {if} choice == 1 + spot_1 = sign + {if} choice == 2 + spot_2 = sign + {if} choice == 3 + spot_3 = sign + {if} choice == 4 + spot_4 = sign + {if} choice == 5 + spot_5 = sign + {if} choice == 6 + spot_6 = sign + {if} choice == 7 + spot_7 = sign + {if} choice == 8 + spot_8 = sign + {if} choice == 9 + spot_9 = sign + {else} + {print} 'That spot was already taken' + {print} spot_1 spot_2 spot_3 + {print} spot_4 spot_5 spot_6 + {print} spot_7 spot_8 spot_9 + {print} ' ' + winner = {ask} 'Did you win?' + {if} winner == 'yes' + {print} 'Good job, player ' sign '!' + game = 'over' + {else} + {if} sign == 'x' + sign = 'o' + {else} + sign = 'x' + ``` start_code: '# place your code here' - story_text: "In this level you can improve your Tic Tac Toe game with the {while} loop. With this loop you can combine the `{if} game != 'over'` and the `{for} i {in} {range} 1 {to} 9` into one simple line.\nCheck it out:\n" - example_code: "```\nsign = 'x'\nopen_spots = 1, 2, 3, 4, 5, 6, 7, 8, 9\ngame = 'on'\nspot_1 = '.'\nspot_2 = '.'\nspot_3 = '.'\nspot_4 = '.'\nspot_5 = '.'\nspot_6 = '.'\nspot_7 = '.'\nspot_8 = '.'\nspot_9 = '.'\n{print} 'TIC TAC TOE!'\n{print} spot_1 spot_2 spot_3\n{print} spot_4 spot_5 spot_6\n{print} spot_7 spot_8 spot_9\n{print} ' '\n{while} game != 'over'\n choice = {ask} 'Player ' sign ', which spot?'\n {if} choice {in} open_spots\n {remove} choice {from} open_spots\n {if} choice == 1\n spot_1 = sign\n {if} choice == 2\n spot_2 = sign\n {if} choice == 3\n spot_3 = sign\n {if} choice == 4\n spot_4 = sign\n {if} choice == 5\n spot_5 = sign\n {if} choice == 6\n spot_6 = sign\n {if} choice == 7\n spot_7 = sign\n {if} choice == 8\n spot_8 = sign\n {if} choice == 9\n spot_9 = sign\n {else}\n {print} 'That spot was already taken'\n {print} spot_1 spot_2 spot_3\n {print} spot_4 spot_5 spot_6\n {print} spot_7 spot_8 spot_9\n {print} ' '\n winner = {ask} 'Did you win?'\n {if} winner == 'yes'\n {print} 'Good job, player ' sign '!'\n game = 'over'\n {else}\n {if} sign == 'x'\n sign = 'o'\n {else}\n sign = 'x'\n```\n" - description: Play a game of Tic Tac Toe! - name: Tic Tac Toe - language: - description: Practice words in a foreign language - levels: - 5: - story_text: "Make your own program to practice your vocabulary in a new language.\n\n### Exercise\nMake the code longer by adding at least 3 more words for the player to learn.\n**Extra** Of course, you can choose to use a different language than French. You can change to code to any language you'd like to learn.\n" - example_code: "```\n{print} 'Learn French!'\ncat {is} {ask} '🐱'\n{if} cat {is} chat {print} 'Terrific!'\n{else} {print} 'No, cat is chat'\nfrog {is} {ask} '🐸'\n{if} frog {is} grenouille {print} 'Super!'\n{else} {print} 'No, frog is grenouille'\n```\n" - start_code: '# place your code here' - 16: - story_text: "### Exercise\nTake a look at the example code. This is a program to practise French vocabulary. Now make your own program to practice your vocabulary in a new language.\nIf you don't know any other languages, you can use Google translate or you can use emojis and your native language.\n" - example_code: "```\nfrench_words = ['bonjour', 'ordinateur', 'pomme de terre']\ntranslation = ['hello', 'computer', 'potato']\nscore = 0\n{for} i {in} {range} 1 {to} 3\n answer = {ask} 'What does ' french_words[i] ' mean?'\n correct = translation[i]\n {if} answer == correct\n {print} 'Correct!'\n score = score + 1\n {else}\n {print} 'Wrong, ' french_words[i] ' means ' translation[i]\n{print} 'You gave ' score ' correct answers.'\n```\n" + 17: + story_text: | + In the previous levels the tic tac toe game had an annoying feature. After every move, you had to fill in yourself if you had won or not. + This made the game playable, but also quite slow. In this level we have learned the `{elif}` command, that could solve that problem. + To use the `{elif}` to let Hedy check whether or not a player has won is fun, but it also requires a fair amount of extra lines. + + In the example code you see that we added the requirements to win (3 spots in a row horizontally, vertically or diagonally). + You can find them in line 46 to 69. You can see that each time the requirement is met (so if a player has won) the variable game is set to 'over'. + This means that the `{while}` loop will be stopped and the game ends. + example_code: | + ``` + sign = 'x' + open_spots = [1, 2, 3, 4, 5, 6, 7, 8, 9] + game = 'on' + spot_1 = '.' + spot_2 = '.' + spot_3 = '.' + spot_4 = '.' + spot_5 = '.' + spot_6 = '.' + spot_7 = '.' + spot_8 = '.' + spot_9 = '.' + {print} 'TIC TAC TOE!' + {print} spot_1 spot_2 spot_3 + {print} spot_4 spot_5 spot_6 + {print} spot_7 spot_8 spot_9 + {print} ' ' + {while} game != 'over': + choice = {ask} 'Player ' sign ', which spot?' + {if} choice {in} open_spots: + {remove} choice {from} open_spots + {if} choice == 1: + spot_1 = sign + {if} choice == 2: + spot_2 = sign + {if} choice == 3: + spot_3 = sign + {if} choice == 4: + spot_4 = sign + {if} choice == 5: + spot_5 = sign + {if} choice == 6: + spot_6 = sign + {if} choice == 7: + spot_7 = sign + {if} choice == 8: + spot_8 = sign + {if} choice == 9: + spot_9 = sign + {else}: + {print} 'That spot was already taken' + {print} spot_1 spot_2 spot_3 + {print} spot_4 spot_5 spot_6 + {print} spot_7 spot_8 spot_9 + {print} ' ' + {if} spot_1 == spot_2 {and} spot_2 == spot_3 {and} spot_1 != '.': + {print} 'Player ' sign ' wins!' + game = 'over' + {elif} spot_4 == spot_5 {and} spot_5 == spot_6 {and} spot_4 != '.': + {print} 'Player ' sign ' wins!' + game = 'over' + {elif} spot_7 == spot_8 {and} spot_8 == spot_9 {and} spot_7 != '.': + {print} 'Player ' sign ' wins!' + game = 'over' + {elif} spot_1 == spot_4 {and} spot_4 == spot_7 {and} spot_1 != '.': + {print} 'Player ' sign ' wins!' + game = 'over' + {elif} spot_2 == spot_5 {and} spot_5 == spot_8 {and} spot_2 != '.': + {print} 'Player ' sign ' wins!' + game = 'over' + {elif} spot_3 == spot_6 {and} spot_6 == spot_9 {and} spot_3 != '.': + {print} 'Player ' sign ' wins!' + game = 'over' + {elif} spot_1 == spot_5 {and} spot_5 == spot_9 {and} spot_1 != '.': + {print} 'Player ' sign ' wins!' + game = 'over' + {elif} spot_3 == spot_5 {and} spot_5 == spot_7 {and} spot_3 != '.': + {print} 'Player ' sign ' wins!' + game = 'over' + {else}: + {if} sign == 'x': + sign = 'o' + {else}: + sign = 'x' + ``` start_code: '# place your code here' - name: Language - default_save_name: Language - print_command: + turtle: + name: Turtle + default_save_name: Turtle + description: Make your own drawing levels: - 18: - start_code: "name = 'Hedy'\n{print}('My name is ', name)" - example_code: "```\n{print}('Hello!')\n{for} i {in} {range}(1, 10):\n {print}('This is line ', i)\n```\n" - example_code_2: "```\ntemperature = 25\n{print}('It is ', temperature, ' degrees outside')\n```\n" - story_text_2: If you want to print more than one item, you need to separate them by commas. - story_text: "We arrived at real Python code! That means we need to use parentheses with `{print}` and `{range}` from now on.\nIt also means you can use Hedy code from this level in any Python environment as long as you use the English commands. If you haven't until now, you can switch the toggle in the commands menu to do so." 1: - start_code: "{print} Welcome to Hedy!\n" - example_code_2: "```\n_ Hello!\n```\n" - example_code: "```\n{print} Hi there, programmer!\n{print} Welcome to Hedy!\n```\n" - story_text: "## The print command\nYou can print text to the screen using the `{print}` command.\n" - story_text_2: "### Exercise\nIn Hedy you will find exercises in every adventure. An exercise allows you to practise the new commands and concepts, and lets you give your own twist to the example codes.\nIn this exercise you will see a pink blank space. You have to fill something in the place of the blank space before the code can be ran.\n\nFill in the `{print}` command in the blank space and then add five more lines of code. Each line has to start with a `{print}` command.\nHave fun!\n" - description: Introduction print command - name: '{print}' - default_save_name: print - piggybank: - levels: - 14: - start_code: '# place your code here' - example_code: "```\n_ calculate_budget {with} wish, money, allowance\n to_save = wish - money\n weeks = to_save / allowance\n {if} wish _ money\n {print} 'You need to save up some more!'\n {print} 'Youll need ' weeks ' more weeks.'\n {else}\n {print} 'Great! You have enough'\n {print} 'Lets go shopping!'\n\nmoney = {ask} 'How much money have you saved?'\nwish = {ask} 'How much money do you need?'\nallowance = {ask} 'How much pocket money do you get each week?'\n\n{call} _\n```\n" - story_text: "### Exercise\nIn this level you can let Hedy tell you if you have saved up enough money!\nFinish this code by filling in the blanks!\n" - 12: - example_code: "```\n{print} 'The digital piggy bank'\nwish = {ask} 'What would you like to buy?'\nprice = {ask} 'How much does that cost?'\nsaved = {ask} 'How much money have you saved already?'\nallowance = {ask} 'How much pocket money do you get per week?'\nto_save = price - saved\nweeks = to_save / allowance\n{print} 'You can buy a ' _ ' in ' _ ' weeks.'\n```\n" - story_text: "In this adventure you learn how to make a digital piggy bank.\n\n### Exercise\nFinish the code to calculate how much money you have and how long you need to save up to buy what you want!\n**Extra** Maybe you have already saved some money? Deduct that from the amount you will have to save up.\n" - start_code: '# place your code here' - description: Count your pocketmoney! - name: Piggy Bank - default_save_name: Piggy Bank - pressit: - name: Key presses - levels: - 7: - example_code: "```\n{if} x {is} {pressed} {forward} 15 {else} {turn} 90\n```\n" - story_text: "Now that you have learned about `{repeat}`, we can press keys multiple times.\nYou can use it to make the turtle walk forward and turn.\n\n### Exercise\nThe code you have seen in level 5 only checks the key once. Copy the example code and add a `{repeat}` to it, so that you can press the keys many times.\nUse this code to draw something nice.\n" - start_code: '# place your code here' + story_text: | + You can also use Hedy to draw. By combining turns and lines, you can make a square or stairs! + + Using `{forward}` you draw a line forwards. The number behind it determines how far the turtle will walk. `{turn} {right}` turns a quarter turn in clockwise direction, `{turn} {left}` turns counter clockwise. + + If you want to go backwards, you use the `{forward}` command but with a negative number. So for example `{forward} -100` + + ### Exercise + This is the start of a little staircase. Can you make it have 5 steps? + example_code: | + ``` + {forward} 20 + {turn} {right} + {forward} 20 + {turn} {left} + {forward} 20 + ``` + start_code: |- + {forward} 50 + {turn} {left} + 2: + story_text: | + In this level you can use variables to make the turtle interactive. For example you can ask the player how many steps the turtle must make. + example_code: | + ``` + answer {is} {ask} How many steps should the turtle make? + {forward} answer + ``` + story_text_2: | + Also, 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 to turn a quarter. We call this degrees. A full turn is 360 degrees. + + ### Exercise + Can you make a figure with this code? Maybe a triangle or a circle? + example_code_2: | + ``` + {print} Drawing figures + angle {is} 90 + {turn} angle + {forward} 25 + {turn} angle + {forward} 25 + ``` + start_code: |- + {print} Turtle race! + angle {is} 90 + {turn} angle + {forward} 25 + 3: + story_text: | + In this level you can use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. + Use `{at} {random}` to choose a value from a list. + ### Exercise + Can you copy and paste lines 2 and 3 to create a longer random path? + example_code: | + ``` + angles {is} 10, 50, 90, 150, 250 + {turn} angles {at} {random} + {forward} 25 + ``` + start_code: |- + angles {is} 10, 50, 90, 150, 250 + {turn} angles {at} {random} + {forward} 25 + 4: + story_text: | + In level 4 you have to use quotation marks with `{print}` and `{ask}`. Also when drawing! + example_code: | + ``` + {print} _ Drawing figures _ + angle {is} 90 + {turn} angle + {forward} 25 + {turn} angle + {forward} 25 + ``` + story_text_2: | + 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. + example_code_2: | + ``` + {color} {white} + {forward} -80 + {color} {green} + {forward} 50 + {color} {yellow} + {forward} 50 + {color} {red} + {forward} 50 + ``` + start_code: |- + {print} 'Drawing figures' + angle {is} 90 + {turn} angle + {forward} 25 5: - story_text_2: "You can also link turtle commands to keys.\n\n### Exercise\nCopy the lines a few times so you can create a larger drawing.\n" - story_text: "In this level there is another new keyword: `{pressed}`!\nWith `{pressed}` you can use keys on your keyboard to control what lines are used.\n\n### Exercise\nLook at the example and add one more line of code that reacts to a key press.\n" - example_code: "```\n{print} 'Do you want a good (g) or bad (b) ending?'\n{if} g {is} {pressed} {print} 'They lived happily ever after ❤'\n{else} {print} 'The prince was eaten by a hippopotamus 😭'\n```\n" - example_code_2: "```\n{if} y {is} {pressed} {forward} 15\n{else} {turn} 90\n```\n" - start_code: '# place your code here' + story_text: | + In level 5 you can make a choice with `{if}`. For example between different types of figures. + example_code: | + ``` + {print} 'Drawing Figures' + figure {is} {ask} 'Do you want a square or a triangle?' + {if} figure {is} triangle angle {is} 120 + {else} angle {is} 90 + {turn} angle + {forward} 25 + {turn} angle + {forward} 25 + {turn} angle + {forward} 25 + {turn} angle + {forward} 25 + ``` + story_text_2: | + ### Exercise + Fill in the correct numbers in this code to get it to work. + After you've done that, you can try to add the option backwards. + + **Extra** Instead of using 'left' and 'right', remake the program with North, East, South and West. + This way you could add even more directions like Northeast and Southwest etc. + example_code_2: | + ``` + direction {is} {ask} 'Do you want to go left, right, or straight ahead?' + {if} direction {is} left {turn} _ + {if} direction {is} right {turn} _ + {forward} 100 + ``` + start_code: |- + {print} 'Drawing Figures' + figure {is} {ask} 'Do you want a square or a triangle?' + {if} figure {is} triangle angle {is} 120 {else} angle {is} 90 + {turn} angle + {forward} 25 + 6: + story_text: | + In this level you can use calculations to draw different figures. + You may have learned in school that turning a full circle is 360 degrees. If not, now you know! + That's why you also use 90 degrees for a square. 360 divided by 4 is 90. + Now that we can do math with Hedy, we can draw all the figures we want! + example_code: | + ``` + angles = {ask} 'How many angles do you want?' + angle = 360 / angles + {forward} 50 + {turn} angle + {forward} 50 + {turn} angle + {forward} 50 + {turn} angle + {forward} 50 + {turn} angle + {forward} 50 + {turn} angle + {forward} 50 + {turn} angle + ``` + start_code: '{print} ''Drawing figures''' + 8: + story_text: "Now that we can repeat several lines, we can make figures more easily.\nWe only have to set the angle once and then use that variable in the `{repeat}`.\n\n### Exercise 1\nThe example code creates a square. Change the code so that it create another figure, such as a triangle\ + \ or a hexagon. \nThis requires a change to two lines of code.\nTip: An entire circle is 360 degrees.\n\n### Exercise 2\nNow create a drawing consisting of at least two polygons.\n" + example_code: | + ``` + angle = 90 + {repeat} 4 {times} + {turn} angle + {forward} 50 + ``` + story_text_2: | + **Extra** We can now improve the program that draws different figures. Finish the code and you can draw any polygon you'd like! + example_code_2: | + ``` + figure = {ask} 'How many angles should I draw?' + angle = 360 / figure + {repeat} figure {times} + {turn} _ + {forward} _ + ``` + start_code: figure = {ask} 'How many angles should I draw?' 9: - example_code: "```\npoints = 0\nletters = a, b, c, d, e\n{repeat} 10 {times}\n letter = _ _ _\n {print} 'Press the letter ' letter\n {if} letter {is} {pressed}\n _\n _\n _\n```\n" - story_text: "Now that you know how to combine statements, you can create a touch type tool with `{pressed}`.\n\n### Exercise\nFinish the code. Each time a random letter should be chosen, which you have to press. You get a point for a correct press, and and two points deduction for a wrong press.\n**Extra** Clear the screen after each letter, and show the user how many points they have scored.\n" + story_text: | + Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures. + + ### Exercise 1 + This code creates three black triangles, change that into five pink squares. + + **Extra** Create a figure of your own choosing consisting of at least two different shapes types. + example_code: | + ``` + {color} {black} + {repeat} 3 {times} + {repeat} 3 {times} + {forward} 10 + {turn} 120 + {color} {white} + {forward} 50 + {color} {black} + ``` start_code: '# place your code here' - default_save_name: Pressed - description: Try linking a keyboard key to a command! - is_command: - levels: - 2: - story_text: "## Variables\nYou 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:\n" - example_code_2: "```\nfavorite_animals {is} _\n{print} I like favorite_animals\n```\n" - story_text_2: "### Exercise\nTime to make your own variables!\nIn the example code we made an example of the variable `favorite_animals`. In line 1 the variable is set, and in line 2 we used the variable in a `{print}` command.\nFirstly, finish our example by filling in your favorite animal in the blanks. 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.\n" - example_code: "```\nname {is} Hedy\nage {is} 15\n{print} name is age years old\n```\n" - start_code: "name {is} Hedy\nage {is} 15\n{print} name is age years old" - 6: - story_text: "We also make a change in storing a word in a variable! You may now use `=` instead of `{is}` when we store a name or a number in a variable, like this:\n" - example_code: "```\nname = Hedy\nanswer = 20 + 4\n```\n" - start_code: "name = Hedy\nanswer = 20 + 4\n" - 14: - story_text_3: "You can also compare if something is *not* equal to something else using `!=` like this:\n" - example_code_2: "```\nname = {ask} 'What is your name?'\n{if} name == 'Hedy'\n {print} 'You are cool!'\n```\n" - story_text: "We are going to learn more new items. You might know them already from mathematics, the `<` and `>`.\nThe `<` checks if the first number is smaller than the second, for example age `<` 12 checks if age is smaller than 12.\nIf you want to check if the first number is smaller or equal to the second, you can use `<=`, for example age `<=` 11.\nThe `>` checks if the first number is bigger than the second, for example points `>` 10 checks if points is larger than 10.\nIf you want to check if the first number is bigger or equal to the second, you can use `>=`, for example points `>=` 11.\nYou use these comparisons in an `{if}`, like this:\n" - example_code_3: "```\nname = {ask} 'What is your name?'\n{if} name != 'Hedy'\n {print} 'You are not Hedy'\n```\n" - start_code: "age = {ask} 'How old are you?'\n{if} age < 13\n {print} 'You are younger than me!'\n{else}\n {print} 'You are older than me!'" - example_code: "```\nage = {ask} 'How old are you?'\n{if} age > 12\n {print} 'You are older than I am!'\n```\n" - story_text_2: "From this level on, if you want to compare exactly, you can use two equal signs. This is what most programming languages do:\n" - default_save_name: is_command - description: introducing is command - name: '{is}' - sleep_command: - levels: - 2: - example_code: "```\n{print} My favorite colour is...\n{sleep} 2\n{print} green!\n```\n" - story_text: "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.\n\n### Exercise\nPractise 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.\n" - start_code: "{print} My favorite colour is...\n{sleep} 2\n{print} green!" - name: '{sleep}' - description: introducing sleep command - default_save_name: sleep_command - rock_2: - levels: - 2: - example_code: "```\nchoice {is} _\n{print} I choose choice\n```\n" - story_text: "Now that you have learned how to use the `{ask}` command, you can make your rock, paper, scissors code interactive too!\n\n### Exercise\nMake the rock, paper, scissors code interactive by adding the `{ask}` command and a question to your rock, paper, scissors code.\n" + 10: + story_text: | + In this level you can make the turtle draw a figure. + The turtle will travel the distances in the list, one by one, making bigger and bigger steps. + ### Exercise 1 + Add a 90 degree turn in the loop, so that a spiral is drawn. + Add at least 5 numbers to the list, so the spiral grows larger. + **(extra)** can you change the spiral into another shape? Experiment with numbers for the turn! + ### Exercise 2 + The spiral is drawn outwards, make it go inwards? + example_code: | + ``` + {turn} 90 + distances = 10, 20, 30, 40, 50, 60 + {for} distance {in} distances + {forward} distance + ``` + ``` start_code: '# place your code here' - description: Part 2 of rock, paper, scissors - name: Rock, paper, scissors 2 - default_save_name: rock_2 - repeat_command: - levels: - 9: - story_text: "In this level you can not only use multiple lines with `{if}` and `{repeat}`, but you can also put them together!\nIn the example you see an `{if}` command within a `{repeat}` command. It is also allowed the other way around, and an `{if}` is also allowed in an `{if}` and a `{repeat}` in a `{repeat}`.\nGive it a try!\n" - example_code: "```\n{repeat} 3 {times}\n food = {ask} 'What do you want?'\n {if} food {is} pizza\n {print} 'nice!'\n {else}\n {print} 'pizza is better'\n```\n" - start_code: "{repeat} 3 {times}\n food = {ask} 'What do you want?'\n {if} food {is} pizza\n {print} 'nice!'\n {else}\n {print} 'pizza is better'" - 7: - example_code: "```\n{repeat} 3 {times} {print} 'Hedy is fun!'\n```\n" - story_text: "## Repeat! Repeat! Repeat!\nLevel 7 adds the `{repeat}` command. `{repeat}` can be used to execute one line of code multiple times. Like this:\n\n### Exercise\nPlay around with the repeat command. Can you make the happy birthday song in only 3 lines of code instead of 4 now?\n" - start_code: "{print} 'happy birthday to you'\n{print} 'happy birthday to you'\n{print} 'happy birthday dear Hedy'\n{print} 'happy birthday to you'\n" - 8: - start_code: "{repeat} 5 {times}\n {print} 'Hello everyone'\n {print} 'This will be printed 5 times'" - example_code: "```\n{repeat} 5 {times}\n {print} 'Hello everyone'\n {print} 'This is all repeated 5 times'\n```\n" - story_text: "### Repeat commands and indentation\nIn this level you can repeat multiple lines of code with only 1 repeat command.\nYou do this by making a block of lines that you want to repeat.\nThe lines in this block will need **indentation** .\nThat means putting four spaces at the beginning of each line. You will also have to indent when you just want to create a block of one line.\n" - description: repeat command - name: '{repeat}' - default_save_name: repeat_command - maths: - name: maths - levels: - 6: - start_code: "{print} '5 plus 5 is ' 5 + 5\n{print} '5 minus 5 is ' 5 - 5\n{print} '5 times 5 is ' 5 * 5\n{print} '5 devided by 5 is ' 5 / 5\n" - story_text: "## 1 + 1\nIn this level you learn something new: you can now also calculate.\n\nThe plus is easy, you write it like with math: `5 + 5` for example. The minus also works fine, it is `5 - 5`.\n\nThe times is a bit different, because there is no times symbol on your keyboard. Just search, there really isn't!\nThat is why we multiply with the asterisk above 8: `5 * 5`. Read that as \"5 times 5\" that helps you remember it best.\n" - example_code: "```\n{print} '5 plus 5 is ' 5 + 5\n{print} '5 minus 5 is ' 5 - 5\n{print} '5 times 5 is ' 5 * 5\n{print} '5 devided by 5 is ' 5 / 5\n```\n" 12: - story_text_2: "**Maths with words**\nIn this level you can also do addition with words like this:" - example_code_2: "```\na = 'Hello '\nb = 'world!'\n{print} a + b\n```\n" - story_text: "**Decimal numbers**\nSo far, Hedy did not allow for decimal numbers like 1.5, but now we do allow that. Note that computers use the `.` for decimal numbers." - example_code: "```\n{print} 'Two and a half plus two and a half is...'\n{print} 2.5 + 2.5\n```\n" - start_code: "{print} 'decimal numbers now need to use a dot'\n{print} 2.5 + 2.5" - default_save_name: maths - description: Introducing maths - calculator_2: - levels: - 14: - story_text: "### Exercise 2\n**This is the second part of this adventure.** The adventure starts in the previous tab.\nOf course, you don't always want to calculate the mean of 4 tests. You might want to calculate the mean of 10 tests or only 2...\nWe can fix this problem by adding the argument and variable 'amount_of_tests'.\n* Start a new line on line 3. Set the amount_of_tests argument by asking the student how many tests they have made.\n* Change the 4 in line 4 to the new argument amount_of_tests.\n* Lastly, change the 4 in line 6 to amount_of_tests\n\nTry out your new program. Does it work?\n\n### Exercise 3\nDid you want to make your program even better? Great! In the previous program you could only calculate the mean grade of 1 subject, but it would be better if you could calculate the mean grade for all subjects you want!\nWe won't tell you how to do it, but we will give you one tip: Start your code in line 1 with: define calculate_mean_grade with subject.\n" - start_code: "# Use your own code from the previous adventure.\n" - example_code: "```\n# Use your own code from the previous adventure.\n```\n" - name: Calculator 2 - default_save_name: Calculator 2 - description: Calculator 2 - repeat_command_2: - levels: - 8: - start_code: "{repeat} 3 {times}\n {print} 'This line will be repeated...'\n {print} 'This one too...'\n{print} 'but this one will not!'" - example_code: "```\n_ {print} 'Do you know the muffin man?'\n_ {repeat} 2 {times}\n_ {print} 'The muffin man'\n_ {print} 'Do you know the muffin man, who lives on Drury Lane?'\n```\n" - story_text: "### In the block or not?\nIn this level you have to think carefully which lines of code should be in the block and which shouldn't.\nFor example: If you want to sing the song *the muffin man*. You only want the line with 'the muffin man' to be repeated twice.\nThis means the last line shouldn't start with indentation as it doesn't belong to the block.\nIf you do start the last line with indentation the song will turn out wrong.\n\n### Exercise\nEach line in the example code starts with a blank. Remove the blanks and try to figure out which line need indentation and which don't to make the muffin man song.\n" - 7: - story_text_2: "Another interesting thing you can do with the `{repeat}` command is using variables to set the amount of times something should be repeated. In the example code you can see that we first ask the person how old they are.\nThen, in line 3, the question is repeated 'age' times. So we have used the variable 'age' with the `{repeat}` command.\n" - example_code_2: "```\n{print} 'Yay! It is your birthday!'\nage = {ask} 'How old are you now?'\n{repeat} age {times} {print} 'Hip Hip Hurray!'\n```\n" - story_text: "## Repeat with other commands and with variables\nYou have practiced the `{repeat}` command in combination with the `{print}` command now, but did you know you could also use other commands with `{repeat}` ?\nIn this example code you can see that `{repeat}` can also be used with an `{ask}`, `{if}` or `{else}` command.\n" - example_code: "```\n{repeat} 2 {times} answer = {ask} 'Did you know you could ask a question multiple times?'\n{if} answer {is} yes {repeat} 2 {times} {print} 'You knew that already!'\n{else} {repeat} 3 {times} {print} 'You have learned something new!'\n```\n" - start_code: "{repeat} 2 {times} answer = {ask} 'Did you know you could ask a question multiple times?'\n{if} answer {is} yes {repeat} 2 {times} {print} 'You knew that already!'\n{else} {repeat} 3 {times} {print} 'You have learned something new!'" - name: '{repeat} 2' - default_save_name: repeat_command_2 - description: repeat command 2 - in_command: - levels: - 5: - example_code_2: "```\nanimals {is} dog, cow, sheep\nanswer {is} {ask} 'What is your favorite animal?'\n_ answer _ animals _ 'Mine too!'\n_ _ 'My favorite animals are dogs, cows and sheep'\n```\n" - story_text: "## Lists\nWhen we want to check if something is in a list, we can now use the `{in}` command.\nThis code prints pretty! if you choose green or yellow, and meh otherwise.\n" - start_code: "pretty_colors {is} green, yellow\nfavorite_color {is} {ask} 'What is your favorite color?'\n{if} favorite_color {in} pretty_colors {print} 'pretty!'\n{else} {print} 'meh'" - example_code: "```\npretty_colors {is} green, yellow\nfavorite_color {is} {ask} 'What is your favorite color?'\n{if} favorite_color {in} pretty_colors {print} 'pretty!'\n{else} {print} 'meh'\n```\n" - story_text_2: "### Exercise\nFinish the example code by filling in the blanks with commands that you've learned.\nWhen you've finished the code, try to create a code of your own and use a question that you've thought of yourself.\n" - description: Introducing the in command - name: '{in}' - default_save_name: in_command - if_command: + story_text: | + We can use functions to draw more complex figures with less code. + ### Exercise 1 + Fill the function so that three squares are created. If you want the image to look nicer, you can make the lines between the squares white. + + ### Exercise 2 + The code can be made even shorter. Place the final lines into a `{repeat}` so the figure remains the same. + + ### Exercise 3 + Create your own drawing with different figures. + Change both the number of figures with the `{repeat}` and the shape of the figures in the `{define}` + example_code: | + ``` + {define} square + {repeat} 4 {times} + {turn} _ + {forward} _ + {call} square + {forward} 50 + {call} square + {forward} 50 + {call} square + ``` + start_code: | + {define} square + {repeat} 4 {times} + {turn} _ + {forward} _ + {call} square + {forward} 50 + {call} square + {forward} 50 + {call} square + while_command: + name: '{while}' + default_save_name: while_command + description: while levels: - 5: - story_text: "## If... else....\nIn level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options.\nThis code prints nice if you enter Hedy as a name, and boo! if you enter something else.\n`{ask}` and `{print}` still work like they did in level 4.\n" - example_code_3: "```\nanswer {is} {ask} '2 + 2 = ?'\n_ _ _ 4 _ 'Great job!'\n_ _ 'No 2 + 2 = 4'\n```\n" - story_text_2: "Sometimes code with an `{if}` gets really long and does not fit on the line well.
You may also divide the code over two lines, starting the second line at the `{else}` like this:\n" - start_code: "name {is} {ask} 'what is your name?'\n{if} name {is} Hedy {print} 'nice'\n{else} {print} 'boo!'" - example_code: "```\nname {is} {ask} 'what is your name?'\n{if} name {is} Hedy {print} 'nice' {else} {print} 'boo!'\n```\n" - story_text_3: "### Exercise\nTry to create your own code with `{if}` and `{else}`. You can use the example code if you want.\n" - example_code_2: "```\nname {is} {ask} 'what is your name?'\n{if} name {is} Hedy {print} 'nice'\n{else} {print} 'boo!'\n```\n" - 9: - start_code: "continue = {ask} 'Do you want to continue?'\n{if} continue = yes\n sure = {ask} 'Are you sure?'\n {if} sure {is} yes\n {print} 'We will continue'\n {else}\n {print} 'You are not sure'\n{else}\n {print} 'You do not want to continue'\n" - story_text: "In this level you can also put an {if} command inside another {if} command.\n" - example_code: "```\ncontinue = {ask} 'Do you want to continue?'\n{if} continue = yes\n sure = {ask} 'Are you sure?'\n {if} sure {is} yes\n {print} 'We will continue'\n {else}\n {print} 'You are not sure'\n{else}\n {print} 'You do not want to continue'\n```\n" - 8: - start_code: "name = {ask} 'What is your name?'\n{if} name {is} Hedy\n {print} 'Welcome Hedy'\n {print} 'You can play on your computer!'\n" - story_text: "## If... Else...\nYou have learned to repeat a block of lines of code after a `{repeat}` command.\nNow you can also use indentation to make blocks after a {if} or {else} command.\nCheck out the example code.\n\n### Exercise\nAdd an {else} command to the example code. Make a block of line using indentation. You do this by starting each line with 4 spaces.\n" - example_code: "```\nname = {ask} 'What is your name?'\n{if} name {is} Hedy\n {print} 'Welcome Hedy'\n {print} 'You can play on your computer!'\n```\n" - name: '{if} & {else}' - default_save_name: if_command - description: Introducing the if command + 15: + story_text: |- + We are going to learn a new loop, the `{while}` loop! We continue the loop as long as the statement is true. + So don't forget to change the value in the loop. + + In the example code, we continue until a correct answer has been given. + If the correct answer is never given, the loop never ends! + example_code: | + ``` + answer = 0 + {while} answer != 25 + answer = {ask} 'What is 5 times 5?' + {print} 'A correct answer has been given' + ``` + start_code: |- + answer = 0 + {while} answer != 25 + answer = {ask} 'What is 5 times 5?' + {print} 'A correct answer has been given' years: + name: New Year's default_save_name: New Year's Countdown - levels: - 11: - start_code: '# place your code here' - example_code: "```\n{for} number {in} {range} _ {to} _\n {print} number\n{print} 'Happy New Year!'\n```\n" - story_text: "In this level you can use the `{for}` number `{in}` `{range}` command to countdown to the New Year.\n\n### Exercise\nFill in the blanks and make the code work!\n" description: Countdown to the New Year! - name: New Year's - guess_my_number: - description: guess my number - levels: - 14: - start_code: '# place your code here' - example_code: "```\n{print} 'Guess my number'\nnumbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\nnumber = numbers {at} {random}\ngame = 'on'\n{for} i {in} {range} 1 {to} 10\n {if} game == 'on'\n guess = {ask} 'Which number do you think it is?'\n {if} guess _ number\n {print} 'Lower!'\n {if} guess _ number\n {print} 'Higher!'\n {if} guess _ number\n {print} 'You win!'\n game = 'over'\n```\n" - story_text: "In this level you can program the game 'Guess my number'\n\n### Exercise\nFill in the correct symbols on the blanks to get the game to work.\n" - name: Guess my number - default_save_name: guess my number - quizmaster: levels: - 14: - story_text: "### Exercise\nIn this adventure you can make your own quiz! Fill in the blanks, add more questions and enjoy your own quiz!\nYou can make a quiz about anything you like: your hobby, your favorite animal, your favorite book or anything at all!\n" - example_code: "```\n{print} 'Make your own quiz'\npoints_a = 0\npoints_b = 0\n{print} 'Question'\n{print} 'Answer option A'\n{print} 'Answer option B'\nanswer = {ask} 'Which answer?'\n{if} answer == 'A'\n points_a = points_a + 1\n{if} answer == 'B'\n points_b = points_b + 1\n{print} 'End of the quiz!'\n{print} 'Lets see the results!'\n{if} points_a > points_b\n {print} 'You belong to the A club'\n{if} points_b > points_a\n {print} 'You belong to the B club'\n```\n" + 11: + story_text: | + In this level you can use the `{for}` number `{in}` `{range}` command to countdown to the New Year. + + ### Exercise + Fill in the blanks and make the code work! + example_code: | + ``` + {for} number {in} {range} _ {to} _ + {print} number + {print} 'Happy New Year!' + ``` start_code: '# place your code here' - name: Quizmaster - default_save_name: Quizmaster - description: Make your own quiz! diff --git a/content/adventures/tr.yaml b/content/adventures/tr.yaml index ba41db84965..28dca0cb813 100644 --- a/content/adventures/tr.yaml +++ b/content/adventures/tr.yaml @@ -1444,35 +1444,35 @@ adventures: print 'Thanks for ordering!' ``` - start_code: |2 + start_code: |4 - define food_order - toppings = ask 'pepperoni, tuna, veggie or cheese?' - size = ask 'big, medium or small?' - number_of_pizza = ask 'How many these pizzas would you like?' + define food_order + toppings = ask 'pepperoni, tuna, veggie or cheese?' + size = ask 'big, medium or small?' + number_of_pizza = ask 'How many these pizzas would you like?' - print 'YOU ORDERED' - print number_of_pizzas ' size ' topping ' pizza' + print 'YOU ORDERED' + print number_of_pizzas ' size ' topping ' pizza' - define drinks_order - drink = ask 'water, coke, icetea, lemonade or coffee?' - number_of_drinks = ask 'How many of these drinks would you like?' + define drinks_order + drink = ask 'water, coke, icetea, lemonade or coffee?' + number_of_drinks = ask 'How many of these drinks would you like?' - print 'YOU ORDERED' - print number_of_drinks ' ' drink + print 'YOU ORDERED' + print number_of_drinks ' ' drink - 'Welcome to Hedy pizza' - more_food = ask 'Would you like to order a pizza?' - while more_food = 'yes' - return food_order - more_food = ask 'Would you like to order a pizza?' - more_drinks = ask 'Would you like to order some drinks?' - while more_drinks == 'yes' - call drink_order - more_drinks == ask 'Would you like to order more drinks?' + 'Welcome to Hedy pizza' + more_food = ask 'Would you like to order a pizza?' + while more_food = 'yes' + return food_order + more_food = ask 'Would you like to order a pizza?' + more_drinks = ask 'Would you like to order some drinks?' + while more_drinks == 'yes' + call drink_order + more_drinks == ask 'Would you like to order more drinks?' - print 'Thanks for ordering!' + print 'Thanks for ordering!' 18: story_text: |- ### Exercise @@ -1495,22 +1495,22 @@ adventures: print 'there a ' sound print 'everywhere a ' sound sound ``` - start_code: |2 - - animals = ['pig', 'dog', 'cow'] - sounds = ['oink', 'woof', 'moo'] - for i in range 1 to 3 - animal = animals[i] - sound = sounds[i] - print 'Old McDonald had a farm' - print 'E I E I O!' - print 'and on that farm he had a ' animal - print 'E I E I O!' - print 'with a ' sound sound ' here' - print 'and a ' sound sound ' there' - print 'here a ' sound - print 'there a ' sound - print 'everywhere a ' sound sound + start_code: |4 + + animals = ['pig', 'dog', 'cow'] + sounds = ['oink', 'woof', 'moo'] + for i in range 1 to 3 + animal = animals[i] + sound = sounds[i] + print 'Old McDonald had a farm' + print 'E I E I O!' + print 'and on that farm he had a ' animal + print 'E I E I O!' + print 'with a ' sound sound ' here' + print 'and a ' sound sound ' there' + print 'here a ' sound + print 'there a ' sound + print 'everywhere a ' sound sound default: name: Giriş default_save_name: giriş diff --git a/content/adventures/zh_Hans.yaml b/content/adventures/zh_Hans.yaml index b953be30eb6..eca024df34e 100644 --- a/content/adventures/zh_Hans.yaml +++ b/content/adventures/zh_Hans.yaml @@ -89,7 +89,7 @@ adventures: start_code: '{print} 你的故事' 4: story_text: "你可能注意到了,在之前的级别里还有个问题。你有没有试过打印含有“名字”这个词的句子?即:`{print}` 我的名字是名字。\n 在这一级里你可以解决这个问题。你必须给所有需要打印的东西加上引号。\n\n### 练习1\n复制示例代码并通过添加引号来使其正常工作。 \n\n ### 练习 2 \n返回到上一个级别并复制故事代码。通过在正确的位置添加引号,使代码在此级别中正常工作。 \n注意:你自己故事中的变量应该在引号之外。就像范例代码的第二行一样。在该行中,变量名称放在引号之外。\n" - example_code: "```\n名字 {is} {ask}_你的名字是什么? _\n{print} _ 主人公的名字是_名字 \n {print} 名字 _正准备走进树林_\n{print} 名字 _有点害怕'\n动物们 {is} 🦔, 🐿, 🦉, 🦇\n{print} _他听到了一个_ 动物们{at} {random} 的声音\n{print} 名字_担心这片森林闹鬼_\n```\n" + example_code: "```\n名字 {is} {ask}_你的名字是什么? _\n{print} _ 主人公的名字是_名字 \n {print} 名字 _正准备走进树林_\n{print} 名字 _有点害怕'\n动物们 {is} \U0001F994, \U0001F43F, \U0001F989, \U0001F987\n{print} _他听到了一个_ 动物们{at} {random} 的声音\n{print} 名字_担心这片森林闹鬼_\n```\n" start_code: '{print} ''你的故事会打印在这里!''' 5: story_text: | @@ -1376,35 +1376,35 @@ adventures: print 'Thanks for ordering!' ``` - start_code: |2 + start_code: |4 - define food_order - toppings = ask 'pepperoni, tuna, veggie or cheese?' - size = ask 'big, medium or small?' - number_of_pizza = ask 'How many these pizzas would you like?' + define food_order + toppings = ask 'pepperoni, tuna, veggie or cheese?' + size = ask 'big, medium or small?' + number_of_pizza = ask 'How many these pizzas would you like?' - print 'YOU ORDERED' - print number_of_pizzas ' size ' topping ' pizza' + print 'YOU ORDERED' + print number_of_pizzas ' size ' topping ' pizza' - define drinks_order - drink = ask 'water, coke, icetea, lemonade or coffee?' - number_of_drinks = ask 'How many of these drinks would you like?' + define drinks_order + drink = ask 'water, coke, icetea, lemonade or coffee?' + number_of_drinks = ask 'How many of these drinks would you like?' - print 'YOU ORDERED' - print number_of_drinks ' ' drink + print 'YOU ORDERED' + print number_of_drinks ' ' drink - 'Welcome to Hedy pizza' - more_food = ask 'Would you like to order a pizza?' - while more_food = 'yes' - return food_order - more_food = ask 'Would you like to order a pizza?' - more_drinks = ask 'Would you like to order some drinks?' - while more_drinks == 'yes' - call drink_order - more_drinks == ask 'Would you like to order more drinks?' + 'Welcome to Hedy pizza' + more_food = ask 'Would you like to order a pizza?' + while more_food = 'yes' + return food_order + more_food = ask 'Would you like to order a pizza?' + more_drinks = ask 'Would you like to order some drinks?' + while more_drinks == 'yes' + call drink_order + more_drinks == ask 'Would you like to order more drinks?' - print 'Thanks for ordering!' + print 'Thanks for ordering!' 18: story_text: |- ### Exercise @@ -1427,22 +1427,22 @@ adventures: print 'there a ' sound print 'everywhere a ' sound sound ``` - start_code: |2 - - animals = ['pig', 'dog', 'cow'] - sounds = ['oink', 'woof', 'moo'] - for i in range 1 to 3 - animal = animals[i] - sound = sounds[i] - print 'Old McDonald had a farm' - print 'E I E I O!' - print 'and on that farm he had a ' animal - print 'E I E I O!' - print 'with a ' sound sound ' here' - print 'and a ' sound sound ' there' - print 'here a ' sound - print 'there a ' sound - print 'everywhere a ' sound sound + start_code: |4 + + animals = ['pig', 'dog', 'cow'] + sounds = ['oink', 'woof', 'moo'] + for i in range 1 to 3 + animal = animals[i] + sound = sounds[i] + print 'Old McDonald had a farm' + print 'E I E I O!' + print 'and on that farm he had a ' animal + print 'E I E I O!' + print 'with a ' sound sound ' here' + print 'and a ' sound sound ' there' + print 'here a ' sound + print 'there a ' sound + print 'everywhere a ' sound sound default: name: 介绍 default_save_name: 介绍 @@ -2058,7 +2058,7 @@ adventures: 在本级中,你将学会在使用算命仙时,(秘密地)使结果对你有利! 通过使用`{if}` 和`{else}` ,你可以确保你总是能得到好运,而其他人可能得不到。 看看这个例子就知道了。 - example_code: "```\n{print} '我是海蒂算命仙!'\n{print} '我可以预测你明天是否会中彩票!'\n人 {is} {ask} '你是谁?'\n{if} 人 {is} 海蒂 {print} '你肯定会中奖!🤩' {else} {print} '你运气不好!别人会中奖!😭' \n```\n" + example_code: "```\n{print} '我是海蒂算命仙!'\n{print} '我可以预测你明天是否会中彩票!'\n人 {is} {ask} '你是谁?'\n{if} 人 {is} 海蒂 {print} '你肯定会中奖!\U0001F929' {else} {print} '你运气不好!别人会中奖!\U0001F62D' \n```\n" start_code: '# 在这里写下你的代码' 6: story_text: | diff --git a/content/cheatsheets/mi.yaml b/content/cheatsheets/mi.yaml index dc26fbf09b5..4618f42c21a 100644 --- a/content/cheatsheets/mi.yaml +++ b/content/cheatsheets/mi.yaml @@ -1,207 +1,367 @@ -13: -- explanation: Two parts both need to be correct. - demo_code: "answer1 = {ask} 'What is 3+2?'\nanswer2 = {ask} 'What is 2+2?'\n{if} answer1 {is} 5 {and} answer2 {is} 4\n {print} 'Both answers are correct!'\n{else}\n {print} 'At least one answer is wrong!'" - name: '{and}' -- demo_code: "answer1 = {ask} 'What is 3+2?'\nanswer2 = {ask} 'What is 2+2?'\n{if} answer1 {is} 5 {or} answer2 {is} 4\n {print} 'At least one answer is correct!'\n{else}\n {print} 'Both answers are wrong!'" - name: '{or}' - explanation: At least 1 of the two parts need to be correct. If both are correct, it is also fine. -4: -- explanation: Print exactly using quotation marks. - name: '{print}' - demo_code: "{print} 'Hello welcome to Hedy.'" -- demo_code: "name {is} Hedy\n{print} 'my name is ' name" - name: '{is}' - explanation: Give a name to some text and `{print}` without quotation marks. -- explanation: Ask something with `{ask}`. - demo_code: "color {is} {ask} 'What is your favorite color?'\n{print} color ' is your favorite!'" - name: '{ask}' -5: -- explanation: Print exactly using quotation marks. - name: '{print}' - demo_code: "{print} 'Hello welcome to Hedy.'" -- name: '{ask}' - demo_code: "color {is} {ask} 'What is your favorite color?'\n{print} color ' is your favorite!'" - explanation: Ask something with `{ask}`. -- demo_code: "color {is} {ask} 'What is your favorite color?'\n{if} color {is} green {print} 'pretty!' {else} {print} 'meh'" - explanation: Make a choice with `{if}`. - name: '{if}' -- name: '{if} with turtle' - explanation: Make a choice with `{if}`. - demo_code: "answer {is} {ask} 'How far should I walk?'\n{if} answer {is} far {forward} 100 {else} {forward} 5" -- demo_code: "pretty_colors {is} green, yellow\ncolor {is} {ask} 'What is your favorite color?'\n{if} color {in} pretty_colors {print} 'pretty!' {else} {print} 'meh'" - explanation: Check elements with `{in}`. - name: '{in}' -- demo_code: "{if} a {is} {pressed} {print} 'You pressed A!' {else} {print} 'You pressed another key!'" - explanation: Check whether a given key on the keyboard is `{pressed}`. - name: '{pressed}' -2: -- name: '{is}' - demo_code: "name {is} Hedy\n{print} welcome name" - explanation: Give a word a name to use in the program using `{is}`. You can choose the name yourself. -- demo_code: "color {is} {ask} What is your favorite color?\n{print} color is your favorite!" - name: '{ask}' - explanation: Ask something with `{ask}`. Beware! You need to give the answer a name with `{is}`. -- demo_code: "{print} Let me think for one second...\n{sleep}\n{print} Hmm.. I need 3 more seconds...\n{sleep} 3\n{print} Eureka! Ive got it!" - explanation: With `{sleep}`, you can let Hedy pause for a (couple of) second(s). - name: '{sleep}' -- demo_code: "angle {is} 90\n{turn} angle\n{forward} 100" - explanation: Give a number a name using `{is}`. You can choose the name yourself. - name: '{is} with turtle' -18: -- explanation: After `{print}` you need to use parentheses. - demo_code: "{print}('hi!')" - name: '{print}' -- name: '{range}' - explanation: After `{range}` you need to use parentheses. - demo_code: "{for} i {in} {range} (1,10):\n {print}('Hello, times ', i)" -- demo_code: "name = 'Hedy'\n{print}('my name is ', name)" - explanation: With `{print}` you need to use parentheses and commas if you print more items. - name: '{print} with var' -- explanation: Use `{input}` instead of `{ask}` to ask something. - name: ask something with {input} - demo_code: "name = {input}('What is your name?')\n{print}('So your name is ', name)" -14: -- explanation: We use the `<` to check if the first number is smaller than the second number. - demo_code: "age = {ask} 'How old are you?'\n{if} age < 13\n {print} 'You are younger than me!'" - name: Smaller -- demo_code: "age = {ask} 'How old are you?'\n{if} age > 13\n {print} 'You are older than me!'" - name: Bigger - explanation: We use the `>` to check if the first number is bigger than the second number. -- demo_code: "answer = {ask} 'What is 5 * 5?'\n{if} answer == 25\n {print} 'That is correct!'" - name: Equal - explanation: We use the `==` to check if two things are the same. -- explanation: We use the `!=` to check if two things are not the same. - name: Not equal - demo_code: "answer = {ask} 'What is 5 * 5?'\n{if} answer != 25\n {print} 'That is not correct!'" -- demo_code: "age = {ask} 'How old are you?'\n{if} age <= 12\n {print} 'You are younger than me!'" - name: Smaller or equal - explanation: We use the `<=` to check if the first number is smaller than or equal to the second number. -- demo_code: "age = {ask} 'How old are you?'\n{if} age >= 14\n {print} 'You are older than me!'" - explanation: We use the `>=` to check if the first number is bigger than or equal to the second number. - name: Bigger or equal -16: -- name: square brackets - explanation: Lists with square brackets. - demo_code: "fruit = ['apple', 'banana', 'cherry']\n{print} fruit" -- name: Get an item from a list - explanation: To get an item from a list we use [number] so fruit[1] means, get the first fruit from the list! - demo_code: "fruit = ['banana', 'apple', 'cherry']\nfirstfruit = fruit[1]\n{print} firstfruit" -- name: Get a random item from a list - explanation: To get a random item from a list we use [{random}] so fruit[{random}] means, get a random fruit from the list! - demo_code: "fruit = ['banana', 'apple', 'cherry']\nrandom_fruit = fruit[{random}]\n{print} random_fruit" -9: -- name: '{if} with multiple lines' - demo_code: "answer = {ask} 'What is 10 plus 10?'\n{if} answer {is} 20\n {print} 'Well done!!'\n {print} 'The answer is indeed' answer\n{else}\n {print} 'Wrong'\n {print} 'The answer is 20'" - explanation: The answer of a sum of questions with `{ask}` and see if it is correct. Now we print out two lines. -- explanation: Repeat multiple lines. - name: '{repeat} with turtle' - demo_code: "{repeat} 4 {times}\n {turn} 90\n {forward} 50" -12: -- explanation: Decimal numbers. - demo_code: "{print} 'Calculate away!'\n{print} 'Two and a half plus two and a half is...'\n{print} 2.5 + 2.5" - name: float directly -- demo_code: "name = 'Hedy the Robot'\n{print} 'Hello ' name" - explanation: Text with quotation marks after `=` - name: assign text -- explanation: Text with quotation marks after `{if}`. - name: quotes after `{if}` comparison - demo_code: "name = {ask} 'Who are you?'\n{if} name = 'Hedy'\n {print} 'Hi there!'" -- demo_code: "superheroes = 'Iron Man', 'Batman', 'Superman'\n{print} superheroes {at} {random}" - explanation: A list with quotation marks. - name: quotes in list 1: -- demo_code: '{print} Hello welcome to Hedy!' - name: '{print}' +- name: '{print}' explanation: Print something with `{print}`. + demo_code: '{print} Hello welcome to Hedy!' - name: '{ask}' - demo_code: '{ask} What is your favorite color?' explanation: Ask something with `{ask}`. -- demo_code: "{ask} What is your favorite color?\n{echo} so your favorite color is" - name: '{echo}' + demo_code: '{ask} What is your favorite color?' +- name: '{echo}' explanation: Repeat something using `{echo}`. + demo_code: |- + {ask} What is your favorite color? + {echo} so your favorite color is - name: '{print} emojis' - demo_code: '{print} 🙋 🌍 ❗' explanation: Print an emoji with `{print}`. -- demo_code: '{forward} 100' + demo_code: '{print} 🙋 🌍 ❗' +- name: '{forward}' explanation: Draw a line with `{forward}`. - name: '{forward}' -- demo_code: "{forward} 25\n{turn} {left}\n{forward} 25\n{turn} {right}" + demo_code: '{forward} 100' +- name: '{turn}' explanation: Turn the drawing turtle with `{turn}`. - name: '{turn}' -17: -- explanation: '`{elif}`' - demo_code: "a = 2\n{if} a == 1:\n {print} 'a is 1'\n{elif} a == 2:\n {print} 'a is 2'\n{else}:\n {print} 'a is not 1 or 2'" - name: '{elif}' -- name: '{print}' - demo_code: "{for} i {in} {range} 1 {to} 12:\n {print} i\n{print} 'Ready or not, here I come!'" - explanation: When we use a `{for}`, we need to put a `:` behind the `{for}` statement! -- explanation: We need to do the same with all of our `{if}` statements. - name: '{if}' - demo_code: "color = {ask} 'What is your favorite color?'\n{if} color == 'green':\n {print} 'Your favorite color is green'\n{else}:\n {print} 'Your favorite color is not green'" -8: -- name: '{print}' - explanation: Print something. Remember to use a quotation mark for literal printing. - demo_code: "{print} '5 times 5 is ' 5 * 5" + demo_code: |- + {forward} 25 + {turn} {left} + {forward} 25 + {turn} {right} +2: +- name: '{is}' + explanation: Give a word a name to use in the program using `{is}`. You can choose the name yourself. + demo_code: |- + name {is} Hedy + {print} welcome name - name: '{ask}' - demo_code: "answer = {ask} 'What is 5 plus 5?'\n{if} answer {is} 10\n {print} 'Well done!'\n {print} 'Indeed, the answer was ' answer\n{else}\n {print} 'Oops!'\n {print} 'The answer is 10'" - explanation: Ask for the answer to a sum and check if it is correct. We can now print 2 lines. -- explanation: Repeat multiple lines. - name: '{repeat} with turtle' - demo_code: "{repeat} 4 {times}\n {turn} 90\n {forward} 50" -- name: '{pressed}' - explanation: Check whether a given key on the keyboard is `{pressed}`. - demo_code: "{if} a {is} {pressed}\n {print} 'You pressed A!'\n{else}\n {print} 'You pressed another key!'" + explanation: Ask something with `{ask}`. Beware! You need to give the answer a name with `{is}`. + demo_code: |- + color {is} {ask} What is your favorite color? + {print} color is your favorite! +- name: '{sleep}' + explanation: With `{sleep}`, you can let Hedy pause for a (couple of) second(s). + demo_code: |- + {print} Let me think for one second... + {sleep} + {print} Hmm.. I need 3 more seconds... + {sleep} 3 + {print} Eureka! Ive got it! +- name: '{is} with turtle' + explanation: Give a number a name using `{is}`. You can choose the name yourself. + demo_code: |- + angle {is} 90 + {turn} angle + {forward} 100 3: - name: Choose random explanation: Choose a random word from a group with `{at}` and `{random}`. - demo_code: "animals {is} dog, cat, kangaroo\n{print} animals {at} {random}" -- demo_code: "animals {is} cow, cat\n{add} dog {to_list} animals" + demo_code: |- + animals {is} dog, cat, kangaroo + {print} animals {at} {random} +- name: '{add}' explanation: '`{add}` an item `{to_list}` a list.' - name: '{add}' -- explanation: '`{remove}` an item `{from}` a list.' - demo_code: "animals {is} cat, dog, cow\n{remove} dog {from} animals" - name: '{remove}' -15: -- demo_code: "answer = 0\n{while} answer != 25\n answer = {ask} 'What is 5 times 5?'\n{print} 'A correct answer has been given'" - explanation: We can use the `{while}` loop with not equal. - name: '{while}' -- name: Smaller {while} - demo_code: "count = 1\n{while} count < 3\n {print} 'We do this ' 3 - count ' more times'\n count = count + 1\n{print} 'We are done'" - explanation: We can also use the `{while}` loop with `<` and `>`. + demo_code: |- + animals {is} cow, cat + {add} dog {to_list} animals +- name: '{remove}' + explanation: '`{remove}` an item `{from}` a list.' + demo_code: |- + animals {is} cat, dog, cow + {remove} dog {from} animals +4: +- name: '{print}' + explanation: Print exactly using quotation marks. + demo_code: '{print} ''Hello welcome to Hedy.''' +- name: '{is}' + explanation: Give a name to some text and `{print}` without quotation marks. + demo_code: |- + name {is} Hedy + {print} 'my name is ' name +- name: '{ask}' + explanation: Ask something with `{ask}`. + demo_code: |- + color {is} {ask} 'What is your favorite color?' + {print} color ' is your favorite!' +5: +- name: '{print}' + explanation: Print exactly using quotation marks. + demo_code: '{print} ''Hello welcome to Hedy.''' +- name: '{ask}' + explanation: Ask something with `{ask}`. + demo_code: |- + color {is} {ask} 'What is your favorite color?' + {print} color ' is your favorite!' +- name: '{if}' + explanation: Make a choice with `{if}`. + demo_code: |- + color {is} {ask} 'What is your favorite color?' + {if} color {is} green {print} 'pretty!' {else} {print} 'meh' +- name: '{if} with turtle' + explanation: Make a choice with `{if}`. + demo_code: |- + answer {is} {ask} 'How far should I walk?' + {if} answer {is} far {forward} 100 {else} {forward} 5 +- name: '{in}' + explanation: Check elements with `{in}`. + demo_code: |- + pretty_colors {is} green, yellow + color {is} {ask} 'What is your favorite color?' + {if} color {in} pretty_colors {print} 'pretty!' {else} {print} 'meh' +- name: '{pressed}' + explanation: Check whether a given key on the keyboard is `{pressed}`. + demo_code: '{if} a {is} {pressed} {print} ''You pressed A!'' {else} {print} ''You pressed another key!''' 6: -- demo_code: "{print} '5 times 5 is ' 5 * 5" +- name: '{print}' explanation: Print exactly using quotation marks. - name: '{print}' + demo_code: '{print} ''5 times 5 is '' 5 * 5' - name: '{ask}' - demo_code: "answer = {ask} 'What is 10 plus 10?'\n{if} answer {is} 20 {print} 'Yes!' {else} {print} 'Oops'" explanation: Ask for a calculation and check whether it is correct. + demo_code: |- + answer = {ask} 'What is 10 plus 10?' + {if} answer {is} 20 {print} 'Yes!' {else} {print} 'Oops' - name: '`{ask}` and `{if}` with turtle' explanation: Ask the user how many angles they want. - demo_code: "angles = {ask} 'How many angles?'\nangle = 360 / angles\n{forward} 50" + demo_code: |- + angles = {ask} 'How many angles?' + angle = 360 / angles + {forward} 50 7: -- explanation: Print exactly using quotation marks. - name: '{print}' - demo_code: "{print} 'Hello welcome to Hedy.'" +- name: '{print}' + explanation: Print exactly using quotation marks. + demo_code: '{print} ''Hello welcome to Hedy.''' - name: '{ask}' explanation: Ask something with `{ask}`. - demo_code: "color = {ask} 'What is your favorite color?'\n{print} color ' is your favorite!'" -- explanation: Make a choice with `{if}`. - name: '{if}' - demo_code: "color = {ask} 'What is your favorite color?'\n{if} color {is} green {print} 'pretty!' {else} {print} 'meh'" -- demo_code: '{repeat} 3 {times} {forward} 10' + demo_code: |- + color = {ask} 'What is your favorite color?' + {print} color ' is your favorite!' +- name: '{if}' + explanation: Make a choice with `{if}`. + demo_code: |- + color = {ask} 'What is your favorite color?' + {if} color {is} green {print} 'pretty!' {else} {print} 'meh' +- name: '{repeat} with turtle' explanation: Repeat a line of code with `{repeat}`. - name: '{repeat} with turtle' + demo_code: '{repeat} 3 {times} {forward} 10' +8: +- name: '{print}' + explanation: Print something. Remember to use a quotation mark for literal printing. + demo_code: '{print} ''5 times 5 is '' 5 * 5' +- name: '{ask}' + explanation: Ask for the answer to a sum and check if it is correct. We can now print 2 lines. + demo_code: |- + answer = {ask} 'What is 5 plus 5?' + {if} answer {is} 10 + {print} 'Well done!' + {print} 'Indeed, the answer was ' answer + {else} + {print} 'Oops!' + {print} 'The answer is 10' +- name: '{repeat} with turtle' + explanation: Repeat multiple lines. + demo_code: |- + {repeat} 4 {times} + {turn} 90 + {forward} 50 +- name: '{pressed}' + explanation: Check whether a given key on the keyboard is `{pressed}`. + demo_code: |- + {if} a {is} {pressed} + {print} 'You pressed A!' + {else} + {print} 'You pressed another key!' +9: +- name: '{if} with multiple lines' + explanation: The answer of a sum of questions with `{ask}` and see if it is correct. Now we print out two lines. + demo_code: |- + answer = {ask} 'What is 10 plus 10?' + {if} answer {is} 20 + {print} 'Well done!!' + {print} 'The answer is indeed' answer + {else} + {print} 'Wrong' + {print} 'The answer is 20' +- name: '{repeat} with turtle' + explanation: Repeat multiple lines. + demo_code: |- + {repeat} 4 {times} + {turn} 90 + {forward} 50 10: - name: '{print}' - demo_code: "{print} '5 times 5 is ' 5 * 5" explanation: Print something. Remember to use a quotation mark for literal printing. -- explanation: Print all things in a list. - name: '{for} with a list' - demo_code: "animals {is} dog, cat, blobfish\n{for} animal {in} animals\n {print} 'I love ' animal" + demo_code: '{print} ''5 times 5 is '' 5 * 5' +- name: '{for} with a list' + explanation: Print all things in a list. + demo_code: |- + animals {is} dog, cat, blobfish + {for} animal {in} animals + {print} 'I love ' animal 11: -- demo_code: "{for} counter {in} {range} 1 {to} 5\n {print} counter" +- name: '{for} loop' explanation: We can use `{for}` with a `{range}`. - name: '{for} loop' + demo_code: |- + {for} counter {in} {range} 1 {to} 5 + {print} counter - name: '{ask}' - demo_code: "answer = {ask} 'What is 5 plus 5?'\n{if} answer {is} 10\n {print} 'Well done!'\n {print} 'Indeed, the answer was ' answer\n{else}\n {print} 'Oops!'\n {print} 'The answer is 10'" explanation: Ask for the answer to a sum and check if it is correct. We can now print 2 lines. + demo_code: |- + answer = {ask} 'What is 5 plus 5?' + {if} answer {is} 10 + {print} 'Well done!' + {print} 'Indeed, the answer was ' answer + {else} + {print} 'Oops!' + {print} 'The answer is 10' +12: +- name: float directly + explanation: Decimal numbers. + demo_code: |- + {print} 'Calculate away!' + {print} 'Two and a half plus two and a half is...' + {print} 2.5 + 2.5 +- name: assign text + explanation: Text with quotation marks after `=` + demo_code: |- + name = 'Hedy the Robot' + {print} 'Hello ' name +- name: quotes after `{if}` comparison + explanation: Text with quotation marks after `{if}`. + demo_code: |- + name = {ask} 'Who are you?' + {if} name = 'Hedy' + {print} 'Hi there!' +- name: quotes in list + explanation: A list with quotation marks. + demo_code: |- + superheroes = 'Iron Man', 'Batman', 'Superman' + {print} superheroes {at} {random} +13: +- name: '{and}' + explanation: Two parts both need to be correct. + demo_code: |- + answer1 = {ask} 'What is 3+2?' + answer2 = {ask} 'What is 2+2?' + {if} answer1 {is} 5 {and} answer2 {is} 4 + {print} 'Both answers are correct!' + {else} + {print} 'At least one answer is wrong!' +- name: '{or}' + explanation: At least 1 of the two parts need to be correct. If both are correct, it is also fine. + demo_code: |- + answer1 = {ask} 'What is 3+2?' + answer2 = {ask} 'What is 2+2?' + {if} answer1 {is} 5 {or} answer2 {is} 4 + {print} 'At least one answer is correct!' + {else} + {print} 'Both answers are wrong!' +14: +- name: Smaller + explanation: We use the `<` to check if the first number is smaller than the second number. + demo_code: |- + age = {ask} 'How old are you?' + {if} age < 13 + {print} 'You are younger than me!' +- name: Bigger + explanation: We use the `>` to check if the first number is bigger than the second number. + demo_code: |- + age = {ask} 'How old are you?' + {if} age > 13 + {print} 'You are older than me!' +- name: Equal + explanation: We use the `==` to check if two things are the same. + demo_code: |- + answer = {ask} 'What is 5 * 5?' + {if} answer == 25 + {print} 'That is correct!' +- name: Not equal + explanation: We use the `!=` to check if two things are not the same. + demo_code: |- + answer = {ask} 'What is 5 * 5?' + {if} answer != 25 + {print} 'That is not correct!' +- name: Smaller or equal + explanation: We use the `<=` to check if the first number is smaller than or equal to the second number. + demo_code: |- + age = {ask} 'How old are you?' + {if} age <= 12 + {print} 'You are younger than me!' +- name: Bigger or equal + explanation: We use the `>=` to check if the first number is bigger than or equal to the second number. + demo_code: |- + age = {ask} 'How old are you?' + {if} age >= 14 + {print} 'You are older than me!' +15: +- name: '{while}' + explanation: We can use the `{while}` loop with not equal. + demo_code: |- + answer = 0 + {while} answer != 25 + answer = {ask} 'What is 5 times 5?' + {print} 'A correct answer has been given' +- name: Smaller {while} + explanation: We can also use the `{while}` loop with `<` and `>`. + demo_code: |- + count = 1 + {while} count < 3 + {print} 'We do this ' 3 - count ' more times' + count = count + 1 + {print} 'We are done' +16: +- name: square brackets + explanation: Lists with square brackets. + demo_code: |- + fruit = ['apple', 'banana', 'cherry'] + {print} fruit +- name: Get an item from a list + explanation: To get an item from a list we use [number] so fruit[1] means, get the first fruit from the list! + demo_code: |- + fruit = ['banana', 'apple', 'cherry'] + firstfruit = fruit[1] + {print} firstfruit +- name: Get a random item from a list + explanation: To get a random item from a list we use [{random}] so fruit[{random}] means, get a random fruit from the list! + demo_code: |- + fruit = ['banana', 'apple', 'cherry'] + random_fruit = fruit[{random}] + {print} random_fruit +17: +- name: '{elif}' + explanation: '`{elif}`' + demo_code: |- + a = 2 + {if} a == 1: + {print} 'a is 1' + {elif} a == 2: + {print} 'a is 2' + {else}: + {print} 'a is not 1 or 2' +- name: '{print}' + explanation: When we use a `{for}`, we need to put a `:` behind the `{for}` statement! + demo_code: |- + {for} i {in} {range} 1 {to} 12: + {print} i + {print} 'Ready or not, here I come!' +- name: '{if}' + explanation: We need to do the same with all of our `{if}` statements. + demo_code: |- + color = {ask} 'What is your favorite color?' + {if} color == 'green': + {print} 'Your favorite color is green' + {else}: + {print} 'Your favorite color is not green' +18: +- name: '{print}' + explanation: After `{print}` you need to use parentheses. + demo_code: '{print}(''hi!'')' +- name: '{range}' + explanation: After `{range}` you need to use parentheses. + demo_code: |- + {for} i {in} {range} (1,10): + {print}('Hello, times ', i) +- name: '{print} with var' + explanation: With `{print}` you need to use parentheses and commas if you print more items. + demo_code: |- + name = 'Hedy' + {print}('my name is ', name) +- name: ask something with {input} + explanation: Use `{input}` instead of `{ask}` to ask something. + demo_code: |- + name = {input}('What is your name?') + {print}('So your name is ', name) diff --git a/content/client-messages/mi.yaml b/content/client-messages/mi.yaml index 3fa2cfc06e0..47104d01f24 100644 --- a/content/client-messages/mi.yaml +++ b/content/client-messages/mi.yaml @@ -1,25 +1,25 @@ -haunted: 🦇, 👻, 🎃 -Program_too_long: Your program takes too long to run. +CheckInternet: Have a look if your Internet connection is working properly. +Connection_error: We couldn't reach the server. +Empty_output: This code works but does not print anything. Add a print command to your code or use the turtle to get output. Errors_found: You made a mistake! Don't worry, we still ran the program -turtle: 🐢 -ServerError: You wrote a program we weren't expecting. If you want to help, send us an email with the level and your program at hello@hedy.org. In the meantime, try something a little different and take another look at the examples. Thanks! -restaurant: 🍣, 🍕, 🍔 Execute_error: Something went wrong while running the program. -CheckInternet: Have a look if your Internet connection is working properly. -Transpile_success: -- Good job! -- Amazing! -- Well done! -- Excellent! -- You did great! -Program_repair: This could be the correct code, can you fix it? Other_error: Oops! Maybe we made a little mistake. -Connection_error: We couldn't reach the server. -Transpile_warning: Warning! +Program_repair: This could be the correct code, can you fix it? +Program_too_long: Your program takes too long to run. +ServerError: You wrote a program we weren't expecting. If you want to help, send us an email with the level and your program at hello@hedy.org. In the meantime, try something a little different and take another look at the examples. Thanks! Transpile_error: We can't run your program. -songs: 🎵,🎶 +Transpile_success: +- Good job! +- Amazing! +- Well done! +- Excellent! +- You did great! +Transpile_warning: Warning! Unsaved_Changes: You have an unsaved program. Do you want to leave without saving it? -rock: ✂️, 📜, 🗻 dice: 🎲 -Empty_output: This code works but does not print anything. Add a print command to your code or use the turtle to get output. fortune: 🔮, ✨ +haunted: 🦇, 👻, 🎃 +restaurant: 🍣, 🍕, 🍔 +rock: ✂️, 📜, 🗻 +songs: 🎵,🎶 +turtle: 🐢 diff --git a/content/keywords/mi.yaml b/content/keywords/mi.yaml index 515935abb5e..f1b2fc676c7 100644 --- a/content/keywords/mi.yaml +++ b/content/keywords/mi.yaml @@ -1,63 +1,63 @@ -define: define -turn: turn -if: if +add: add +and: and +ask: ask +at: at +black: black +blue: blue +brown: brown button: button +call: call +clear: clear +color: color +comma: ',' +d0: '0' +d1: '1' d2: '2' -brown: brown -from: from -and: and -remove: remove -d7: '7' +d3: '3' +d4: '4' d5: '5' +d6: '6' +d7: '7' +d8: '8' +d9: '9' +def: def +define: define +echo: echo +elif: elif +else: else for: for -clear: clear +forward: forward +from: from gray: gray -pink: pink -ask: ask -right: right -while: while -white: white +green: green +if: if +in: in +input: input is: is +left: left +length: length +not in: not in or: or +orange: orange +pink: pink +pressed: pressed +print: print +purple: purple +quote: '''' +random: random range: range -in: in -with: with +red: red +remove: remove repeat: repeat -input: input -to: to -d6: '6' return: return -quote: "'" -at: at +right: right +sleep: sleep +step: step times: times -forward: forward -orange: orange -d4: '4' -green: green -yellow: yellow -left: left -d1: '1' -elif: elif -red: red -random: random -black: black -print: print -call: call -d8: '8' -def: def -d9: '9' -pressed: pressed -not in: not in +to: to to_list: to -d3: '3' -comma: ',' -add: add -echo: echo -length: length -else: else -d0: '0' -color: color -purple: purple -blue: blue -step: step -sleep: sleep +turn: turn +while: while +white: white +with: with +yellow: yellow diff --git a/content/pages/mi.yaml b/content/pages/mi.yaml index a940ee2e2a7..e6ebe34d141 100644 --- a/content/pages/mi.yaml +++ b/content/pages/mi.yaml @@ -1,554 +1,1146 @@ +title: Hedy documentation +home-sections: +- title: Textual programming made easy! + text: |- + Many schools and teachers around the world want to teach their students programming. Initially this is often done with playful tools, ranging from the Beebot robot to + Scratch Junior or Scratch. After using such tools, kids often want to move to more powerful, textual programming languages, like Python. + + Python however is hard, because it is only available in English, and requires learners to learn complex programming concepts and syntax at once. + Hedy is the easy way to get started with textual programming languages! Hedy is free to use, open source, and unlike any other textual programming language in three ways. + + 1. Hedy is multi-lingual, you can use Hedy in your own language + 2. Hedy is gradual, so you can learn one concept and its syntax a time + 3. Hedy is built for the classroom, allowing teachers to fully customize their student's experience +- title: Multi-lingual programming + text: While almost all textual programming language have keywords in English, such as `for` or `repeat`, Hedy can be used in any language! We currently support 47 different languages, including Dutch, Spanish, Arabic, Turkish, Chinese and Hindi. If your language is not available you can always start + a new translation. +- title: Step by step learning + text: Learning a programming language can be overwhelming, since learners have to learn concepts (for example if-else or loops) and syntax (like quotation marks or round brackets) at the same time. In Hedy, concepts are first introduced with little syntax and then refined. A scientifically proven + way to learn! +- title: Built for the classroom + text: |- + Hedy is suitable for kids aged 10 and up and designed for classroom use. + Teachers can use our free, built-in lesson plans, but can also author their own lessons and load these into the Hedy user interface. +- title: Programming in context + text: Hedy shows programming in the broadest way possible, and can be used in variety of exciting ways. Hedy allows for the creation of digital and interactive stories, colorful drawings that can be shown on the screen but also drawn with a pen plotter or embroidered on a shirt, and can be used to + create games or apps with buttons and keyboard actions. +- title: Is Hedy free? + text: |- + Yes! Hedy is 'Open source', which means that everyone can help us make Hedy better. + You can find our code on Github. + If you like Hedy and want to contribute, we accept (and are very grateful for) donations! +- title: Do I need to install anything? + text: No. Hedy works in the browser, which is the program you are using to look at this page. Probably Chrome or Edge or Firefox. Hedy also works on phones and tablets. +- title: Do I need programming experience to teach with Hedy? + text: |- + No, that is not needed. All concepts are explained in the slides and in the interface for learners. + If you create a free teacher's account, you also get access to the teacher's manual with information on how to teach + and frequently made mistakes. +join-sections: +- title: Supporting Hedy + text: '# There are three ways in which you can support Hedy!' +- title: Improving the language + text: |- + The gradual and multi-lingual nature of Hedy create a lot of interesting technical challenges. + Find those issues on Github. +- title: Translating Hedy + text: |- + Not a programmer? No problem! Another way to support Hedy is by translating keywords, error messages, adventures and other content. + This is the current status, help us complete a language, or add a new one! + + Translation status +- title: Help teachers get started + text: |- + Hedy is designed to support teachers in providing programming lessons in class. We have specific teacher features like the option to create a class, customize it and see how your students are doing. + If you like Hedy, you can reach out to schools that you know to help teachers get started! We can help you find schools or teachers via Discord. +learn-more-sections: +- title: Join the Hedy Community + text: |- + We love to hear from you! The best way to get in touch with us is by joining our Discord server. + + You can also [send us an email](mailto:hello@hedy.org "About Hedy"). + + To stay on top of the latest news, [subscribe to our newsletter](/subscribe). +- title: A deep dive! + text: |- + Want to know more about Hedy's philosophy and design? Check out this talk Felienne gave at the StrangeLoop Conference in 2022: + + +- title: Hedy in the news + text: |- + Some websites and newspapers have written about Hedy since our release in early 2020. We keep a list here: + * [Java Magazine 04.2023](images/Hedy_Javamagazine2023.pdf) + * [Tech Optimism - A Solution to the IT Shortage (Dutch), August 2022](https://pom.show/2022/08/12/een-oplossing-voor-het-it-tekort/) + * [Codeweek Podcast, July 2022](https://codeweek.eu/podcast/26) + * [Heise.de (German), Januari 2022](https://www.heise.de/news/Hedy-die-mitwachsende-Programmiersprache-6336264.html) + * [Strumenta, November 2021](https://tomassetti.me/teaching-programming-with-hedy/) + * [Vives (Dutch), CodeWeek Special October 2021](images/Vives-174-Codeweek.pdf) + * [CodeWeek.eu - Haunted House Challenge, September 2021](https://codeweek.eu/2021/challenges/haunted-house) + * [Opensource.com, April 2021](https://opensource.com/article/21/4/hedy-teach-code) + * [IO Magazine, April 2021](https://ict-research.nl/wordpress/wp-content/uploads/2021/04/IO-magazine-NR1-2021_web.pdf) + * [Ingeniería De Software (Spanish), February 2021](https://ingenieriadesoftware.es/hedy-mejor-lenguaje-ensenar-programacion-ninos/) + * [Hello World Magazine, February 2021](images/Hello_World_15_Hedy.pdf) + * [Discoro, January 2021](https://discoro.wordpress.com/2021/01/09/hedy-gradually-learning-a-programming-language/) + * [Felienne wins the Dutch award for ICT research for Hedy, January 2021](https://www.nwo.nl/en/news/felienne-hermans-receives-dutch-prize-ict-research-2021) + * [SlashDot, August 2020](https://news.slashdot.org/story/20/08/17/024248/scientist-proposes-a-new-programming-language-for-teaching-coding-and-python) + * [GenBeta (Spanish), August 2020](https://www.genbeta.com/desarrollo/nuevo-lenguaje-para-ensenar-programacion-a-ninos-como-se-ensena-a-leer-escribir-forma-gradual-niveles) + * [Developpez (French), August 2020](https://programmation.developpez.com/actu/308095/Une-scientifique-propose-un-nouveau-langage-de-programmation-pour-enseigner-aux-enfants-le-codage-informatique-au-travers-d-une-approche-graduelle-implementee-en-Python-sur-13-paliers/) + * [Vives (Dutch), October 2020](images/artikel_vives.pdf) "Met Hedy stap voor stap leren programmeren" + * [Leiden University, April 2020](https://www.universiteitleiden.nl/en/news/2020/03/looking-to-distract-the-kids-while-you-work-from-home-get-them-programming) + * [Mare (Dutch), April 2020](https://www.mareonline.nl/cultuur/computercode-voor-de-kids/) + * [AG Connect (Dutch), April 2020](https://www.agconnect.nl/artikel/stapsgewijs-python-leren-programmeren-met-nieuwe-taal-hedy) sections: -- subsections: - - title: What's Hedy? - text: "Hedy is a textual programming language, specifically developed for (pre-)teens (10 to 15 years old).\nIn contrast to programming languages for kids, like Scratch, Hedy doesn't use code blocks but textual code.\nSo with Hedy you'll learn how to type code like the real programmers do, but in small steps with playful exercises.\nThis way Hedy can function as a stepping stone to real programming languages like Python in an accessible and mostly fun way!\nIf you want to know more, you can watch this video about the development of Hedy as a programming language." - - text: "Hedy is developed with middle school and junior high school students in mind (ages 10 - 15).\nIt's important for the students to be able to read well. We recommend not to start with Hedy before the students have achieved at least a 3rd grade reading level.\nStudents (and teachers!) don't need any programming experience before starting with Hedy." - title: Target audience - - text: "Hedy is divided into levels, in which new commands are taught. Each level contains a variety of adventures to practice the newly learned commands.\nAs a teacher, you get to decide which adventures are available for your students. Will they be making a restaurant, a calculator or a haunted house this level? Within each level, the adventures are arranged from easiest to hardest.\nSo your students keep getting challenged. The adventures can be done by the students individually, or you can use them in a classical instruction.\n\nThe adventures also include a code example, to make sure the less digitally informed teachers are able to use Hedy too!\nOf course Hedy also caters to the creative teachers that love to make their own lessonplans and adventures!\n\nAfter programming all the adventures of a certain level, your students can test their knowledge in the quiz.\nYou can track your students' work and their progress on the class page." - title: How does Hedy work? - - text: "Hedy is web-based, which means it works on any device with a browser (Google Chrome, Firefox, Edge etc), so laptops, Chromebooks, tablets and even smartphones are suitable to use Hedy.\nThere's no need to download anything before working with Hedy, just go to the website and you're all set!" - title: Devices - - text: "All Hedy teachers, programmers and other fans are welcome to join our Discord server. This is the ideal place to chat about Hedy: we have channels where you can show your cool projects and lessons, channels to report bugs, and channels to chat with other teachers and with the Hedy team.\nHere you can find a video on how to join the Discord Community." - title: The Hedy Community - - text: "Organizations in the EU have to comply with the GDPR (General Data Protection Regulation) when processing personal data.\nBecause this is a complex issue for many schools, you can use all Hedy programming functionalities without sharing personal data.\nThe easiest way to do this is to use Hedy without creating accounts for the teacher and students. Without accounts, all functionality is available, with the exception of personalizing levels, saving students' programs and viewing their progress. That is limiting, but there are schools that use Hedy in that way.\n\nA second way is for a teacher to create an account with an email address without personal data, for example \"docent25@email.com\". Apart from an email address, which is only required to reset your password, you do not need to share any information when you create a teacher account.\nWith a teacher account, you can create anonymous accounts for students, e.g. rainbow-student1, rainbow-student2, etc (See 'Teaching preparations' for a detailed manual). This way you can use all functionality of Hedy, including saving progress, without sharing personal data of yourself or your students.\n\nIf the above is not sufficient for your context, we can sign a processing agreement for the processing of your personal data." - title: Hedy and the GDPR - title: Introduction +- title: Introduction key: intro -- title: Tutorial subsections: - - text: Do you want to follow the tutorial (again)? Click here. - title: Tutorial + - title: What's Hedy? + text: |- + Hedy is a textual programming language, specifically developed for (pre-)teens (10 to 15 years old). + In contrast to programming languages for kids, like Scratch, Hedy doesn't use code blocks but textual code. + So with Hedy you'll learn how to type code like the real programmers do, but in small steps with playful exercises. + This way Hedy can function as a stepping stone to real programming languages like Python in an accessible and mostly fun way! + If you want to know more, you can watch this video about the development of Hedy as a programming language. + - title: Target audience + text: |- + Hedy is developed with middle school and junior high school students in mind (ages 10 - 15). + It's important for the students to be able to read well. We recommend not to start with Hedy before the students have achieved at least a 3rd grade reading level. + Students (and teachers!) don't need any programming experience before starting with Hedy. + - title: How does Hedy work? + text: |- + Hedy is divided into levels, in which new commands are taught. Each level contains a variety of adventures to practice the newly learned commands. + As a teacher, you get to decide which adventures are available for your students. Will they be making a restaurant, a calculator or a haunted house this level? Within each level, the adventures are arranged from easiest to hardest. + So your students keep getting challenged. The adventures can be done by the students individually, or you can use them in a classical instruction. + + The adventures also include a code example, to make sure the less digitally informed teachers are able to use Hedy too! + Of course Hedy also caters to the creative teachers that love to make their own lessonplans and adventures! + + After programming all the adventures of a certain level, your students can test their knowledge in the quiz. + You can track your students' work and their progress on the class page. + - title: Devices + text: |- + Hedy is web-based, which means it works on any device with a browser (Google Chrome, Firefox, Edge etc), so laptops, Chromebooks, tablets and even smartphones are suitable to use Hedy. + There's no need to download anything before working with Hedy, just go to the website and you're all set! + - title: The Hedy Community + text: |- + All Hedy teachers, programmers and other fans are welcome to join our Discord server. This is the ideal place to chat about Hedy: we have channels where you can show your cool projects and lessons, channels to report bugs, and channels to chat with other teachers and with the Hedy team. + Here you can find a video on how to join the Discord Community. + - title: Hedy and the GDPR + text: |- + Organizations in the EU have to comply with the GDPR (General Data Protection Regulation) when processing personal data. + Because this is a complex issue for many schools, you can use all Hedy programming functionalities without sharing personal data. + The easiest way to do this is to use Hedy without creating accounts for the teacher and students. Without accounts, all functionality is available, with the exception of personalizing levels, saving students' programs and viewing their progress. That is limiting, but there are schools that use Hedy in that way. + + A second way is for a teacher to create an account with an email address without personal data, for example "docent25@email.com". Apart from an email address, which is only required to reset your password, you do not need to share any information when you create a teacher account. + With a teacher account, you can create anonymous accounts for students, e.g. rainbow-student1, rainbow-student2, etc (See 'Teaching preparations' for a detailed manual). This way you can use all functionality of Hedy, including saving progress, without sharing personal data of yourself or your students. + + If the above is not sufficient for your context, we can sign a processing agreement for the processing of your personal data. +- title: Tutorial key: tutorial -- key: preparations + subsections: + - title: Tutorial + text: Do you want to follow the tutorial (again)? Click here. +- title: Teaching preparations + key: preparations subsections: - title: For teachers - text: You can prepare your classes at the For Teachers page. On this page you'll find everything you'll need to teach with Hedy, like your classes, your adventures and slides. All the functionalities of the for teachers page are explained below. - - text: "As a teacher, you can create a class for your students. In this class you can see the students' accounts and their programs and you could monitor their progress.\nThis video shows you how to quickly create a class in Hedy." - title: Creating a Class + text: You can prepare your classes at the For Teachers page. On this page you'll find everything you'll need to teach with Hedy, like your classes, your adventures and slides. All the functionalities of the for teachers page are explained + below. + - title: Creating a Class + text: |- + As a teacher, you can create a class for your students. In this class you can see the students' accounts and their programs and you could monitor their progress. + This video shows you how to quickly create a class in Hedy. - title: Customize your Class - text: "You can customize your class and choose which adventures are available for your students. This way your students won't be overwhelmed by the amount of adventures and levels, and they can specifically focus on the adventures you'd like them to practice with.\nClick on your class on the for teachers page and choose 'customize class'. On this page you can select levels, set opening dates, unlock level thresholds and more.\n\n**Select and order adventures**\n\nIn this section you can select and order adventures. The pink tabs are adventures with new commands. The gray tabs are regular adventures. To rearrange the order of the adventures, you can drag the tabs. However, we do advise you to use the regular order of adventures as the Hedy team made sure the adventures go from easiest to hardest.\nIf you want to remove an adventure for your students, simply click the cross on the adventure's tab.\n\nIf you want to add adventures, for instance your own adventure or an adventure you accidentally removed, use this menu to add the adventure to your students' adventures. Simply click the adventure you want to add and it (re)appears in the line of adventures. To undo all your changes to the adventures, click 'Reset'.\n\n**Opening dates**\n\nWith this feature you can set opening dates for the levels. This way you can make a lesson plan before your course begins and not worry about opening new levels each week. In the image above the first level is opened directly, the second will open the 23th of september, and the 3rd level the week after. The other levels are closed.\nDon't want to set opening dates? No problem, just leave this section blank.\n\n**Unlock level thresholds**\n\nThis featue allows you to set a threshold for your students' quiz grade, before they can continue to the next level. For example, if you enter \"80\" your students have to score at least 80% on the quiz before they are allowed to go to the next level. If they haven't met the threshold, they are not allowed to continue and have to retake the quiz.\nDon't want to use the threshold? No worries, just keep this section blank.\n\n\n**Other settings**\n\nThere are some other setting that could be usefu to you aswell. Our first extra setting is 'Mandatory developer's mode'. In developers mode the students only see their input and output screens and the run button. The adventures are hidden and there are no cheatsheets available. This might come in handy in a test situation.\nIf this option is not selected the developer's mode is available for students too as a voluntary option.\n\nIf you want all your students to be visible in de class highscore, you can select the second option.\nWith all the other options you can choose to hide some functions or content for your students, this might help them focus more.\n\n**Save**\n\nDon't forget to save your changes when you're done customizing your class." - - text: "To add students to your class go to the class page by clicking in the class name on the 'for teachers' page. Then click 'add students'. There are 2 ways to let your students join your class: You can create accounts for them, or they could create their own accounts.\n\n**You create accounts for your students**\nThe easiest way to add students to your class is by creating an account for them. This can be done by clicking the 'create student accounts' button and filling in the usernames and passwords for them.\nThe students can login with the username and password that you chose. Afterwards, they can change their username or password if they'd like and they'll still remain in your class.\nThis video shows how to add students to your class in the quickest and easiest way.\n\n**Students make their own accounts**\nYour students can also go to the Hedy website and create their own accounts, just like you did. To get them into your class, they simply have to click the invite link.\nYou can find the invite link on the class page and send it to your students. Mind that your students have to be logged in to Hedy when they click the link, in order to make it work smoothly.\nYou can also manually invite a student to your class with the button 'Invite by username'." - title: Student Accounts + text: |- + You can customize your class and choose which adventures are available for your students. This way your students won't be overwhelmed by the amount of adventures and levels, and they can specifically focus on the adventures you'd like them to practice with. + Click on your class on the for teachers page and choose 'customize class'. On this page you can select levels, set opening dates, unlock level thresholds and more. + + **Select and order adventures** + + In this section you can select and order adventures. The pink tabs are adventures with new commands. The gray tabs are regular adventures. To rearrange the order of the adventures, you can drag the tabs. However, we do advise you to use the regular order of adventures as the Hedy team made sure the adventures go from easiest to hardest. + If you want to remove an adventure for your students, simply click the cross on the adventure's tab. + + If you want to add adventures, for instance your own adventure or an adventure you accidentally removed, use this menu to add the adventure to your students' adventures. Simply click the adventure you want to add and it (re)appears in the line of adventures. To undo all your changes to the adventures, click 'Reset'. + + **Opening dates** + + With this feature you can set opening dates for the levels. This way you can make a lesson plan before your course begins and not worry about opening new levels each week. In the image above the first level is opened directly, the second will open the 23th of september, and the 3rd level the week after. The other levels are closed. + Don't want to set opening dates? No problem, just leave this section blank. + + **Unlock level thresholds** + + This featue allows you to set a threshold for your students' quiz grade, before they can continue to the next level. For example, if you enter "80" your students have to score at least 80% on the quiz before they are allowed to go to the next level. If they haven't met the threshold, they are not allowed to continue and have to retake the quiz. + Don't want to use the threshold? No worries, just keep this section blank. + + + **Other settings** + + There are some other setting that could be usefu to you aswell. Our first extra setting is 'Mandatory developer's mode'. In developers mode the students only see their input and output screens and the run button. The adventures are hidden and there are no cheatsheets available. This might come in handy in a test situation. + If this option is not selected the developer's mode is available for students too as a voluntary option. + + If you want all your students to be visible in de class highscore, you can select the second option. + With all the other options you can choose to hide some functions or content for your students, this might help them focus more. + + **Save** + + Don't forget to save your changes when you're done customizing your class. + - title: Student Accounts + text: |- + To add students to your class go to the class page by clicking in the class name on the 'for teachers' page. Then click 'add students'. There are 2 ways to let your students join your class: You can create accounts for them, or they could create their own accounts. + + **You create accounts for your students** + The easiest way to add students to your class is by creating an account for them. This can be done by clicking the 'create student accounts' button and filling in the usernames and passwords for them. + The students can login with the username and password that you chose. Afterwards, they can change their username or password if they'd like and they'll still remain in your class. + This video shows how to add students to your class in the quickest and easiest way. + + **Students make their own accounts** + Your students can also go to the Hedy website and create their own accounts, just like you did. To get them into your class, they simply have to click the invite link. + You can find the invite link on the class page and send it to your students. Mind that your students have to be logged in to Hedy when they click the link, in order to make it work smoothly. + You can also manually invite a student to your class with the button 'Invite by username'. - title: Setting preferred language - text: "When students create profiles they are supposed to choose a 'preferred language'. Hedy will always be loaded in this selected language.\nChanging this language can always be done later on by navigating to 'My account' and 'My personal settings' again.\n\n**For non-English speakers**\nNot only can you change the language of the adventures to your own language. You can also choose which language the keywords (for example 'print' or 'ask') should be in.\nThis way you can teach your students to code with English keywords, but you can also let them program in their own language. For example, Dutch students can use the command 'vraag' instead of 'ask'.\nIf a student wants to switch languages, they can click the keyword switcher. It will switch the keywords from English to the preferred language and back.\nFun fact! Students are allowed program in both English and their own language at the same time! So, if they have trouble remembering some keywords in English, but easily remember other ones they can use both at the same time.\n\n\n**Video**\nThis video show you how to set a preferred language and change the keywords to you preferred language as well." - - text: "When you are logged in, you'll see My programs next to your profile icon.\nThis option exists for your students too. In My programs you can find all the programs that you've worked on.\nBy default, programs will be saved to 'My programs' when you run the code, and every 10 seconds, under their default name\nand their level (for example: Story 5). If you want to store a program under a new name, just type the new name in the name bar.\nCurrently, only one program can be saved per level, per tab.\n\nYou (and your students) can also share programs using the share button next to program names.\nThese programs will be posted on our explore page, for everybody to see and use.\nIf you want to unshare your program, go to 'My programs' and click 'Unshare'.\n\nThe paper plane icon can be used to hand in programs to the teacher of a class. Programs that have been handed is will no longer be editable." - title: Storing programs - title: Teaching preparations -- subsections: + text: |- + When students create profiles they are supposed to choose a 'preferred language'. Hedy will always be loaded in this selected language. + Changing this language can always be done later on by navigating to 'My account' and 'My personal settings' again. + + **For non-English speakers** + Not only can you change the language of the adventures to your own language. You can also choose which language the keywords (for example 'print' or 'ask') should be in. + This way you can teach your students to code with English keywords, but you can also let them program in their own language. For example, Dutch students can use the command 'vraag' instead of 'ask'. + If a student wants to switch languages, they can click the keyword switcher. It will switch the keywords from English to the preferred language and back. + Fun fact! Students are allowed program in both English and their own language at the same time! So, if they have trouble remembering some keywords in English, but easily remember other ones they can use both at the same time. + + + **Video** + This video show you how to set a preferred language and change the keywords to you preferred language as well. + - title: Storing programs + text: |- + When you are logged in, you'll see My programs next to your profile icon. + This option exists for your students too. In My programs you can find all the programs that you've worked on. + By default, programs will be saved to 'My programs' when you run the code, and every 10 seconds, under their default name + and their level (for example: Story 5). If you want to store a program under a new name, just type the new name in the name bar. + Currently, only one program can be saved per level, per tab. + + You (and your students) can also share programs using the share button next to program names. + These programs will be posted on our explore page, for everybody to see and use. + If you want to unshare your program, go to 'My programs' and click 'Unshare'. + + The paper plane icon can be used to hand in programs to the teacher of a class. Programs that have been handed is will no longer be editable. +- title: Teaching with Hedy + key: teaching + subsections: - title: Teaching with Hedy - text: "Hedy contains a lot of different levels that each teach a different new skill. We recommend to teach one level per lesson.\nThis gives your students the time to fully grasp a new command or concept and practice with it, before moving on to the next level.\nWe use this structure in our lessons: Introduction, New concepts and commands, let's get to work, puzzles and quizzes." + text: |- + Hedy contains a lot of different levels that each teach a different new skill. We recommend to teach one level per lesson. + This gives your students the time to fully grasp a new command or concept and practice with it, before moving on to the next level. + We use this structure in our lessons: Introduction, New concepts and commands, let's get to work, puzzles and quizzes. - title: Slides - text: "When giving instructions you might want to use our slides. Our slides are available on the 'For teachers' page. There is a set of slides for each level. In the slides all the new commands for that level are explained. We have aimed to explain why these changes are nessecary or how the new commands come in handy.\nWe also give some examples of how the new commands can be used. You could of course also use your own slides, or just open Hedy and show your students around the website. Whichever you prefer to give the best Hedy lessons!" + text: |- + When giving instructions you might want to use our slides. Our slides are available on the 'For teachers' page. There is a set of slides for each level. In the slides all the new commands for that level are explained. We have aimed to explain why these changes are nessecary or how the new commands come in handy. + We also give some examples of how the new commands can be used. You could of course also use your own slides, or just open Hedy and show your students around the website. Whichever you prefer to give the best Hedy lessons! - title: Introduction - text: "You can start your lessons by activating your students' prior knowledge: What do they already know about the subject, what did they learn in the previous lesson and which mistakes did they make that they've now learned from?\nThis way all the previously learned commands and frequently made mistakes are fresh in your students' memories, when you start introducing the new lesson." + text: |- + You can start your lessons by activating your students' prior knowledge: What do they already know about the subject, what did they learn in the previous lesson and which mistakes did they make that they've now learned from? + This way all the previously learned commands and frequently made mistakes are fresh in your students' memories, when you start introducing the new lesson. - title: Introduction of new concepts and commands - text: "The new concepts and commands can be very hard for some students to fully understand.\nThat's why it's of importance to model the proper use of the new commands to your students.\nEspecially in the lower levels, where some students have no experience with programming at all, it can be hard for them to understand the new abstract concepts.\nShowing a lot of examples makes an abstract concept (for instance: 'What is a variable?') more recognizable and easier to understand ('Look, the variable pet changed into dog'). Our slides could help you with that." + text: |- + The new concepts and commands can be very hard for some students to fully understand. + That's why it's of importance to model the proper use of the new commands to your students. + Especially in the lower levels, where some students have no experience with programming at all, it can be hard for them to understand the new abstract concepts. + Showing a lot of examples makes an abstract concept (for instance: 'What is a variable?') more recognizable and easier to understand ('Look, the variable pet changed into dog'). Our slides could help you with that. - title: Let's get to work - text: "Each level contains different adventures that you can find in the pink tabs. The first pink tab explains the new commands in this level.\nThe following tabs are adventures that the students can try out and make their own.\nThe adventures are arranged from easiest to hardest, so we recommend to start on the left and your your way to the right.\nThe last tab 'what's next' gives a little teaser of what you'll learn in the next level. Of course, you can select the adventures you want your students to do for each level.\nThey don't always have to make every adventure. Every adventure contains an example code, that the students can try out with the green button.\nThe example code gets copied to the workfield, where the students can try out the code and adjust it to make it their own.\nStimulate your students to turn the example codes into their own projects by adding their own ideas and making their own variation of the adventure." - - text: "To test whether your students have picked up all the new info in the level, you can let them take the quiz.\nThe quiz contains 10 multiple choice questions about the new concepts and command to that level.\nNot every level has a quiz yet, as we are still building the quizzes.\nSome levels also contain puzzles. Puzzles show the students a couple of line of code that the students have to put in the right order.\n\nThis video shows the quizzes and puzzles." - title: Quizzes and puzzles - - text: "Round up your lesson by having a brief evaluation. What did the students learn? Which hardships did they come across?\nHow did they learn from their mistakes? And of course: What did they create?\nStudents are often very proud of their own creations, so it's nice to save a little time and give your students the opportunity to show their work to their classmates." - title: Evaluation - title: Teaching with Hedy - key: teaching -- subsections: - - text: "If you would like to keep track of your students' progress, you can make use of the live dashboard. You can find the live dashboard by clicking 'Live statistics' on your class page.\n\nAll the features of this dashboard are explained below." - title: Live Dashboard + text: |- + Each level contains different adventures that you can find in the pink tabs. The first pink tab explains the new commands in this level. + The following tabs are adventures that the students can try out and make their own. + The adventures are arranged from easiest to hardest, so we recommend to start on the left and your your way to the right. + The last tab 'what's next' gives a little teaser of what you'll learn in the next level. Of course, you can select the adventures you want your students to do for each level. + They don't always have to make every adventure. Every adventure contains an example code, that the students can try out with the green button. + The example code gets copied to the workfield, where the students can try out the code and adjust it to make it their own. + Stimulate your students to turn the example codes into their own projects by adding their own ideas and making their own variation of the adventure. + - title: Quizzes and puzzles + text: |- + To test whether your students have picked up all the new info in the level, you can let them take the quiz. + The quiz contains 10 multiple choice questions about the new concepts and command to that level. + Not every level has a quiz yet, as we are still building the quizzes. + Some levels also contain puzzles. Puzzles show the students a couple of line of code that the students have to put in the right order. + + This video shows the quizzes and puzzles. + - title: Evaluation + text: |- + Round up your lesson by having a brief evaluation. What did the students learn? Which hardships did they come across? + How did they learn from their mistakes? And of course: What did they create? + Students are often very proud of their own creations, so it's nice to save a little time and give your students the opportunity to show their work to their classmates. +- title: Teacher Statistics + key: teacher_statistics + subsections: + - title: Live Dashboard + text: |- + If you would like to keep track of your students' progress, you can make use of the live dashboard. You can find the live dashboard by clicking 'Live statistics' on your class page. + + All the features of this dashboard are explained below. - title: Level Selection - text: "\nFirstly, you can select the levels you'd like to see on the dahsboard. Select the levels your students are currently working on by clicking on the number of that level. Deselect levels that you do not want to see by clicking them again.\nIn this example level 1 and 2 are selected. You can click on refresh to refresh the dashboard and get the most current stats." + text: |- + + Firstly, you can select the levels you'd like to see on the dahsboard. Select the levels your students are currently working on by clicking on the number of that level. Deselect levels that you do not want to see by clicking them again. + In this example level 1 and 2 are selected. You can click on refresh to refresh the dashboard and get the most current stats. - title: Class Overview - text: "\nIn the class overview you can see which adventure your students are working on right now. You can see that one student is working on the 'Rock, Paper, Scissors' adventure in level 1, one is working on the 'Fortune Teller' in level 1 and one student is working on the 'Rock, Paper, Scissors' adventure in level 2.\nIf you'd like to know which of your students is working on the adventure, simply click the number and their accountnames will appear.\nYou can also see how many of your students have finished the quiz. In this case, one student finished the quiz in level 1. Again, you can click the 1 to see which of your students it is.\n\nYou can also see one of the students is 'missing' from this overview. That's because he's working on an adventure in level 4, which is not selected." - - text: "\nHere you can find a list of your students and you can see their individual progress. The blue ring shows you what your students are currently working on.\n\nIt is important to notice that the blue dots means that a students 'attempted' the adventure. This means that they ran a code in this adventure and went on to the next adventure, so this does not automatically mean that they did a good job!\nIf you want to see how an individual student is getting along, you can click their name in this overview. This is what you see if you click on marleen_h3a for example:\n\nYou see that Marleen is having some trouble programming. She tried to run a program that contains blanks multiple times, so she probably doesn't know that she has to change something to the example codes before running them.\nIn this way this overview can give you a better understanding of what a student is struggling with." - title: Student List - - text: "\nIf you're not only interested in individual struggles of your students, but you'd like to know what the whole class seems to be doing wrong, you can use this oversight of common errors.\nThe most common error messages that your students are recieving will appear in this oversight for you, so you could give some more instructions to the whole class if needed.\nBy clicking the error, you can see which students are having trouble with this error. By clicking resolve, you'll remove this error from the list." - title: Common Errors + text: |- + + In the class overview you can see which adventure your students are working on right now. You can see that one student is working on the 'Rock, Paper, Scissors' adventure in level 1, one is working on the 'Fortune Teller' in level 1 and one student is working on the 'Rock, Paper, Scissors' adventure in level 2. + If you'd like to know which of your students is working on the adventure, simply click the number and their accountnames will appear. + You can also see how many of your students have finished the quiz. In this case, one student finished the quiz in level 1. Again, you can click the 1 to see which of your students it is. + + You can also see one of the students is 'missing' from this overview. That's because he's working on an adventure in level 4, which is not selected. + - title: Student List + text: |- + + Here you can find a list of your students and you can see their individual progress. The blue ring shows you what your students are currently working on. + + It is important to notice that the blue dots means that a students 'attempted' the adventure. This means that they ran a code in this adventure and went on to the next adventure, so this does not automatically mean that they did a good job! + If you want to see how an individual student is getting along, you can click their name in this overview. This is what you see if you click on marleen_h3a for example: + + You see that Marleen is having some trouble programming. She tried to run a program that contains blanks multiple times, so she probably doesn't know that she has to change something to the example codes before running them. + In this way this overview can give you a better understanding of what a student is struggling with. + - title: Common Errors + text: |- + + If you're not only interested in individual struggles of your students, but you'd like to know what the whole class seems to be doing wrong, you can use this oversight of common errors. + The most common error messages that your students are recieving will appear in this oversight for you, so you could give some more instructions to the whole class if needed. + By clicking the error, you can see which students are having trouble with this error. By clicking resolve, you'll remove this error from the list. - title: Overview of programs per adventure - text: "\nAnother useful overview of all the programs your students made in a level can be found on your class page. Go to the class page and click 'Overview of programs per adventure'. Here you'll find this overview.\nYou could use this overview to check your students' work. If they have made a program in an adventure, an eye appears in your overview. Click the eye to view their work. Did you like it? Then you can check the box and a green tick will appear.\nThis way you create a nice overview for yourself of your students' results." - key: teacher_statistics - title: Teacher Statistics -- subsections: + text: |- + + Another useful overview of all the programs your students made in a level can be found on your class page. Go to the class page and click 'Overview of programs per adventure'. Here you'll find this overview. + You could use this overview to check your students' work. If they have made a program in an adventure, an eye appears in your overview. Click the eye to view their work. Did you like it? Then you can check the box and a green tick will appear. + This way you create a nice overview for yourself of your students' results. +- title: Extra Hedy features + key: features + subsections: - title: Make your own adventure text: It is also possible for teachers to create your own adventure. This video shows you how to create your own adventure as a teacher and add it to your class(es). - title: Explore page - text: "On the explore page you can view the work of other Hedy users. You can try out their programs and use them as inspiration to create something cool yourself.\nYou can also add a program you've made to the explore page yourself by clicking 'Save and share code' in the coding screen or go to My Programs and click 'Share'.\nDon't want to share your work anymore? Simply go to 'My Programs' and click 'Unshare'.\nIf you want more information about the explore page, check out this video." - - text: "If you click on your username in the topright corner of your screen, you can go to My achievements. On this page you achievements are collected. Your students have such a page as well.\nWhen you hover over the badge with your mouse, you'll see how to earn the badge. There are hidden badges too, of which you'll have to find out yourself how to earn them.\nIf you want more information on the achievements, check out this video." - title: My achievements + text: |- + On the explore page you can view the work of other Hedy users. You can try out their programs and use them as inspiration to create something cool yourself. + You can also add a program you've made to the explore page yourself by clicking 'Save and share code' in the coding screen or go to My Programs and click 'Share'. + Don't want to share your work anymore? Simply go to 'My Programs' and click 'Unshare'. + If you want more information about the explore page, check out this video. + - title: My achievements + text: |- + If you click on your username in the topright corner of your screen, you can go to My achievements. On this page you achievements are collected. Your students have such a page as well. + When you hover over the badge with your mouse, you'll see how to earn the badge. There are hidden badges too, of which you'll have to find out yourself how to earn them. + If you want more information on the achievements, check out this video. - title: High Scores - text: "On this page you can see the high scores of all Hedy users.\nIn this videoyou can learn some more about the high scores." + text: |- + On this page you can see the high scores of all Hedy users. + In this videoyou can learn some more about the high scores. - title: Debugger - text: "Is your (student's) code not working? There must be a bug (coding mistake) in it! You can use the debugger to find the mistake.\nThe debugger is the ladybug button in your coding screen. If you press it, you can run your code line by line to find your mistake.\nHave you found the mistake? Press the red stop button and the debugger will shut off." + text: |- + Is your (student's) code not working? There must be a bug (coding mistake) in it! You can use the debugger to find the mistake. + The debugger is the ladybug button in your coding screen. If you press it, you can run your code line by line to find your mistake. + Have you found the mistake? Press the red stop button and the debugger will shut off. - title: Read aloud text: Do you want the output of your program to be read aloud? Then you can use the read aloud function that is found under the 'run code' button in your coding screen. - title: Programmers mode - text: "Distracted by all the adventures, or do you want to make a long program? Then check out the 'Programmers Mode' switch at the bottom of your coding screen.\nProgrammers mode allows you and your students to use a bigger coding screen." + text: |- + Distracted by all the adventures, or do you want to make a long program? Then check out the 'Programmers Mode' switch at the bottom of your coding screen. + Programmers mode allows you and your students to use a bigger coding screen. - title: Cheat sheets - text: "In every level there is a button with this emoji 🤔. You and your students can find the \"cheat sheets\" there. On this cheat sheet, you can find all the commands that are usable in this level in their correct form.\nSo if you've forgotten how a command works, simply take a peek at the cheat sheet!" + text: |- + In every level there is a button with this emoji 🤔. You and your students can find the "cheat sheets" there. On this cheat sheet, you can find all the commands that are usable in this level in their correct form. + So if you've forgotten how a command works, simply take a peek at the cheat sheet! - title: Video text: This video shows you even more features of Hedy, like the cheatsheets and the keyword switcher. - key: features - title: Extra Hedy features -- subsections: - - title: What to do after Hedy? - text: "Congratulations on reaching the end of Hedy! Your students have now learned how to create their own basic codes in the Python programming language.\nOf course, you could keep programming in our Hedy compiler, but it might be more exciting for your students to transfer to a \"real\" Python interface.\nWould you like to continue teaching Python? Then please visit the Python website to learn how to get started in another compiler.\n\nNow that your students have a basic knowledge of programming in general, you could also show them around in other textual programming languages. The language might change but the concepts do not, so Hedy will still give them a big advantage." - title: After Hedy +- title: After Hedy key: after -- key: answers - title: Answers to the exercises - intro: "The answers to all the exercises can be found on the public profile of the useraccount 'Hedy_answers'. We often encourage students to use their own creativity in their answers, so these answers are merely a guideline as to what a possible correct answer could look like.\n\nTo go to the 'Hedy_answers' profile, please click here." -- levels: - - sections: - - example: - error_code: Hedy can't print this + subsections: + - title: What to do after Hedy? + text: |- + Congratulations on reaching the end of Hedy! Your students have now learned how to create their own basic codes in the Python programming language. + Of course, you could keep programming in our Hedy compiler, but it might be more exciting for your students to transfer to a "real" Python interface. + Would you like to continue teaching Python? Then please visit the Python website to learn how to get started in another compiler. + + Now that your students have a basic knowledge of programming in general, you could also show them around in other textual programming languages. The language might change but the concepts do not, so Hedy will still give them a big advantage. +- title: Answers to the exercises + key: answers + intro: |- + The answers to all the exercises can be found on the public profile of the useraccount 'Hedy_answers'. We often encourage students to use their own creativity in their answers, so these answers are merely a guideline as to what a possible correct answer could look like. + + To go to the 'Hedy_answers' profile, please click here. +- title: Common mistakes + key: common_mistakes + intro: |- + You can learn from your mistakes, especially in coding! + Making mistakes is unavoidable, and a great opportunity to learn, but for teachers it can be a challenge to find the correct fix for a mistake! + Especially as the codes get longer and longer as the levels progress. That's why we've made a list with frequently made mistakes in each level, and their solutions. + levels: + - level: '1' + sections: + - title: Students forget to type commandos + example: error_text: For example they type a sentence without using print. + error_code: Hedy can't print this solution_text: Teach your students to always start a line of code with a command. solution_code: print Hedy can print this! - title: Students forget to type commandos - - example: - error_code: "Ask Why does my code fail?\nPrint Because I'm using capitals." + - title: Students use capitals when typing commands + example: error_text: Commands won't work if they are in capitals. + error_code: |- + Ask Why does my code fail? + Print Because I'm using capitals. solution_text: Remove the capitals. - solution_code: "ask Why does my code work now?\nprint Because I removed the capitals!" - title: Students use capitals when typing commands - - example: - solution_text: Add an ask command to make it work. + solution_code: |- + ask Why does my code work now? + print Because I removed the capitals! + - title: Students use echo without ask + example: error_text: Echo is made to repeat an answer after an ask command. Without ask echo won't do anything. error_code: echo Your name is - solution_code: "ask What's your name?\necho Your name is" - title: Students use echo without ask - - example: - solution_code: "ask Which programming language is the most fun?\necho The best is..." + solution_text: Add an ask command to make it work. + solution_code: |- + ask What's your name? + echo Your name is + - title: Students want their echo word (variable) to be in the middle of a sentence + example: error_text: And they are right! That's why they will learn to use proper variables in the next level. - error_code: "ask Which programming language is the most fun?\necho is the best!" + error_code: |- + ask Which programming language is the most fun? + echo is the best! solution_text: 'In level 1 we have to keep it at this:' - title: Students want their echo word (variable) to be in the middle of a sentence - - example: - solution_code: "forward 100\nturn 90" + solution_code: |- + ask Which programming language is the most fun? + echo The best is... + - title: 'Turtle: Students let the turtle walk off of the screen' + example: error_text: Often students love to try out big numbers when using the turtle, which causes the arrow to walk off the screen. + error_code: |- + forward 300 + turn 90 solution_text: In the example, students tend to think that the turn command doesn't work. Even though it does work, you can't see it happening off screen. Use smaller numbers to prevent this from happening. - error_code: "forward 300\nturn 90" - title: 'Turtle: Students let the turtle walk off of the screen' - - title: "Turtle: Students use the command backward, but that doesn't exist" + solution_code: |- + forward 100 + turn 90 + - title: 'Turtle: Students use the command backward, but that doesn''t exist' example: - solution_text: 'To make the turtle go backwards, you use the forward command and a negative number. For example:' - error_code: backward 100 error_text: Backward is not a command. + error_code: backward 100 + solution_text: 'To make the turtle go backwards, you use the forward command and a negative number. For example:' solution_code: forward -100 - level: '1' - - sections: - - example: - solution_text: Teach your students to read the error messages. This way they can find out themselves what went wrong. - solution_code: print Don't make typos! + - level: '2' + sections: + - title: Students make typos in their commands + example: error_text: Hedy can't recognize a command with a typo. error_code: prinnt Don't make typos! - title: Students make typos in their commands - - example: - solution_text: In this level you have to tell Hedy where to save your answer, so it can be used later on. This is called a variable. - error_code: ask what would you like to eat? + solution_text: Teach your students to read the error messages. This way they can find out themselves what went wrong. + solution_code: print Don't make typos! + - title: Students forget that the ask command has changed + example: error_text: In this level students learn about variables. The ask command requires a variable as well, but students forget this. + error_code: ask what would you like to eat? + solution_text: In this level you have to tell Hedy where to save your answer, so it can be used later on. This is called a variable. solution_code: order is ask What would you like to eat? - title: Students forget that the ask command has changed - - example: + - title: Students try to use the `{echo}` command + example: + error_text: For some students it might be frustrating to learn that the `{echo}` command doesn't work anymore. That's why it's very important to explain the advantages of using variables. For example you can use multiple variables in a code, and you can put them anywhere you like in a + sentence! + error_code: |- + answer {is} {ask} Why doesn't {echo} work anymore?! + {echo} solution_text: Use a varible instead. - error_text: For some students it might be frustrating to learn that the `{echo}` command doesn't work anymore. That's why it's very important to explain the advantages of using variables. For example you can use multiple variables in a code, and you can put them anywhere you like in a sentence! - solution_code: "answer {is} {ask} Why doens't {echo} work anymore?!\n{print} answer" - error_code: "answer {is} {ask} Why doesn't {echo} work anymore?!\n{echo}" - title: Students try to use the `{echo}` command - - example: - solution_text: So don't use a word you want to use in the text as a variable name. In level 4 this is solved with quotation marks. + solution_code: |- + answer {is} {ask} Why doens't {echo} work anymore?! + {print} answer + - title: Students use a variable name or as a normal word + example: error_text: In the example below the word 'name' is used as a variable, but also as a normal text. The output of this code will be 'Hi my Hedy is Hedy'. - error_code: "name is Hedy\nprint Hi my name is name" - solution_code: "name is Hedy\nprint Hi I'm name" - title: Students use a variable name or as a normal word + error_code: |- + name is Hedy + print Hi my name is name + solution_text: So don't use a word you want to use in the text as a variable name. In level 4 this is solved with quotation marks. + solution_code: |- + name is Hedy + print Hi I'm name - title: Students use long variable names containing two words. example: - solution_text: Add an underscore. error_text: A variable should be named with one word. You could use an underscore to connect two words. That counts as one. - solution_code: chosen_door is ask which door do you pick? error_code: chosen door is ask Which door do you pick? + solution_text: Add an underscore. + solution_code: chosen_door is ask which door do you pick? - title: Students might use two different names for the same variable example: error_text: In this example the student has used 'horse' and 'name' for the same variables. + error_code: |- + horse is ask What is your horse called? + print Your horse is called name solution_text: Always check whether the variable has the same name throughout the code. Slight differences can be hard to spot (for example plurals) but they will interfere with the code. - error_code: "horse is ask What is your horse called?\nprint Your horse is called name" - solution_code: "name is ask What is your horse called?\nprint Your horse is called name" - level: '2' - - sections: + solution_code: |- + name is ask What is your horse called? + print Your horse is called name + - level: '3' + sections: - title: Students try to print whole lists example: - solution_text: To print a list of all the groceries, you simply need to put them after a `{print}` command. Else you can use the list to print one item with `{at}` `{random}`. error_text: A list can't be printed. You can only print one item from the list with {at} {random}. - error_code: "groceries is apples, milk, chocolate\nprint groceries" - solution_code: "{print} apples, milk, chocolate\n\nor\n\ngroceries {is} apples, milk, chocolate\n{print} groceries {at} {random}" - - example: - error_code: "name {is} Hedy\n{print} Hi my name is name\n\nor\n\nanimal {is} rhino, bee, swan\n{print} The best animal is... animal {at} {random}" - solution_text: Don't use the names of variables or lists in regular text to print. In level 4 this problem is solved with quotation marks. + error_code: |- + groceries is apples, milk, chocolate + print groceries + solution_text: To print a list of all the groceries, you simply need to put them after a `{print}` command. Else you can use the list to print one item with `{at}` `{random}`. + solution_code: |- + {print} apples, milk, chocolate + + or + + groceries {is} apples, milk, chocolate + {print} groceries {at} {random} + - title: Students use the name of a variable or list as regular text + example: error_text: This problem probably occured in level 2 as well. Now it can happen with lists too. - solution_code: "name {is} Hedy\n{print} Hi I'm name\n\nor\n\nanimals {is} rhino, bee, swan\n{print} The best animal is... animals {at} {random}" - title: Students use the name of a variable or list as regular text - - example: - solution_text: This problem is solved by adding the word at. - solution_code: "birds {is} sparrow, seagull, robin\n{print} birds {at} {random}" - error_code: "birds is sparrow, seagull, robin\nprint birds random" + error_code: |- + name {is} Hedy + {print} Hi my name is name + + or + + animal {is} rhino, bee, swan + {print} The best animal is... animal {at} {random} + solution_text: Don't use the names of variables or lists in regular text to print. In level 4 this problem is solved with quotation marks. + solution_code: |- + name {is} Hedy + {print} Hi I'm name + + or + + animals {is} rhino, bee, swan + {print} The best animal is... animals {at} {random} + - title: Students forget `{at}` in `{at}` `{random}` + example: error_text: Like in the example - title: Students forget `{at}` in `{at}` `{random}` - - example: + error_code: |- + birds is sparrow, seagull, robin + print birds random + solution_text: This problem is solved by adding the word at. + solution_code: |- + birds {is} sparrow, seagull, robin + {print} birds {at} {random} + - title: Students forget to use the `{print}` command when also using the `{at}` `{random}` command + example: error_text: Or they will sometimes put `{at}` `{random}` at the beginning of the line. + error_code: |- + fruit {is} apple, cherry, banana + fruit {at} {random} solution_text: Emphasize to your students that you always need a print to print text. - solution_code: "fruit {is} apple, cherry, banana\n{print} fruit {at} {random}" - error_code: "fruit {is} apple, cherry, banana\nfruit {at} {random}" - title: Students forget to use the `{print}` command when also using the `{at}` `{random}` command - - example: - solution_code: "pizzas is funghi, tonno, quattro stagioni\nprint pizzas at random" - error_code: "pizzas {is} funghi tonno quattro stagioni\n{print} pizzas {at} {random}" + solution_code: |- + fruit {is} apple, cherry, banana + {print} fruit {at} {random} + - title: Students forget to use commas in their lists + example: error_text: In a list items are seperated with a comma. + error_code: |- + pizzas {is} funghi tonno quattro stagioni + {print} pizzas {at} {random} solution_text: After each item on your list, there should be a comma - title: Students forget to use commas in their lists - - example: - solution_text: Hedy can't print anything at random, because there is no list to choose from. - error_code: "clubs {is} Manchester United\n{print} clubs {at} {random}" + solution_code: |- + pizzas is funghi, tonno, quattro stagioni + print pizzas at random + - title: Students try to use `{at}` `{random}` without a list + example: error_text: For example - solution_code: "clubs {is} Manchester United, Bayrn Munchen, FC Barcelona\n{print} clubs {at} {random}" - title: Students try to use `{at}` `{random}` without a list - - example: - error_code: "names {is} Jake\nyour_name {is} {ask} Who are you?\n{add} your_name {to} names\n{print} names {at} {random}" - solution_text: There has to be a list first, so you have to add a second name to turn names into a list, for example Amy. If you don't want amy on your list, you can use remove to remove it after. + error_code: |- + clubs {is} Manchester United + {print} clubs {at} {random} + solution_text: Hedy can't print anything at random, because there is no list to choose from. + solution_code: |- + clubs {is} Manchester United, Bayrn Munchen, FC Barcelona + {print} clubs {at} {random} + - title: Students try to use add/remove without a list + example: error_text: In the example below 'names' is not a list, but a variable. You cannot add anything to it. - solution_code: "names {is} Jake, Amy\nyour_name {is} {ask} Who are you?\n{add} your_name {to} names\n{print} names {at} {random}" - title: Students try to use add/remove without a list - - example: - solution_code: "adventures is story, parrot, dice\nchoice is Which adventure do you like best?\nadd choice to adventures\nremove dice from adventures\nprint I love adventures at random" - error_code: "adventures {is} story, parrot, dice\nchoice {is} Which adventure do you like best?\n{add} choice\n{remove} dice\n{print} I love adventures {at} {random}" - solution_text: Hedy has to know which list the item should be added to/removed from. + error_code: |- + names {is} Jake + your_name {is} {ask} Who are you? + {add} your_name {to} names + {print} names {at} {random} + solution_text: There has to be a list first, so you have to add a second name to turn names into a list, for example Amy. If you don't want amy on your list, you can use remove to remove it after. + solution_code: |- + names {is} Jake, Amy + your_name {is} {ask} Who are you? + {add} your_name {to} names + {print} names {at} {random} + - title: Students forget to use to/from in add/remove + example: error_text: Without to/from the add/remove command won't work. - title: Students forget to use to/from in add/remove - level: '3' - - sections: - - example: - error_code: "print Hello\nmood is ask 'How are you?" - solution_text: Add the correct quotation marks. + error_code: |- + adventures {is} story, parrot, dice + choice {is} Which adventure do you like best? + {add} choice + {remove} dice + {print} I love adventures {at} {random} + solution_text: Hedy has to know which list the item should be added to/removed from. + solution_code: |- + adventures is story, parrot, dice + choice is Which adventure do you like best? + add choice to adventures + remove dice from adventures + print I love adventures at random + - level: '4' + sections: + - title: Students forget to use quotation marks on both sides of the text + example: error_text: In this level print and ask need a set of quotation marks. One before of the text and one after. - solution_code: "print 'Hello'\nmood is ask 'How are you?'" - title: Students forget to use quotation marks on both sides of the text - - example: - solution_text: 'These are the correct quotation marks:' - solution_code: "print 'Welcome to the restaurant'\nfood is ask 'What would you like to order?'" - error_code: "print `Welcome to the restaurant`\nfood is ask \"What would you like to order?\"" + error_code: |- + print Hello + mood is ask 'How are you? + solution_text: Add the correct quotation marks. + solution_code: |- + print 'Hello' + mood is ask 'How are you?' + - title: Students use the wrong quotation marks + example: error_text: It is important to start your lesson by checking if the students know how to type a quotation mark properly. Else they might use the "double quotes" or the skewed one `. - title: Students use the wrong quotation marks - - example: - error_code: print 'You're not allowed to type this' - solution_code: "print 'Youre allowed to type this'\nprint 'And you`re able to do this'" + error_code: |- + print `Welcome to the restaurant` + food is ask "What would you like to order?" + solution_text: 'These are the correct quotation marks:' + solution_code: |- + print 'Welcome to the restaurant' + food is ask 'What would you like to order?' + - title: Students use an apostrophe in their text + example: error_text: From this level on apostrophes are not allowed. They are often used in English when typing contractions like you're, don't or what's. + error_code: print 'You're not allowed to type this' solution_text: You can choose to use the wrong grammar and just leave the apostrophe out. Or you could use the ` as an apostrophe. - title: Students use an apostrophe in their text - level: '4' - - sections: + solution_code: |- + print 'Youre allowed to type this' + print 'And you`re able to do this' + - level: '5' + sections: - title: Students forget to use `{print}` in an `{if}` command example: - error_code: "if name is Hedy 'Great!'\nelse 'Hedy is better!'" error_text: After students use `{if}` or `{else}` they forget to use a second command like `{print}` or `{ask}`. + error_code: |- + if name is Hedy 'Great!' + else 'Hedy is better!' solution_text: Add the print command to fix it. - solution_code: "if name is Hedy print 'Great!'\nelse print 'Hedy is better!'" + solution_code: |- + if name is Hedy print 'Great!' + else print 'Hedy is better!' - title: Students might use two different names for the same variable example: - solution_text: Always check whether the variable has the same name throughout the code. Slight differences can be hard to spot (for example plurals) but they will interfere with the code. - solution_code: "horse is ask 'What is your horse called'\nif horse is Bonfire print 'cool!'\nelse print 'less cool!'" error_text: In this example the student has used 'horse' and 'name' for the same variables. - error_code: "horse is ask 'What is your horse called?'\nif name is Bonfire print 'cool'\nelse print 'less cool!'" - - example: - solution_code: "if name is Hedy print 'fun'\nelse print 'meh!'" + error_code: |- + horse is ask 'What is your horse called?' + if name is Bonfire print 'cool' + else print 'less cool!' + solution_text: Always check whether the variable has the same name throughout the code. Slight differences can be hard to spot (for example plurals) but they will interfere with the code. + solution_code: |- + horse is ask 'What is your horse called' + if horse is Bonfire print 'cool!' + else print 'less cool!' + - title: Students still forget the quotes on both sides + example: error_text: Codes using the `if` commando can get very long and students tend to forget to use quotes. + error_code: |- + if name is Hedy print fun + else print 'meh! solution_text: Always use 2 quotes in a print command. - error_code: "if name is Hedy print fun\nelse print 'meh!" - title: Students still forget the quotes on both sides - - example: - solution_code: "if name is Hedy print 'fun'\nelse print 'meh!" - solution_text: Remove the quotes to get the code to work. - error_code: "if 'name' is 'Hedy' print 'fun'\nelse print 'meh!'" + solution_code: |- + if name is Hedy print 'fun' + else print 'meh!' + - title: Students use quotes around variable names + example: error_text: In this level there are no quotes around variable names. - title: Students use quotes around variable names - - example: - solution_text: Add an underscore. + error_code: |- + if 'name' is 'Hedy' print 'fun' + else print 'meh!' + solution_text: Remove the quotes to get the code to work. + solution_code: |- + if name is Hedy print 'fun' + else print 'meh! + - title: Students use long variable names containing two words + example: + error_text: A variable should be named with one word. You could use an underscore to connect two words. That counts as one. error_code: chosen door is ask 'Which door do you pick?' + solution_text: Add an underscore. solution_code: chosen_door is ask 'which door do you pick?' - error_text: A variable should be named with one word. You could use an underscore to connect two words. That counts as one. - title: Students use long variable names containing two words - - example: - solution_text: "You could use the `in` command for that. It is explained in a higher level, but it does already work in level 5.\nAnother solution is to use multiple if commands and no else command. The disadvantage is that it won't tell the other classmates that they are not funny." + - title: Students want multiple answers to be correct + example: error_text: For example this student Hedy to tell all his friends that they are funny, but other classmates would be told that they are not. error_code: if name is Jesse, David, Souf print 'You are funny' else print 'You are not funny' - solution_code: "friends is Jesse, David, Souf\nname is ask 'Who are you?'\nif name in friends print 'You are funny'\nelse print 'You are not funny'\n\nor\n\nname is ask 'Who are you?'\nif naam is Jesse print 'You are funny'\nif naam is David print 'You are funny'\nif naam is Souf print 'You are funny'" - title: Students want multiple answers to be correct + solution_text: |- + You could use the `in` command for that. It is explained in a higher level, but it does already work in level 5. + Another solution is to use multiple if commands and no else command. The disadvantage is that it won't tell the other classmates that they are not funny. + solution_code: |- + friends is Jesse, David, Souf + name is ask 'Who are you?' + if name in friends print 'You are funny' + else print 'You are not funny' + + or + + name is ask 'Who are you?' + if naam is Jesse print 'You are funny' + if naam is David print 'You are funny' + if naam is Souf print 'You are funny' - title: The students make the variable name the same as the value in the `{if}` statement example: error_text: In the example below the password is 'password'. This will result in it always being correct. - error_code: "password is ask 'What is the password?'\nif password is password print 'Access granted'\nelse print 'Acces denied!'" + error_code: |- + password is ask 'What is the password?' + if password is password print 'Access granted' + else print 'Acces denied!' solution_text: Pick a different name for your variable. - solution_code: "secret_password {is} {ask} 'What is the password'\n{if} secret_password {is} password {print} 'Access granted!'\n{else} {print} 'Access denied!'" - level: '5' - - sections: + solution_code: |- + secret_password {is} {ask} 'What is the password' + {if} secret_password {is} password {print} 'Access granted!' + {else} {print} 'Access denied!' + - level: '6' + sections: - title: Students struggle with quotation marks example: - solution_code: print 5 + 5 - error_code: print '5 + 5' error_text: Some students struggle with adding quotation marks or not. If you add quotation marks, the output screen will literally show '5+5'. + error_code: print '5 + 5' solution_text: In this code the output screen will print '10'. - - example: - error_code: "age = ask 'How old are you?'\nprint 'Next year you will be ' age + 1" - solution_code: "price = 0\nprint 'Welcome to our burger restaurant'\nburger = ask 'Would you like a burger?'\nif burger = yes price = price + 10\ndrink = ask 'Would you like a drink?'\nif drink = yes price = price + 4\nprint 'That will be ' price ' euros please'" - solution_text: Or take it a step further like this. + solution_code: print 5 + 5 + - title: Students struggle with the concept of doing maths with a variable + example: error_text: 'Some students will find it hard to do maths with variables. Try to show them very simple examples, like:' - title: Students struggle with the concept of doing maths with a variable - level: '6' - - sections: - - example: + error_code: |- + age = ask 'How old are you?' + print 'Next year you will be ' age + 1 + solution_text: Or take it a step further like this. + solution_code: |- + price = 0 + print 'Welcome to our burger restaurant' + burger = ask 'Would you like a burger?' + if burger = yes price = price + 10 + drink = ask 'Would you like a drink?' + if drink = yes price = price + 4 + print 'That will be ' price ' euros please' + - level: '7' + sections: + - title: Students forget one of the word of the repeat command, or they forget the print command + example: error_text: Make sure that the students know to use both the full repeat command and the print command. + error_code: |- + repeat 3 times 'For he`s a jolly good fellow' + repeat 3 print 'Which nobody can deny!' solution_text: 'This is the correct code:' - error_code: "repeat 3 times 'For he`s a jolly good fellow'\nrepeat 3 print 'Which nobody can deny!'" - solution_code: "repeat 3 times print 'For he`s a jolly good fellow'\nrepeat 3 times print 'Which nobody can deny!'" - title: Students forget one of the word of the repeat command, or they forget the print command - - example: - solution_text: You should go to the next level to be able to repeat multiple lines. So on this level you'll have to print everything seperately. - solution_code: "drink = ask 'What would you like to drink?'\nprint drink\ndrink = ask 'What would you like to drink?'\nprint drink\ndrink = ask 'What would you like to drink?'\nprint drink" - error_code: "repeat 3 times drink = ask 'What would you like to drink?'\nprint drink" + solution_code: |- + repeat 3 times print 'For he`s a jolly good fellow' + repeat 3 times print 'Which nobody can deny!' + - title: Students try to repeat multiple lines + example: error_text: In this level you can only repeat one line of code multiple times. In this code the student wanted to print 3 different drinks, but it won't work. It will ask the question 3 times and only print the last answer. - title: Students try to repeat multiple lines - - example: - solution_code: repeat 20 times print 'This is enough' + error_code: |- + repeat 3 times drink = ask 'What would you like to drink?' + print drink + solution_text: You should go to the next level to be able to repeat multiple lines. So on this level you'll have to print everything seperately. + solution_code: |- + drink = ask 'What would you like to drink?' + print drink + drink = ask 'What would you like to drink?' + print drink + drink = ask 'What would you like to drink?' + print drink + - title: Students make programs that take too long to run + example: + error_text: In this level it's very easy to make long codes. The students aren't allowed to make programs that take to long to load (to save our servers). error_code: repeat 100 times print 'How many times can I repeat this?' solution_text: Make sure the codes aren't too long - error_text: In this level it's very easy to make long codes. The students aren't allowed to make programs that take to long to load (to save our servers). - title: Students make programs that take too long to run - level: '7' - - sections: - - example: - error_code: "repeat 3 times\nprint 'hello'" - solution_text: 'This is the correct code:' + solution_code: repeat 20 times print 'This is enough' + - level: '8' + sections: + - title: Students use the indentation wrong + example: error_text: Indentation is a new concept in this level, that is hard to use for some students. Make sure they practise some simple codes before making a whole program with it. - solution_code: "repeat 3 times\n print 'hello'" - title: Students use the indentation wrong + error_code: |- + repeat 3 times + print 'hello' + solution_text: 'This is the correct code:' + solution_code: |- + repeat 3 times + print 'hello' - title: Students only repeat 1 line when they wanted to repeat multiple lines example: - solution_text: "In the correct code the third line starts with indentation too. This way it belongs to the repeat block and therefore it will be repeated 3 times.\nShowing your students these differences can help them understand why we need indentation to make our programs work." - solution_code: "repeat 3 times\n drink = ask 'What would you like to drink?'\n print drink" - error_code: "repeat 3 times\n drink = ask 'What would you like to drink?'\nprint drink" error_text: For instance, in the code below the student wanted to take the drinks order of 3 people. But instead the program asked 3 times, but only wrote down one order. - - example: - error_code: "birthday = ask 'Is it you birthday?'\nif birthday = yes\n repeat 3 times\n print 'Hip Hip Hooray!'" - solution_code: "birthday = ask 'Is it you birthday?'\nif birthday = yes\n print 'Hip Hip Hooray!'\n print 'Hip Hip Hooray!'\n print 'Hip Hip Hooray!'" + error_code: |- + repeat 3 times + drink = ask 'What would you like to drink?' + print drink + solution_text: |- + In the correct code the third line starts with indentation too. This way it belongs to the repeat block and therefore it will be repeated 3 times. + Showing your students these differences can help them understand why we need indentation to make our programs work. + solution_code: |- + repeat 3 times + drink = ask 'What would you like to drink?' + print drink + - title: Students want to nest `{if}` statements, or put `{if}` statements inside a loop + example: + error_text: |- + In this level students aren't allowed yet to put `{if}` statements inside other `{if}` statements or inside repeat loops. + In the next level this is allowed. + error_code: |- + birthday = ask 'Is it you birthday?' + if birthday = yes + repeat 3 times + print 'Hip Hip Hooray!' solution_text: 'This is the correct code for this level:' - error_text: "In this level students aren't allowed yet to put `{if}` statements inside other `{if}` statements or inside repeat loops.\nIn the next level this is allowed." - title: Students want to nest `{if}` statements, or put `{if}` statements inside a loop + solution_code: |- + birthday = ask 'Is it you birthday?' + if birthday = yes + print 'Hip Hip Hooray!' + print 'Hip Hip Hooray!' + print 'Hip Hip Hooray!' - title: Students make programs that take too long to run example: error_text: In this level it's very easy to make long codes. The students aren't allowed to make programs that take to long to load (to save our servers). - solution_code: "repeat 20 times\n print 'This is enough'" + error_code: |- + repeat 100 times + print 'How many times can I repeat this?' solution_text: Make sure the codes aren't too long - error_code: "repeat 100 times\n print 'How many times can I repeat this?'" - - example: - error_text: "We have seen this mistake by some of our students. They make a password for their computer, but they make the password 'password'.\nIn line 2 the computer is asked to check whether the variable password is the same as the variable password, so itself. Which means the answer is always yes.\nSo with this code the answer will always be 'You can come in' no matter what the player fills in." + solution_code: |- + repeat 20 times + print 'This is enough' + - title: Students use the `{if}` command to check if the variable value is the same as the variable name + example: + error_text: |- + We have seen this mistake by some of our students. They make a password for their computer, but they make the password 'password'. + In line 2 the computer is asked to check whether the variable password is the same as the variable password, so itself. Which means the answer is always yes. + So with this code the answer will always be 'You can come in' no matter what the player fills in. + error_code: |- + password is ask 'What is the password?' + if password is password + print 'You can come in' + else + print 'You are not allowed' solution_text: You can fix this mistake by adding quotation marks. This way the computer knows that the second password in `{if} password {is} 'password'` is a string value (so normal text) and not the variable name. - error_code: "password is ask 'What is the password?'\nif password is password\n print 'You can come in'\nelse\n print 'You are not allowed'" - solution_code: "password is ask 'What is the password?'\nif password is 'password'\n print 'You can come in'\nelse\n print 'You are not allowed'" - title: Students use the `{if}` command to check if the variable value is the same as the variable name - level: '8' - - sections: - - example: - solution_text: This is the correct code. Try to keep track of all the different constructions when putting `{if}` statements inside other `{if}` statements. + solution_code: |- + password is ask 'What is the password?' + if password is 'password' + print 'You can come in' + else + print 'You are not allowed' + - level: '9' + sections: + - title: Students make mistakes with indentation + example: error_text: The hardest part about this level is getting the indentation right. Students love nesting `{if}` statements, sometimes even inside other nested `{if}` statements. Keeping track of indentation can get pretty tough. - solution_code: "print 'Robin is walking downtown'\nlocation = ask 'Is Robin going into a shop, or does she go home?'\nif location is shop\n print 'She enters the shop.'\n print 'Robin sees an interesting looking book'\n book = ask 'Does Robin buy the book?'\n if book is yes\n print 'Robin buys the book and goes home'\n else\n print 'Robin leaves the shop and goes home'\nelse\n print 'Robin goes home'" - error_code: "print 'Robin is walking downtown'\nlocation = ask 'Is Robin going into a shop, or does she go home?'\nif location is shop\n print 'She enters the shop.'\n print 'Robin sees an interesting looking book'\n book = ask 'Does Robin buy the book?'\n if book is yes\nprint 'Robin buys the book and goes home'\nelse\n print 'Robin leaves the shop and goes home'\nelse\n print 'Robin goes home'" - title: Students make mistakes with indentation - level: '9' - - sections: - - example: + error_code: |- + print 'Robin is walking downtown' + location = ask 'Is Robin going into a shop, or does she go home?' + if location is shop + print 'She enters the shop.' + print 'Robin sees an interesting looking book' + book = ask 'Does Robin buy the book?' + if book is yes + print 'Robin buys the book and goes home' + else + print 'Robin leaves the shop and goes home' + else + print 'Robin goes home' + solution_text: This is the correct code. Try to keep track of all the different constructions when putting `{if}` statements inside other `{if}` statements. + solution_code: |- + print 'Robin is walking downtown' + location = ask 'Is Robin going into a shop, or does she go home?' + if location is shop + print 'She enters the shop.' + print 'Robin sees an interesting looking book' + book = ask 'Does Robin buy the book?' + if book is yes + print 'Robin buys the book and goes home' + else + print 'Robin leaves the shop and goes home' + else + print 'Robin goes home' + - level: '10' + sections: + - title: Students do not use the for command correctly + example: error_text: We often see that students try to print the list (in the example animals) instead of the items of the list. + error_code: |- + animals is dog, cat, blobfish + for animal in animals + print 'I love ' animals solution_text: The word animals in the last line should be changed into animal. - error_code: "animals is dog, cat, blobfish\nfor animal in animals\n print 'I love ' animals" - solution_code: "animals is dog, cat, blobfish\nfor animal in animals\n print 'I love ' animal" - title: Students do not use the for command correctly - - example: - solution_text: You should use indentation after a for command. + solution_code: |- + animals is dog, cat, blobfish + for animal in animals + print 'I love ' animal + - title: Students forget the indentation + example: error_text: Students tend to forget to use indentation after a for command. - error_code: "animals is dog, cat, blobfish\nfor animal in animals\nprint 'I love ' animals" - solution_code: "animals is dog, cat, blobfish\nfor animal in animals\n print 'I love ' animal" - title: Students forget the indentation - level: '10' - - sections: + error_code: |- + animals is dog, cat, blobfish + for animal in animals + print 'I love ' animals + solution_text: You should use indentation after a for command. + solution_code: |- + animals is dog, cat, blobfish + for animal in animals + print 'I love ' animal + - level: '11' + sections: - title: Students forget to use indentation example: - solution_code: "for i in range 1 to 5\n print i" - solution_text: 'This is the correct code:' error_text: Make sure that the students use indentation. - error_code: "for i in range 1 to 5\nprint i" + error_code: |- + for i in range 1 to 5 + print i + solution_text: 'This is the correct code:' + solution_code: |- + for i in range 1 to 5 + print i - title: Students don't understand the i example: - error_text: "Some students don't understand that i is a variable. i is chosen, because it is used in Python programming, but you could just as easily use a different variable name.\nFor example, this code:" + error_text: |- + Some students don't understand that i is a variable. i is chosen, because it is used in Python programming, but you could just as easily use a different variable name. + For example, this code: + error_code: |- + for i in range 1 to 5 + print i solution_text: Could just as well be replaced with this code. It works the same. - solution_code: "for banana in range 1 to 5\n print banana" - error_code: "for i in range 1 to 5\nprint i" - level: '11' - - sections: + solution_code: |- + for banana in range 1 to 5 + print banana + - level: '12' + sections: - title: Students forget quotation marks example: - solution_code: "superheroes = 'Spiderman', 'Batman', 'Iron Man'\nsuperhero = superheroes {at} {random}\n{if} superhero {is} 'Batman'\n {print} 'IM BATMAN!'" error_text: Students need more quotation marks now than in the previous levels. In this example quotation marks were forgotten in the list and in the `{if}` command. - error_code: "superheroes = Spiderman, Batman, Iron Man\nsuperhero = superheroes {at} {random}\n{if} superhero = Batman\n {print} 'IM BATMAN!'" + error_code: |- + superheroes = Spiderman, Batman, Iron Man + superhero = superheroes {at} {random} + {if} superhero = Batman + {print} 'IM BATMAN!' solution_text: 'This is the correct code:' + solution_code: |- + superheroes = 'Spiderman', 'Batman', 'Iron Man' + superhero = superheroes {at} {random} + {if} superhero {is} 'Batman' + {print} 'IM BATMAN!' - title: Students use quotation marks on numbers they want to use for calculations example: - error_text: "You can use quotation marks on numbers, but only if you want the computer to think of them as text. This means you can't do calculations with the number.\nIn the example below, you can't do maths with the number 25, because it's in quotation marks." - solution_code: "score = 25\nanswer is ask 'Do you want a point?'\nif answer is 'yes'\n score = score + 1\n print score" + error_text: |- + You can use quotation marks on numbers, but only if you want the computer to think of them as text. This means you can't do calculations with the number. + In the example below, you can't do maths with the number 25, because it's in quotation marks. + error_code: |- + score = '25' + answer is ask 'Do you want a point?' + if answer is 'yes' + score = score + 1 + print score solution_text: 'This is the correct code:' - error_code: "score = '25'\nanswer is ask 'Do you want a point?'\nif answer is 'yes'\n score = score + 1\n print score" - - example: + solution_code: |- + score = 25 + answer is ask 'Do you want a point?' + if answer is 'yes' + score = score + 1 + print score + - title: Students use commas instead of periods in decimal numbers + example: + error_text: Decimal numbers can be used from this level on, but you can't use commas. error_code: print 2,5 + 2,5 solution_text: 'This is the correct code:' solution_code: print 2.5 + 2.5 - error_text: Decimal numbers can be used from this level on, but you can't use commas. - title: Students use commas instead of periods in decimal numbers - level: '12' - - sections: - - example: - solution_code: "game is ask 'Do you want to play a game?'\ntime is ask 'Do you have time to play?'\nif game is 'yes' and time is 'yes'\n print 'Lets play!'" + - level: '13' + sections: + - title: Students confuse `and` with `or` + example: error_text: Both commands might appear similar, but their functions are very different. - error_code: "game is ask 'Do you want to play a game?'\ntime is ask 'Do you have time to play?'\nif game is 'yes' or time is 'yes'\n print 'Lets play!'" + error_code: |- + game is ask 'Do you want to play a game?' + time is ask 'Do you have time to play?' + if game is 'yes' or time is 'yes' + print 'Lets play!' solution_text: In this case, the person should answer yes on both questions, so you should use `and`. - title: Students confuse `and` with `or` - level: '13' - - sections: - - example: - solution_text: 'This is the correct code:' + solution_code: |- + game is ask 'Do you want to play a game?' + time is ask 'Do you have time to play?' + if game is 'yes' and time is 'yes' + print 'Lets play!' + - level: '14' + sections: + - title: Students confuse the < and > signs + example: error_text: Often, students are already familiar with these signs from maths class. But if your students don't know these signs yet, they might have a challenge with it. - error_code: "age = ask 'How old are you?'\nif age < 12\n print 'You are older than I am!'" - solution_code: "age = ask 'How old are you?'\nif age > 12\n print 'You are older than I am!'" - title: Students confuse the < and > signs - - example: - error_text: These signs are probably new for most students. Make sure to explain these signs to your students. + error_code: |- + age = ask 'How old are you?' + if age < 12 + print 'You are older than I am!' solution_text: 'This is the correct code:' - solution_code: "name = ask 'What is your name?'\nif name != 'Hedy'\n print 'You are not Hedy'" - error_code: "name = ask 'What is your name?'\nif name =< 'Hedy'\n print 'You are not Hedy'" - title: Students use the wrong signs for `!=` `<=` and `>=` - - example: + solution_code: |- + age = ask 'How old are you?' + if age > 12 + print 'You are older than I am!' + - title: Students use the wrong signs for `!=` `<=` and `>=` + example: + error_text: These signs are probably new for most students. Make sure to explain these signs to your students. + error_code: |- + name = ask 'What is your name?' + if name =< 'Hedy' + print 'You are not Hedy' solution_text: 'This is the correct code:' - error_code: "name = ask 'What is your name?'\nif name = 'Hedy'\n print 'You are cool!'" - solution_code: "name = ask 'What is your name?'\nif name == 'Hedy'\n print 'You are cool!'" + solution_code: |- + name = ask 'What is your name?' + if name != 'Hedy' + print 'You are not Hedy' + - title: Students forget to use the == sign + example: error_text: In this level, students are still allowed to use = or is. But on other levels, or in python, they might get in trouble for that. So it is best to train them to use it. - title: Students forget to use the == sign - level: '14' - - sections: - - example: - solution_code: "answer = 0\nwhile answer != 25\n answer = ask 'What is 5 times 5?'\nprint 'A correct answer has been given'" + error_code: |- + name = ask 'What is your name?' + if name = 'Hedy' + print 'You are cool!' solution_text: 'This is the correct code:' + solution_code: |- + name = ask 'What is your name?' + if name == 'Hedy' + print 'You are cool!' + - level: '15' + sections: + - title: Students forget indentation in the while loop + example: error_text: Indentation is often hard for students. - error_code: "answer = 0\nwhile answer != 25\nanswer = ask 'What is 5 times 5?'\nprint 'A correct answer has been given'" - title: Students forget indentation in the while loop - level: '15' - - sections: + error_code: |- + answer = 0 + while answer != 25 + answer = ask 'What is 5 times 5?' + print 'A correct answer has been given' + solution_text: 'This is the correct code:' + solution_code: |- + answer = 0 + while answer != 25 + answer = ask 'What is 5 times 5?' + print 'A correct answer has been given' + - level: '16' + sections: - title: Students forget the brackets example: - solution_text: 'This is the correct code:' - error_code: "icecream = 'starwberry', 'chocolate'\nprint 'I love ' icecream[random] ' icecream'" - solution_code: "icecream = ['starwberry', 'chocolate']\nprint 'I love ' icecream[random] ' icecream'" error_text: From this level on lists should be in brackets. - - example: - solution_code: "icecream = ['starwberry', 'chocolate']\nprint 'I love ' icecream[random] ' icecream'" - error_code: "icecream = ('starwberry', 'chocolate'}\nprint 'I love ' icecream[random] ' icecream'" + error_code: |- + icecream = 'starwberry', 'chocolate' + print 'I love ' icecream[random] ' icecream' + solution_text: 'This is the correct code:' + solution_code: |- + icecream = ['starwberry', 'chocolate'] + print 'I love ' icecream[random] ' icecream' + - title: Students use the wrong brackets + example: error_text: From this level on lists should be in brackets. + error_code: |- + icecream = ('starwberry', 'chocolate'} + print 'I love ' icecream[random] ' icecream' solution_text: 'This is the correct code:' - title: Students use the wrong brackets - - example: - solution_code: "icecream = ['starwberry', 'chocolate']\nprint 'I love ' icecream[random] ' icecream'" - error_code: "icecream = [starwberry, chocolate]\nprint 'I love ' icecream[random] ' icecream'" + solution_code: |- + icecream = ['starwberry', 'chocolate'] + print 'I love ' icecream[random] ' icecream' + - title: Students forget the quotation marks while focussing on the brackets + example: error_text: Students are sometimes very focussed on the new aspect of the syntax, that they forget the quotation marks. + error_code: |- + icecream = [starwberry, chocolate] + print 'I love ' icecream[random] ' icecream' solution_text: 'This is the correct code:' - title: Students forget the quotation marks while focussing on the brackets - - example: - solution_code: "icecream = ['starwberry', 'chocolate']\nprint 'I love ' icecream[random] ' icecream'" - error_code: "icecream = [starwberry, chocolate]\nprint 'I love ' icecream at random ' icecream'" + solution_code: |- + icecream = ['starwberry', 'chocolate'] + print 'I love ' icecream[random] ' icecream' + - title: Students still use the old at random command + example: error_text: Students are sometimes very focussed on the new aspect of the syntax, that they forget the quotation marks. + error_code: |- + icecream = [starwberry, chocolate] + print 'I love ' icecream at random ' icecream' solution_text: 'This is the correct code:' - title: Students still use the old at random command - - example: - error_code: "icecream = [starwberry, chocolate]\nprint 'I love ' icecream[random] ' icecream'" + solution_code: |- + icecream = ['starwberry', 'chocolate'] + print 'I love ' icecream[random] ' icecream' + - title: Students forget the quotation marks while focussing on the brackets + example: error_text: Students are sometimes very focussed on the new aspect of the syntax, that they forget the quotation marks. - solution_code: "icecream = ['starwberry', 'chocolate']\nprint 'I love ' icecream[random] ' icecream'" - solution_text: 'This is the correct code:' - title: Students forget the quotation marks while focussing on the brackets - level: '16' - - sections: - - example: + error_code: |- + icecream = [starwberry, chocolate] + print 'I love ' icecream[random] ' icecream' solution_text: 'This is the correct code:' - solution_code: "color = {ask} 'What is your favorite color?'\n{if} color == 'green':\n {print} 'green is nice'\n{elif} color == yellow:\n {print} 'yellow is alright'\n{else}:\n {print} 'I like green'" - error_code: "color = ask 'What is your favorite color?'\n{if} color == 'green':\n {print} 'green is nice'\n{elif}:\n {print} 'I like green'" + solution_code: |- + icecream = ['starwberry', 'chocolate'] + print 'I love ' icecream[random] ' icecream' + - level: '17' + sections: + - title: Students use `{elif}` like `{else}`, so without a condition + example: error_text: The `{elif}` command needs a condition behind it. It cannot be used like `{else}`, without a condition. - title: Students use `{elif}` like `{else}`, so without a condition - - example: - error_code: "answer = ask 'How are you doing?'\n{if} answer {is} 'great'\n {print} 'Me too!'\n{elif} answer {is} 'bad'\n {print} 'Let me cheer you up!'\n{else}\n {print} 'Im great!'" + error_code: |- + color = ask 'What is your favorite color?' + {if} color == 'green': + {print} 'green is nice' + {elif}: + {print} 'I like green' + solution_text: 'This is the correct code:' + solution_code: |- + color = {ask} 'What is your favorite color?' + {if} color == 'green': + {print} 'green is nice' + {elif} color == yellow: + {print} 'yellow is alright' + {else}: + {print} 'I like green' + - title: Students forget the colon + example: error_text: After each command that requires indentation, a colon should be used. - solution_code: "answer = ask 'How are you doing?'\nif answer is 'great':\n print 'Me too!'\nelif answer is 'bad':\n print 'Let me cheer you up!'\nelse:\n print 'Im great!'" + error_code: |- + answer = ask 'How are you doing?' + {if} answer {is} 'great' + {print} 'Me too!' + {elif} answer {is} 'bad' + {print} 'Let me cheer you up!' + {else} + {print} 'Im great!' solution_text: 'This is the correct code:' - title: Students forget the colon - level: '17' - - sections: - - example: + solution_code: |- + answer = ask 'How are you doing?' + if answer is 'great': + print 'Me too!' + elif answer is 'bad': + print 'Let me cheer you up!' + else: + print 'Im great!' + - level: '18' + sections: + - title: Students forget to use the brackets + example: error_text: Students will forget to put brackets around their text. - solution_code: print('my name is Hedy!') - solution_text: 'This is the correct code:' error_code: print 'my name is Hedy!' - title: Students forget to use the brackets - - example: - error_code: "print('My name is Hedy!')\nname = ask('What is your name?')\nprint('So your name is ', name)" - solution_code: "print('My name is Hedy!')\nname = input('What is your name?')\nprint('So your name is ', name)" solution_text: 'This is the correct code:' + solution_code: print('my name is Hedy!') + - title: Students will still use the ask command + example: error_text: The ask command has been used since level 1. So it might be hard for the students to switch to input instead of ask. - title: Students will still use the ask command - - example: + error_code: |- + print('My name is Hedy!') + name = ask('What is your name?') + print('So your name is ', name) solution_text: 'This is the correct code:' - solution_code: "temperature = 25\nprint('It is ', temperature, 'degrees outside')" - error_code: "temperature = 25\nprint('It is ') temperature ('degrees outside')" + solution_code: |- + print('My name is Hedy!') + name = input('What is your name?') + print('So your name is ', name) + - title: Students might use the brackets as quotation marks + example: error_text: They have learned to keep the variables outside of the quotation marks, so they might do the same with the brackets. Which is not the correct way to use them. - title: Students might use the brackets as quotation marks - level: '18' - intro: "You can learn from your mistakes, especially in coding!\nMaking mistakes is unavoidable, and a great opportunity to learn, but for teachers it can be a challenge to find the correct fix for a mistake!\nEspecially as the codes get longer and longer as the levels progress. That's why we've made a list with frequently made mistakes in each level, and their solutions." - title: Common mistakes - key: common_mistakes -home-sections: -- title: Textual programming made easy! - text: "Many schools and teachers around the world want to teach their students programming. Initially this is often done with playful tools, ranging from the Beebot robot to\nScratch Junior or Scratch. After using such tools, kids often want to move to more powerful, textual programming languages, like Python.\n\nPython however is hard, because it is only available in English, and requires learners to learn complex programming concepts and syntax at once.\nHedy is the easy way to get started with textual programming languages! Hedy is free to use, open source, and unlike any other textual programming language in three ways.\n\n1. Hedy is multi-lingual, you can use Hedy in your own language\n2. Hedy is gradual, so you can learn one concept and its syntax a time\n3. Hedy is built for the classroom, allowing teachers to fully customize their student's experience" -- text: While almost all textual programming language have keywords in English, such as `for` or `repeat`, Hedy can be used in any language! We currently support 47 different languages, including Dutch, Spanish, Arabic, Turkish, Chinese and Hindi. If your language is not available you can always start a new translation. - title: Multi-lingual programming -- text: Learning a programming language can be overwhelming, since learners have to learn concepts (for example if-else or loops) and syntax (like quotation marks or round brackets) at the same time. In Hedy, concepts are first introduced with little syntax and then refined. A scientifically proven way to learn! - title: Step by step learning -- text: "Hedy is suitable for kids aged 10 and up and designed for classroom use.\nTeachers can use our free, built-in lesson plans, but can also author their own lessons and load these into the Hedy user interface." - title: Built for the classroom -- title: Programming in context - text: Hedy shows programming in the broadest way possible, and can be used in variety of exciting ways. Hedy allows for the creation of digital and interactive stories, colorful drawings that can be shown on the screen but also drawn with a pen plotter or embroidered on a shirt, and can be used to create games or apps with buttons and keyboard actions. -- text: "Yes! Hedy is 'Open source', which means that everyone can help us make Hedy better.\nYou can find our code on Github.\nIf you like Hedy and want to contribute, we accept (and are very grateful for) donations!" - title: Is Hedy free? -- title: Do I need to install anything? - text: No. Hedy works in the browser, which is the program you are using to look at this page. Probably Chrome or Edge or Firefox. Hedy also works on phones and tablets. -- text: "No, that is not needed. All concepts are explained in the slides and in the interface for learners.\nIf you create a free teacher's account, you also get access to the teacher's manual with information on how to teach\nand frequently made mistakes." - title: Do I need programming experience to teach with Hedy? -join-sections: -- text: '# There are three ways in which you can support Hedy!' - title: Supporting Hedy -- title: Improving the language - text: "The gradual and multi-lingual nature of Hedy create a lot of interesting technical challenges.\nFind those issues on Github." -- title: Translating Hedy - text: "Not a programmer? No problem! Another way to support Hedy is by translating keywords, error messages, adventures and other content.\nThis is the current status, help us complete a language, or add a new one!\n\n\"Translation" -- text: "Hedy is designed to support teachers in providing programming lessons in class. We have specific teacher features like the option to create a class, customize it and see how your students are doing.\nIf you like Hedy, you can reach out to schools that you know to help teachers get started! We can help you find schools or teachers via Discord." - title: Help teachers get started -title: Hedy documentation -learn-more-sections: -- title: Join the Hedy Community - text: "We love to hear from you! The best way to get in touch with us is by joining our Discord server.\n\nYou can also [send us an email](mailto:hello@hedy.org \"About Hedy\").\n\nTo stay on top of the latest news, [subscribe to our newsletter](/subscribe)." -- title: A deep dive! - text: "Want to know more about Hedy's philosophy and design? Check out this talk Felienne gave at the StrangeLoop Conference in 2022:\n\n" -- title: Hedy in the news - text: "Some websites and newspapers have written about Hedy since our release in early 2020. We keep a list here:\n* [Java Magazine 04.2023](images/Hedy_Javamagazine2023.pdf)\n* [Tech Optimism - A Solution to the IT Shortage (Dutch), August 2022](https://pom.show/2022/08/12/een-oplossing-voor-het-it-tekort/)\n* [Codeweek Podcast, July 2022](https://codeweek.eu/podcast/26)\n* [Heise.de (German), Januari 2022](https://www.heise.de/news/Hedy-die-mitwachsende-Programmiersprache-6336264.html)\n* [Strumenta, November 2021](https://tomassetti.me/teaching-programming-with-hedy/)\n* [Vives (Dutch), CodeWeek Special October 2021](images/Vives-174-Codeweek.pdf)\n* [CodeWeek.eu - Haunted House Challenge, September 2021](https://codeweek.eu/2021/challenges/haunted-house)\n* [Opensource.com, April 2021](https://opensource.com/article/21/4/hedy-teach-code)\n* [IO Magazine, April 2021](https://ict-research.nl/wordpress/wp-content/uploads/2021/04/IO-magazine-NR1-2021_web.pdf)\n* [Ingeniería De Software (Spanish), February 2021](https://ingenieriadesoftware.es/hedy-mejor-lenguaje-ensenar-programacion-ninos/)\n* [Hello World Magazine, February 2021](images/Hello_World_15_Hedy.pdf)\n* [Discoro, January 2021](https://discoro.wordpress.com/2021/01/09/hedy-gradually-learning-a-programming-language/)\n* [Felienne wins the Dutch award for ICT research for Hedy, January 2021](https://www.nwo.nl/en/news/felienne-hermans-receives-dutch-prize-ict-research-2021)\n* [SlashDot, August 2020](https://news.slashdot.org/story/20/08/17/024248/scientist-proposes-a-new-programming-language-for-teaching-coding-and-python)\n* [GenBeta (Spanish), August 2020](https://www.genbeta.com/desarrollo/nuevo-lenguaje-para-ensenar-programacion-a-ninos-como-se-ensena-a-leer-escribir-forma-gradual-niveles)\n* [Developpez (French), August 2020](https://programmation.developpez.com/actu/308095/Une-scientifique-propose-un-nouveau-langage-de-programmation-pour-enseigner-aux-enfants-le-codage-informatique-au-travers-d-une-approche-graduelle-implementee-en-Python-sur-13-paliers/)\n* [Vives (Dutch), October 2020](images/artikel_vives.pdf) \"Met Hedy stap voor stap leren programmeren\"\n* [Leiden University, April 2020](https://www.universiteitleiden.nl/en/news/2020/03/looking-to-distract-the-kids-while-you-work-from-home-get-them-programming)\n* [Mare (Dutch), April 2020](https://www.mareonline.nl/cultuur/computercode-voor-de-kids/)\n* [AG Connect (Dutch), April 2020](https://www.agconnect.nl/artikel/stapsgewijs-python-leren-programmeren-met-nieuwe-taal-hedy)" + error_code: |- + temperature = 25 + print('It is ') temperature ('degrees outside') + solution_text: 'This is the correct code:' + solution_code: |- + temperature = 25 + print('It is ', temperature, 'degrees outside') start-sections: -- text: '*Something about teachers accounts, slides etc*' - title: Getting started with Hedy -- text: "

Simple interface and good examples.

\nTeacher: 3rd - 6th grades (elementary)\n\n

Multilingual programming and just the gradual programming concept itself.

\nUS: middle school, 6th-8th grade\n\n

The gradual nature of introducing programming.

\nAustralia: High school\n\n

Continues automatically.

\nNetherlands: 2 HAVO-VWO\n\n

Both that the explanation can be in Dutch (and the code in English), and that it builds up with more \nand more possibilities.

\nNetherlands: Plus class group 7\n\n

But Hedy and its gradual levels... what an idea, \nI wanted to personally thank you for creating this. I cannot thank you enough. Also, I have never seen the level of engagement and enthusiasm of my \nstudents, as I have seen with Hedy. We have covered till level 5, and plan to spend one more week on it in classes and labs, \nbefore starting Python.

\nPakistan\n \n

The 'realness' of programming, it resembles how it is in reality.

\nNetherlands: Plus class group 4 to 8\n\n

Step-by-step activities. Fun activities.

\nNetherlands: 1e All levels, 2e VWO/HAVO 2e VWO +, 3e HAVO 3e VWO\n\n

I really like Hedy very much and it is also nicely set up, which makes it good to use in primary school. \nHedy's gradual approach works very well. \nThe short explanation at the beginning of each level and the short example programs help to give the children a quick insight into what is new in the chosen level. \nThe different assignments that the children can choose also work very well. \nYou see the children choose assignments that appeal to them and they then get to work with them, \nthrough the levels. Hedy is great fun for children who are good at programming and want to get a \ntaste of a real programming language. It is good preparation for secondary school as soon as more ICT \neducation is given there.

\nNetherlands: Oegstgeest Montessori school\n\n

The construction is so good.

\nNetherlands: Lower secondary school HAVO-VWO\n\n

I can keep the pace of the class.

\nNetherlands: group 7 en 8\n\n\n

Felienne teaching kids

\n\n\n

Kids learning about Hedy

" - title: What other teachers say about Hedy +- title: Getting started with Hedy + text: '*Something about teachers accounts, slides etc*' +- title: What other teachers say about Hedy + text: "

Simple interface and good examples.

\nTeacher: 3rd - 6th grades (elementary)\n\n

Multilingual programming and just the gradual programming concept itself.

\nUS: middle school, 6th-8th grade\n\n

The gradual nature of introducing programming.

\nAustralia: High school\n\n

Continues automatically.

\nNetherlands: 2 HAVO-VWO\n\n

Both that the explanation can be in Dutch (and the code in English), and that it builds\ + \ up with more \nand more possibilities.

\nNetherlands: Plus class group 7\n\n

But Hedy and its gradual levels... what an idea, \nI wanted to personally thank you for creating this. I cannot thank you enough. Also, I have never seen the level of engagement and\ + \ enthusiasm of my \nstudents, as I have seen with Hedy. We have covered till level 5, and plan to spend one more week on it in classes and labs, \nbefore starting Python.

\nPakistan\n \n

The 'realness' of programming, it resembles how it is in reality.\ + \

\nNetherlands: Plus class group 4 to 8\n\n

Step-by-step activities. Fun activities.

\nNetherlands: 1e All levels, 2e VWO/HAVO 2e VWO +, 3e HAVO 3e VWO\n\n

I really like Hedy very much and it is also nicely set up, which\ + \ makes it good to use in primary school. \nHedy's gradual approach works very well. \nThe short explanation at the beginning of each level and the short example programs help to give the children a quick insight into what is new in the chosen level. \nThe different assignments that the children\ + \ can choose also work very well. \nYou see the children choose assignments that appeal to them and they then get to work with them, \nthrough the levels. Hedy is great fun for children who are good at programming and want to get a \ntaste of a real programming language. It is good preparation\ + \ for secondary school as soon as more ICT \neducation is given there.

\nNetherlands: Oegstgeest Montessori school\n\n

The construction is so good.

\nNetherlands: Lower secondary school HAVO-VWO\n\n

I can keep the pace of\ + \ the class.

\nNetherlands: group 7 en 8\n\n\n

Felienne teaching kids

\n\n\n

Kids learning about Hedy

" diff --git a/content/parsons/mi.yaml b/content/parsons/mi.yaml index 5584fda8962..3e89a139c7d 100644 --- a/content/parsons/mi.yaml +++ b/content/parsons/mi.yaml @@ -1,88 +1,270 @@ levels: 1: 1: - code: "{print} Welcome to bakery Hedy!\n{ask} What type of pie do you want to order?\n{echo} So you want\n{print} Your order is being prepared!" - story: "Puzzels are exercises in which the lines of code are already written for you. You only have to place the lines in the correct order. Drag the lines of code into the input screen and run the code. Can you get the program to work?\n\nYou're a customer at bakery Hedy.\nYou walk into the bakery and are welcomed by the baker.\nHe asks what type of pie you want to order.\nThen he repeats your answer back to you.\nLastly, your order is being prepared." + story: |- + Puzzels are exercises in which the lines of code are already written for you. You only have to place the lines in the correct order. Drag the lines of code into the input screen and run the code. Can you get the program to work? + + You're a customer at bakery Hedy. + You walk into the bakery and are welcomed by the baker. + He asks what type of pie you want to order. + Then he repeats your answer back to you. + Lastly, your order is being prepared. + code: |- + {print} Welcome to bakery Hedy! + {ask} What type of pie do you want to order? + {echo} So you want + {print} Your order is being prepared! 2: - code: "{print} This is DJ Hedy\n{ask} Are you ready to party?\n{ask} What song would you like to hear?\n{echo} Great choice! I love the song" story: You're at the DJ Booth requesting a song. Create a program that asks if you are ready to party and then asks which song you would like to hear. + code: |- + {print} This is DJ Hedy + {ask} Are you ready to party? + {ask} What song would you like to hear? + {echo} Great choice! I love the song + 2: + 1: + story: |- + You and your friends are going to watch some Netflix. + Show which movie you're about to watch and wish the viewers lot of fun! + code: |- + {print} It is time for an evening of Netflix + film {is} Sonic the Hedgehog 2 + {print} We're going to watch film + {print} Have fun! + 2: + story: This is the webshop of a toy store. Create a program where costumers can add an item to their shopping cart. + code: |- + {print} Welcome to our toystore + toy {is} {ask} What would you like to buy? + {print} toy is added to your shopping cart. + {print} Thank you for shopping with us! 3: 1: - story: "The new school year at Hogwarts is starting! \nIt is the job of the sorting hat to sort you into one of the houses.\nWhich house will you be sorted into? Are you a Gryffindor, Hufflepuff, Ravenclaw or Slytherin.\nBefore the sorting hat reveals your house, you can tell it to not pick one of the houses." - code: "{print} The sorting hat is ready to sort you into a Hogwarts house.\nhouses {is} Gryffindor, Hufflepuf, Ravenclaw, Slytherin\ndislike {is} {ask} Are there any houses you do not want to be part of?\n{remove} dislike {from} houses\n{print} Not dislike eh? Better be... houses {at} {random}" + story: "The new school year at Hogwarts is starting! \nIt is the job of the sorting hat to sort you into one of the houses.\nWhich house will you be sorted into? Are you a Gryffindor, Hufflepuff, Ravenclaw or Slytherin.\nBefore the sorting hat reveals your house, you can tell it to not pick\ + \ one of the houses." + code: |- + {print} The sorting hat is ready to sort you into a Hogwarts house. + houses {is} Gryffindor, Hufflepuf, Ravenclaw, Slytherin + dislike {is} {ask} Are there any houses you do not want to be part of? + {remove} dislike {from} houses + {print} Not dislike eh? Better be... houses {at} {random} 2: story: Create a program that chooses a random meal for you. Make a list of food and a list of toppings and let the program decide what you'll have! - code: "food {is} pizza, icecream, salad, sandwich\ntoppings {is} chocolate, cheese, tuna, sprinkles\n{print} Your random meal for today is...\n{sleep} 2\n{print} food {at} {random} with toppings {at} {random}" + code: |- + food {is} pizza, icecream, salad, sandwich + toppings {is} chocolate, cheese, tuna, sprinkles + {print} Your random meal for today is... + {sleep} 2 + {print} food {at} {random} with toppings {at} {random} 3: - story: "In a chess tournament there are three players left.\nCreate a program that decides which two players have to play against each other first.\nStart by printing the two players who play the first match, then print against which player the winner will play." - code: "players {is} Liam, Noah, Sophie\nplayer_1 {is} players {at} {random}\n{remove} player_1 {from} players\nplayer_2 {is} players {at} {random}\n{print} player_1 ' first plays against ' player_2\n{remove} player_2 {from} players\n{print} 'The winner plays against ' players {at} {random}" - 10: - 2: - story: "This make-over robot will decide your new hairstyle for you. If you do not agree with the first choice, you can try again.\n**Mind** The variable people is defined in the first line. The variable hairstyles in the second." - code: "people = Betty, Amanda, Marc\nhairstyles = a bald head, a mohawk, a ponytail, spikes\n{for} person {in} people\n {print} person ' will get ' hairstyles {at} {random}\n happy = {ask} person ', are you happy with this choice?'\n {if} happy {is} yes\n {print} 'Great'\n {else}\n {print} 'Lets try again... Then 'person ' will get ' hairstyles {at} {random}" - 1: - story: "Help this family out by creating a schedule of who is cooking and what they should be making this week. The remove commands make sure nobody has to cook twice and they have a differnet dinner every day.\n**Mind!** the variable order should be first days, then people, and lastly dinner_options. This goes for the lines with the remove commands too." - code: "days = Monday, Tuesday, Wednesday, Thursday, Friday\npeople = mom, dad, Martin, Abby, Jesse\ndinner_options = pizza, tacos, pancakes, a salad, lasagne\n{for} day {in} days\n chosen_person = people {at} {random}\n chosen_dinner = dinner_options {at} {random}\n {print} 'On ' day ' ' chosen_person ' is making ' chosen_dinner\n {remove} chosen_person {from} people\n {remove} chosen_dinner {from} dinner_options" - 6: - 2: - code: "{print} 'It is your birthday!'\npeople = {ask} 'How many people do you want to give a slice of cake?'\ncakes_amount = people/8\n{print} 'You will have to buy ' cakes_amount ' cakes'" - story: Create a program that helps you calculate how many cakes you should buy for your birthday party. - 1: - code: "age = {ask} 'How old are you?'\ndog_age = age * 7\ncat_age = age * 5\n{print} 'In dog years you are ' dog_age ' years old.'\n{print} 'In cat years you are ' cat_age ' years old.'" - story: "Make a program that calculates how old you are in dog and cat years.\nFirst ask the age of the user and start calculating.\nFirst calculate the dogyears then the catyears.\nShow the user the different ages." + story: |- + In a chess tournament there are three players left. + Create a program that decides which two players have to play against each other first. + Start by printing the two players who play the first match, then print against which player the winner will play. + code: |- + players {is} Liam, Noah, Sophie + player_1 {is} players {at} {random} + {remove} player_1 {from} players + player_2 {is} players {at} {random} + {print} player_1 ' first plays against ' player_2 + {remove} player_2 {from} players + {print} 'The winner plays against ' players {at} {random} 4: + 1: + story: |- + You are the newest Pokémon trainer from Pallet Town! + Make a program that selects your first Pokémon. + Let the program wait a second before revealing your first Pokémon. + code: |- + pokemons {is} Pikachu, Charmander, Bulbasaur, Squirtle + {print} 'This is going to be your first Pokémon!' + {sleep} + {print} pokemons {at} {random} 2: story: Create a lottery that lets you choose an extra prize that you might win. - code: "prizes {is} car, hamster, 1 million euros\nprize {is} {ask} 'What would you like to win?'\n{add} prize {to_list} prizes\n{print} 'You won a ' prizes {at} {random}" + code: |- + prizes {is} car, hamster, 1 million euros + prize {is} {ask} 'What would you like to win?' + {add} prize {to_list} prizes + {print} 'You won a ' prizes {at} {random} + 5: 1: - story: "You are the newest Pokémon trainer from Pallet Town!\nMake a program that selects your first Pokémon.\nLet the program wait a second before revealing your first Pokémon." - code: "pokemons {is} Pikachu, Charmander, Bulbasaur, Squirtle\n{print} 'This is going to be your first Pokémon!'\n{sleep}\n{print} pokemons {at} {random}" - 9: + story: |- + Make a program that checks if your favourite movie is already in the list of the computer. + If so, print that you have great taste, otherwise add the movie to the list. + code: |- + favorite_movies {is} Batman, Spiderman, The Avengers, Jurassic Park + movie {is} {ask} 'What is your favourite movie?' + {if} movie {in} favorite_movies {print} 'You have great taste!' + {else} {print} 'Such a shame that your favourite movie is not in the list, we will add it right away!' + {add} movie {to_list} favorite_movies 2: - story: "This code asks the costumers in a restaurant if they would like to order dessert. If they do, it asks them what kind of dessert. If they order tiramisu they are told that the tiramisu is sold out.\nCan you get the code to work?" - code: "order = {ask} 'Would you like to order dessert?'\n{if} order = yes\n dessert = {ask} 'What kind of dessert would you like?'\n {if} dessert = tiramisu\n {print} 'Sorry, we are out of tiramisu.'\n {else}\n {print} 'One ' dessert ' coming right up!'\n{else}\n {print} 'You dont want a dessert. No problem!'" - 1: - story: This game will give you three maths assignments. Each time the question is different. Can you figure out the order? - code: "numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n{repeat} 3 {times}\n number = numbers {at} {random}\n correct_answer = 5 * number\n answer = {ask} 'What is 5 times' number '?'\n {if} answer = correct_answer\n {print} 'Good job!'\n {else}\n {print} 'No! The correct answer is ' correct_answer" - 2: + story: Create a maths game. + code: |- + {print} 'Solve this problem' + answer {is} {ask} '88 - 16 = ?' + {if} answer {is} 72 {print} 'Correct!' + {else} {print} 'Wrong! The answer was 72' + 6: 1: - story: "You and your friends are going to watch some Netflix.\nShow which movie you're about to watch and wish the viewers lot of fun!" - code: "{print} It is time for an evening of Netflix\nfilm {is} Sonic the Hedgehog 2\n{print} We're going to watch film\n{print} Have fun!" + story: |- + Make a program that calculates how old you are in dog and cat years. + First ask the age of the user and start calculating. + First calculate the dogyears then the catyears. + Show the user the different ages. + code: |- + age = {ask} 'How old are you?' + dog_age = age * 7 + cat_age = age * 5 + {print} 'In dog years you are ' dog_age ' years old.' + {print} 'In cat years you are ' cat_age ' years old.' 2: - story: This is the webshop of a toy store. Create a program where costumers can add an item to their shopping cart. - code: "{print} Welcome to our toystore\ntoy {is} {ask} What would you like to buy?\n{print} toy is added to your shopping cart.\n{print} Thank you for shopping with us!" + story: Create a program that helps you calculate how many cakes you should buy for your birthday party. + code: |- + {print} 'It is your birthday!' + people = {ask} 'How many people do you want to give a slice of cake?' + cakes_amount = people/8 + {print} 'You will have to buy ' cakes_amount ' cakes' 7: 1: - code: "{repeat} 3 {times} {print} 'Baby shark tututututudu'\n{print} 'Baby shark'\n{repeat} 3 {times} {print} 'Mommy shark tututututudu'\n{print} 'Mommy shark'\n{repeat} 3 {times} {print} 'Daddy shark tututututudu'\n{print} 'Daddy shark'" story: Complete the baby shark song. First comes baby shark, then mommy and finally daddy shark. + code: |- + {repeat} 3 {times} {print} 'Baby shark tututututudu' + {print} 'Baby shark' + {repeat} 3 {times} {print} 'Mommy shark tututututudu' + {print} 'Mommy shark' + {repeat} 3 {times} {print} 'Daddy shark tututututudu' + {print} 'Daddy shark' 2: - code: "{print} 'the wheels on the bus go'\n{repeat} 3 {times} {print} 'round and round'\n{print} 'the wheels of the bus go round and round'\n{print} 'all through the town'" story: Create the song 'The wheels on the bus go round and round' - 12: - 1: - code: "verses = 'What will we do with the drunken sailor', 'Way hey and up she rises'\n{for} verse {in} verses\n {for} count {in} {range} 1 {to} 3\n {print} verse\n {print} 'Early in the morning'" - story: "Sing the song 'What shall we do with the drunken sailor'. In case you don't know it, the song goed like this:\n\nWhat will we do with the drunken sailor\nWhat will we do with the drunken sailor\nWhat will we do with the drunken sailor\nEarly in the morning\nWay hey and up she rises\nWay hey and up she rises\nWay hey and up she rises\nEarly in the morning" - 2: - story: Play a game of Twister with us! First define the variable people, then limbs, then colors. - code: "people = 'Jess', 'Nick', 'Winston'\nlimbs = 'left hand', 'left foot', 'right hand', 'right foot'\ncolors = 'red', 'blue', 'green', 'yellow'\n{for} person {in} people\n {print} person ', put your ' limbs {at} {random} ' on ' colors {at} {random}" + code: |- + {print} 'the wheels on the bus go' + {repeat} 3 {times} {print} 'round and round' + {print} 'the wheels of the bus go round and round' + {print} 'all through the town' 8: 1: - story: "You and four other friends are playing Pokémon Go! Create a program that decides in which team each of you will play.\nEither red, yellow or blue! Take a little pause after announcing a team." - code: "teams = red, yellow, blue\n{print} 'Red, Yellow or Blue?'\n{repeat} 5 {times}\n {print} 'You are selected in team... '\n {print} teams {at} {random}\n sleep 2" + story: |- + You and four other friends are playing Pokémon Go! Create a program that decides in which team each of you will play. + Either red, yellow or blue! Take a little pause after announcing a team. + code: |- + teams = red, yellow, blue + {print} 'Red, Yellow or Blue?' + {repeat} 5 {times} + {print} 'You are selected in team... ' + {print} teams {at} {random} + sleep 2 2: - code: "counter = 11\n{repeat} 10 {times}\n counter = counter - 1\n {print} counter\n {sleep} 1\n{print} 'Ready or not here I come!'" story: Print the countdown for a game of hide and seek. + code: |- + counter = 11 + {repeat} 10 {times} + counter = counter - 1 + {print} counter + {sleep} 1 + {print} 'Ready or not here I come!' + 9: + 1: + story: This game will give you three maths assignments. Each time the question is different. Can you figure out the order? + code: |- + numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + {repeat} 3 {times} + number = numbers {at} {random} + correct_answer = 5 * number + answer = {ask} 'What is 5 times' number '?' + {if} answer = correct_answer + {print} 'Good job!' + {else} + {print} 'No! The correct answer is ' correct_answer + 2: + story: |- + This code asks the costumers in a restaurant if they would like to order dessert. If they do, it asks them what kind of dessert. If they order tiramisu they are told that the tiramisu is sold out. + Can you get the code to work? + code: |- + order = {ask} 'Would you like to order dessert?' + {if} order = yes + dessert = {ask} 'What kind of dessert would you like?' + {if} dessert = tiramisu + {print} 'Sorry, we are out of tiramisu.' + {else} + {print} 'One ' dessert ' coming right up!' + {else} + {print} 'You dont want a dessert. No problem!' + 10: + 1: + story: |- + Help this family out by creating a schedule of who is cooking and what they should be making this week. The remove commands make sure nobody has to cook twice and they have a differnet dinner every day. + **Mind!** the variable order should be first days, then people, and lastly dinner_options. This goes for the lines with the remove commands too. + code: |- + days = Monday, Tuesday, Wednesday, Thursday, Friday + people = mom, dad, Martin, Abby, Jesse + dinner_options = pizza, tacos, pancakes, a salad, lasagne + {for} day {in} days + chosen_person = people {at} {random} + chosen_dinner = dinner_options {at} {random} + {print} 'On ' day ' ' chosen_person ' is making ' chosen_dinner + {remove} chosen_person {from} people + {remove} chosen_dinner {from} dinner_options + 2: + story: |- + This make-over robot will decide your new hairstyle for you. If you do not agree with the first choice, you can try again. + **Mind** The variable people is defined in the first line. The variable hairstyles in the second. + code: |- + people = Betty, Amanda, Marc + hairstyles = a bald head, a mohawk, a ponytail, spikes + {for} person {in} people + {print} person ' will get ' hairstyles {at} {random} + happy = {ask} person ', are you happy with this choice?' + {if} happy {is} yes + {print} 'Great' + {else} + {print} 'Lets try again... Then 'person ' will get ' hairstyles {at} {random} 11: 1: story: Create the count down clock for New Year's eve! The program should show the numbers from 10 to 1 for a second and then wish you a happy new year. - code: "{for} number {in} {range} 10 {to} 1\n {print} number\n {sleep}\n {clear}\n{print} 'Happy New Year!'" - 2: - story: "Create a program that tells us the final results of the science fair. Firstly define the variable contestants, then the variable place.\n**Hint** Line 5 should be the sleep command, and you should end with saying congratulations." - code: "{print} 'And now we will reveal the results of the science fair'\ncontestants = Vivienne, Paul, Trixy, Bianca, Katya\nplace = 5\n{for} contestant {in} contestants\n {sleep} 2\n {print} 'On number ' place ' has ended... ' contestant\n place = place - 1\n{print} 'Congratulations!'" - 5: + code: |- + {for} number {in} {range} 10 {to} 1 + {print} number + {sleep} + {clear} + {print} 'Happy New Year!' 2: - code: "{print} 'Solve this problem'\nanswer {is} {ask} '88 - 16 = ?'\n{if} answer {is} 72 {print} 'Correct!'\n{else} {print} 'Wrong! The answer was 72'" - story: Create a maths game. + story: |- + Create a program that tells us the final results of the science fair. Firstly define the variable contestants, then the variable place. + **Hint** Line 5 should be the sleep command, and you should end with saying congratulations. + code: |- + {print} 'And now we will reveal the results of the science fair' + contestants = Vivienne, Paul, Trixy, Bianca, Katya + place = 5 + {for} contestant {in} contestants + {sleep} 2 + {print} 'On number ' place ' has ended... ' contestant + place = place - 1 + {print} 'Congratulations!' + 12: 1: - story: "Make a program that checks if your favourite movie is already in the list of the computer.\nIf so, print that you have great taste, otherwise add the movie to the list." - code: "favorite_movies {is} Batman, Spiderman, The Avengers, Jurassic Park\nmovie {is} {ask} 'What is your favourite movie?'\n{if} movie {in} favorite_movies {print} 'You have great taste!'\n{else} {print} 'Such a shame that your favourite movie is not in the list, we will add it right away!'\n{add} movie {to_list} favorite_movies" + story: |- + Sing the song 'What shall we do with the drunken sailor'. In case you don't know it, the song goed like this: + + What will we do with the drunken sailor + What will we do with the drunken sailor + What will we do with the drunken sailor + Early in the morning + Way hey and up she rises + Way hey and up she rises + Way hey and up she rises + Early in the morning + code: |- + verses = 'What will we do with the drunken sailor', 'Way hey and up she rises' + {for} verse {in} verses + {for} count {in} {range} 1 {to} 3 + {print} verse + {print} 'Early in the morning' + 2: + story: Play a game of Twister with us! First define the variable people, then limbs, then colors. + code: |- + people = 'Jess', 'Nick', 'Winston' + limbs = 'left hand', 'left foot', 'right hand', 'right foot' + colors = 'red', 'blue', 'green', 'yellow' + {for} person {in} people + {print} person ', put your ' limbs {at} {random} ' on ' colors {at} {random} diff --git a/content/quizzes/fr.yaml b/content/quizzes/fr.yaml index e131d83106f..1fe6a486bc1 100644 --- a/content/quizzes/fr.yaml +++ b/content/quizzes/fr.yaml @@ -1246,29 +1246,25 @@ levels: 2: question_text: Quel est le bon code ? mp_choice_options: - - option: '``` - + - option: |- + ``` {print} 100 {times} "Salut !" - - ```' + ``` feedback: '`{repeat}` 100 `{times}` `{print}` "Salut !"' - - option: '``` - + - option: |- + ``` {print} {repeat} 100 {times} "Salut !" - - ```' + ``` feedback: '{repeat} 100 {times} {print} "Salut !"' - - option: '``` - + - option: |- + ``` {repeat} "Salut !" 100 {times} - - ```' + ``` feedback: '{repeat} 100 {times} {print} "Salut !"' - - option: '``` - + - option: |- + ``` {repeat} 100 {times} {print} "Salut !" - - ```' + ``` feedback: C'est ça ! hint: D'abord la commande `{repeat}`, puis la commande `{print}` correct_answer: D @@ -1294,7 +1290,10 @@ levels: {print} "J'aime le " couleur repeat} 7 {times} {print} "da ba di, da ba da" mp_choice_options: - - option: "```\ncouleur\n```" + - option: |- + ``` + couleur + ``` feedback: C'est ça ! La variable est inconnue - option: '`{print}`' feedback: '`{print}` est écrit correctement' @@ -1354,7 +1353,7 @@ levels: - option: |- We will We will ROCK YOU! - feedback: '« We will » n’apparaîtra pas 2 fois sur la même ligne' + feedback: « We will » n’apparaîtra pas 2 fois sur la même ligne - option: |- We will We will @@ -1414,7 +1413,7 @@ levels: {print} "cassis" ``` feedback: Il ne faut pas répéter « chocolat » - hint: "`{repeat}` ne peut être utilisé que si l'on veut exécuter la même ligne plusieurs fois de suite." + hint: '`{repeat}` ne peut être utilisé que si l''on veut exécuter la même ligne plusieurs fois de suite.' correct_answer: A question_score: '10' 9: @@ -1435,7 +1434,13 @@ levels: {repeat} 3 {times} {print} "S'il vous plait, aidez-moi !" ``` feedback: Tu ne répètes pas la bonne ligne. - - option: "```\n{print} \"Batman survolait Gotham.\"\n{print} \"Quand soudain, il entend quelqu'un crier…\"\n{repeat} 3 {times} \"Au secours !\"\n{print} \"S'il vous plait, aidez-moi !\"\n```" + - option: |- + ``` + {print} "Batman survolait Gotham." + {print} "Quand soudain, il entend quelqu'un crier…" + {repeat} 3 {times} "Au secours !" + {print} "S'il vous plait, aidez-moi !" + ``` feedback: La commande `{print}` manque à la ligne 3. - option: |- ``` @@ -1445,9 +1450,15 @@ levels: {print} S'il vous plait, aidez-moi ! ``` feedback: Tu oublies les guillemets - - option: "```\n{print} \"Batman survolait Gotham.\"\n{print} \"Quand soudain, il entends quelqu un crier...\"\n{repeat} 3 {times} {print} \"Au secours !\"\n{print} \"S'il vous plat, aidez-moi !\"\n```" + - option: |- + ``` + {print} "Batman survolait Gotham." + {print} "Quand soudain, il entends quelqu un crier..." + {repeat} 3 {times} {print} "Au secours !" + {print} "S'il vous plat, aidez-moi !" + ``` feedback: Parfait - hint: '« Au secours ! » est répété 3 fois' + hint: « Au secours ! » est répété 3 fois correct_answer: D question_score: '10' 10: diff --git a/content/quizzes/mi.yaml b/content/quizzes/mi.yaml index 846a01e8a61..8f7dc583213 100644 --- a/content/quizzes/mi.yaml +++ b/content/quizzes/mi.yaml @@ -1,730 +1,905 @@ levels: - 11: - 4: - question_text: Which code was used to get this output? - correct_answer: D - mp_choice_options: - - option: "```\n{for} i {in} {range} 0 {to} 10\n {print} i\n```" - feedback: Now Hedy prints the numbers from 0 to 10 instead of 10 to 0. - - feedback: Hedy would print negative numbers in this case. - option: "```\n{for} i {in} {range} 0 {to} 10\n {print} - i\n```" - - feedback: Unfortunately this does not exist. - option: "```\n{for} i {in} {range} 10 to 0\n {print} 10 9 8 7 6 5 4 3 2 1 0\n```" - - option: "```\n{for} i {in} {range} 0 {to} 10\n {print} 10 - i\n```" - feedback: That's right! - hint: It has to be a calculation... - output: "10\n9\n8\n7\n6\n5\n4\n3\n2\n1\n0" - question_score: '10' + 1: 1: + question_text: What's this programming language called? mp_choice_options: - - option: "```\ncounter\n```" - feedback: No - - feedback: Correct - option: '`{range}`' - - feedback: No - option: '`{if}`' - - option: '`{for}`' - feedback: No - hint: What did you learn in this level? - code: "{for} i {in} _ 1 {to} 10\n {print} i" - correct_answer: B - question_text: What word should be at the place of the blank? - question_score: '10' - 10: - output: "Baby shark tututudutudu\nBaby shark tututudutudu\nBaby shark tututudutudu\nBaby shark" - question_score: '10' - mp_choice_options: - - option: "```\n{for} i {in} {range} 1 {to} 3\n {print} Baby shark tututudutudu\n {print} Baby shark\n```" - feedback: Mind the indention - - option: "```\n{for} i {in} {range} 1 {to} 3\n {print} Baby shark tututudutudu\n{print} Baby shark\n```" - feedback: That's right! - - feedback: '`{range}` 0 `{to}` 3 is 4 times.' - option: "```\n{for} i {in} {range} 0 {to} 3\n {print} Baby shark tututudutudu\n{print} Baby shark\n```" - - option: "```\n{for} i {in} {range} 0 {to} 3\n {print} Baby shark tututudutudu\n {print} Baby shark\n```" - feedback: '`{range}` 0 `{to}` 3 is 4 times.' - hint: Mind the indention - correct_answer: B - question_text: Which code belongs to this output? - 7: - mp_choice_options: - - option: "```\n{for} i {in} {range} 0 {to} 3\n```" - feedback: There's not always 3 people - - feedback: The variable is not named guests - option: "```\n{for} i {in} {range} 1 {to} guests\n```" - - feedback: Great! - option: "```\n{for} i {in} {range} 1 {to} people\n```" - - feedback: That's one order too many! - option: "```\n{for} i {in} {range} 0 {to} people\n```" - question_text: What should be on the place of the blank? - question_score: '10' - correct_answer: C - code: "{print} 'Welcome to Hedys diner'\npeople = {ask} 'How many people will be eating here tonight?'\n_\n food = {ask} 'What would you like to order?'\n {print} food" - hint: Use the variable 'people' - 6: - correct_answer: C - mp_choice_options: - - option: 1 time - feedback: No - - feedback: No - option: 2 times - - feedback: That's right! - option: 3 times - - option: Never - feedback: No - code: "{for} i {in} {range} 0 {to} 2\n {print} 'Hello'" - hint: 0 also counts. So 0,1,2 that's 3 times. - question_score: '10' - question_text: How many times does the word Hello appear on your screen when you run the code? - 9: - code: "age = {ask} 'How old are you?'\n{for} i {in} {range} 1 {to} age\n {print} 'Hip Hip Hoorray!'" - question_score: '10' - mp_choice_options: - - feedback: Try again - option: 1 time - - feedback: Try again - option: 2 times - - feedback: Try again - option: Never - - feedback: That's right! - option: That depends on how old you are - hint: '`{for}` i `{in}` `{range}` 1 `{to}` age' - question_text: How many times does Hedy chant Hip Hip Hooray? - correct_answer: D - 8: - mp_choice_options: - - feedback: The numbers don't appear. It doesn't say `{print}` i. - option: "23\n24\n25" - - feedback: The numbers don't appear. It doesn't say `{print}` i - option: 23 hi 24 hi 25 hi - - feedback: Correct - option: "hi\nhi\nhi" - - feedback: No it will only appear 3 times. - option: The word 'hi' will appear 25 times in a row. - correct_answer: C - hint: It doesn't say `{print}` i - question_text: What will be the output from this code? - code: "{for} i {in} {range} 23 {to} 25\n {print} 'hi'" - question_score: '10' - 5: - mp_choice_options: - - feedback: No it doesn't. - option: The i in the last line need quotation marks - - feedback: You could use 1 to 5 just as well! - option: You can't use `{range}` 1 `{to}` 5 only `{range}` 1 `{to}` 10 - - option: Line 1 needs to start with an indention. - feedback: Not line 1... - - feedback: Perfect! - option: Line 2 needs to start with an indention - question_score: '10' - correct_answer: D - question_text: What's wrong with this code? - code: "{for} i {in} {range} 1 {to} 10\n{print} i" - hint: There is something wrong with the indention - 3: - mp_choice_options: - - option: "```\n{for} i {in} {range} 1 {to} 5\n {print} i\n{print} 'Once I caught a fish alive!'\n```" - feedback: Perfect - - option: "```\n{for} i {in} {range} 1 {to} 5\n{print} i\n{print} 'Once I caught a fish alive!'\n```" - feedback: This code won't work. You need an indent after {for}. - - option: "```\n{for} i {in} {range} 1 {to} 5\n {print} i\n {print} 'Once I caught a fish alive!'\n```" - feedback: Now Hedy will count '1 Once I caught a fish alive!, 2 Once I caught a fish alive! etc. - - option: "```\n{for} i {in} {range} 1 {to} 5\n {print} 'i'\n{print} 'Once I caught a fish alive!'\n```" - feedback: i is a variable and shouldn't have quotation marks - question_score: '10' - question_text: Which code was used to get this output? - hint: First all the numbers, then the sentence - correct_answer: A - output: "1\n2\n3\n4\n5\nOnce I caught a fish alive!" - 2: - mp_choice_options: - - option: "1\n2\n3" - feedback: Correct! - - option: 1 2 3 - feedback: That's not it - - option: 1, 2, 3 - feedback: That's not it - - feedback: That's not it - option: '123' - hint: How do the numbers appear in the screen? - question_text: What will be the output from this code? + - option: Hedy + feedback: Good job! + - option: Heddy + feedback: Not this one! + - option: Haydie + feedback: Not this one! + - option: Heidi + feedback: Not this one! + hint: It's named after Hedy Lamarr. correct_answer: A - code: "{for} i {in} {range} 1 {to} 3\n {print} i" - question_score: '10' - 9: - 4: - mp_choice_options: - - option: Sleeping Beauty with shoe size 38 gets the output 'Ill keep looking' - feedback: No, she gets 'You are not the one!' - - feedback: No, she gets 'Ill keep looking' - option: Cinderella with shoe size 40 gets the output '❤️❤️❤️' - - feedback: That's right! - option: Sleeping Beauty with shoe size 40 gets the output 'Ill keep looking' - - feedback: No she gets '❤️❤️❤️' - option: Cinderella with shoe size 38 gets the output 'Ill keep looking' - code: "name = {ask} 'What is your name?'\nsize = {ask} 'What is your shoe size?'\n{if} size {is} 38\n {if} name {is} Cinderella\n {print} '❤️❤️❤️'\n {else}\n {print} 'You are not the one!'\n{else}\n {print} 'Ill keep looking'" - hint: No matter what your name is, if you have shoe size 40 you will get the message 'Ill keep looking'. - question_text: Which statement is true? - question_score: '10' - correct_answer: C - 6: - mp_choice_options: - - feedback: Don't forget the others - option: '`{if}`' - - feedback: Don't forget `{else}`! - option: '`{if}` `{repeat}`' - - option: '`{if}` `{else}` `{repeat}`' - feedback: Keep it up! - - feedback: Not with {print} - option: '`{if}` `{else}` `{repeat}` `{print}`' - hint: Indentation happens on the line below some commands question_score: '10' - question_text: After which command(s) should you use indentation (starting the next line with 4 spaces)? - correct_answer: C 2: + question_text: Which need to be filled in on the blanks to make the text Hello! appear? + code: _ Hello! mp_choice_options: - - option: "```\nGood job!\nGood job!\n```" - feedback: That's not it! - - feedback: That's not it! - option: "```\nThe computer will explode in 5... 4... 3... 2... 1...\n```" - - feedback: That's not it! - option: "```\nGood job!\nGood job!\nYou can use the computer!\n```" - - option: "```\nGood job!\nYou can use the computer!\nGood job!\nYou can use the computer!\n```" + - option: '`{echo}`' + feedback: '`{echo}` repeats a given answer.' + - option: '`{print}`' feedback: Correct! - correct_answer: D - code: "password = {ask} 'What is the password?'\ncorrect_password = Hedy\n{if} password {is} correct_password\n {repeat} 2 {times}\n {print} 'Good job!'\n {print} 'You can use the computer!'\n{else}\n {print} 'The computer will explode in 5... 4... 3... 2... 1...'" - question_text: What will be printed after entering the correct password? - hint: Everything under the `{repeat}` command is repeated twice. - question_score: '10' - 10: - mp_choice_options: - - feedback: Only line 2 and 3 start with spaces - option: All lines should start with 4 spaces - - option: Line 2 and 3 should start with 4 spaces - feedback: Line 3 should start with 8 - - option: Line 2 and 3 should start with 8 spaces - feedback: Line 2 should start with 4 - - feedback: You are correct! - option: line 2 should start with 4 spaces and line 3 with 8 - question_score: '10' - correct_answer: D - hint: The first line doesn't start with any spaces - question_text: Which statement is true? - code: "1 {repeat} 2 {times}\n2 {if} level {is} 9\n3 {print} Great job!" - 1: - mp_choice_options: - - feedback: That's right! - option: Nothing, this code is correct! - - feedback: You are! - option: You're not allowed to use an `{if}` command after an `{ask}` command. - - feedback: You always have to use indentation. - option: You don't have to use indentation twice. - - option: The indentation is wrong in the last `{if}` command. - feedback: It is not the indentation. + - option: '`hello`' + feedback: Hello isn't a command. + - option: '`{ask}`' + feedback: With `{ask}`, you can ask a question. + hint: _ Hello world! + correct_answer: B question_score: '10' - correct_answer: A - question_text: What is wrong with this code? - code: "{repeat} 3 {times}\n food = {ask} 'What would you like to eat?'\n {if} food {is} fries\n sauce = {ask} 'What sauce would you like?'\n {print} 'One fries with ' sauce\n {if} food {is} pizza\n topping = {ask} 'What topping would you like?'\n {print} 'One pizza with ' topping\n{print} 'Thank you for your order'" - hint: All the indentation is done correctly. - 5: - output: "Icecream is the best!\nIcecream is the best!\nIcecream is the best!" + 3: + question_text: How do you ask what someone's favorite color is? mp_choice_options: - - option: "```\ndessert = {ask} 'What is your favorite type of dessert?'\n{if} dessert {is} icecream\n {repeat} 3 {times}\n {print} 'Icecream is the best!'\n```" - feedback: Don't forget the indentation after `{repeat}` commands. - - feedback: Use indentation after an `{if}` command - option: "```\ndessert = {ask} 'What is your favorite type of dessert?'\n{if} dessert {is} icecream\n{repeat} 3 {times}\n {print} 'Icecream is the best!'\n```" - - feedback: Perfect - option: "```\ndessert = {ask} 'What is your favorite type of dessert?'\n{if} dessert {is} icecream\n {repeat} 3 {times}\n {print} 'Icecream is the best!'\n```" - - option: "```\n{repeat} 3 {times}\n dessert = {ask} 'What is your favorite type of dessert?'\n {if} dessert {is} icecream\n {repeat} 3 {times}\n {print} 'Icecream is the best!'\n```" - feedback: There are 2 `{repeat}` commands in this code. - hint: Watch the indentation - question_score: '10' - question_text: Which code produced this output? + - option: |- + ``` + {print} What is your favorite color? + ``` + feedback: '`{print}` prints text, but it doesn''t ask questions.' + - option: |- + ``` + {ask} {print} What is your favorite color? + ``` + feedback: You only need one command, not two. + - option: |- + ``` + {ask} What is your favorite color? + ``` + feedback: Great! + - option: |- + ``` + {echo} What is your favorite color? + ``` + feedback: '`{echo}` repeats your answer back to you.' + hint: You can ask something with the `{ask}` command correct_answer: C - 7: question_score: '10' - code: "{if} food {is} pizza\n{if} size {is} medium\n{if} drink {is} coke\nprice = price - 5" - hint: After each `{if}` command, the line below should indent + 4: + question_text: What is wrong with this code? + code: |- + Hi Im Hedy! + {ask} Who are you? + {echo} Hi... mp_choice_options: - - option: "```\n{if} food {is} pizza\n {if} size {is} medium\n {if} drink {is} coke\n price = price - 5\n```" - feedback: Amazing! - - option: "```\n{if} food {is} pizza\n {if} size {is} medium\n{if} drink {is} coke\n price = price - 5\n```" - feedback: The second `{if}` misses code! - - option: "```\n{if} food {is} pizza\n{if} size {is} medium\n{if} drink {is} coke\n price = price - 5\n```" - feedback: Two consecutive `{if}`s is never correct. - - feedback: Almost right. Take another look at the last line - option: "```\n{if} food {is} pizza\n {if} size {is} medium\n {if} drink {is} coke\n price = price - 5\n```" + - option: '`{print}` in line 1 is missing.' + feedback: Correct! + - option: The command in line 2 is spelled wrong. + feedback: The command is spelled correctly. + - option: '`{echo}` isn''t a command.' + feedback: '`{echo}` is a command, there''s another mistake.' + - option: Nothing! This is a perfect code! + feedback: Wrong, look carefully! + hint: Line 1 doesn't seem right correct_answer: A - question_text: You'll get a 5 dollar discount if you order a medium pizza with coke.
But the code has a mistake! How to debug it? - 9: question_score: '10' + 5: + question_text: Which command is missing in line 2? + code: |- + {ask} What is your favorite pet? + _ So your favorite pet is... mp_choice_options: - - feedback: You are allowed to - option: None, that is not allowed - - option: Only 1 - feedback: You could use more if you like - - feedback: You could use more if you like - option: '3' - - option: Infinite, as long as you keep using indentation correctly - feedback: That is true - question_text: How many `{if}` commands can be placed inside another `{if}` command? - correct_answer: D - hint: You can put an `{if}` command inside an `{if}` command. - 3: - mp_choice_options: - - feedback: You don't win a million! - option: case 1, sell - - option: case 1, open - feedback: You don't win a million - - feedback: You don't win a million - option: case 2, sell - - option: case 2, open - feedback: Great job! You win! + - option: '`{print}`' + feedback: No, you would like the answer to be repeated back to you. + - option: '`Hedy`' + feedback: Hedy isn't a command. + - option: '`{ask}`' + feedback: With `{ask}` you can ask a question. + - option: '`{echo}`' + feedback: Right on! + hint: You want to see the answer at the end of line 2... correct_answer: D - hint: Follow the right path - question_score: '10' - question_text: Which case should you choose to win a million dollars? - code: "{print} 'Choose the right case and win!'\ncase = {ask} 'Which case will you pick? 1 or 2?'\n{if} case {is} 1\n action = {ask} 'Open it or sell it?'\n {if} action {is} sell\n {print} 'You sell your case for 10 dollars'\n {if} action {is} open\n {print} 'You open the case and win an apple pie'\n{if} case {is} 2\n action = {ask} 'Open it or sell it?'\n {if} action {is} sell\n {print} 'You sell the case for 500 dollars'\n {if} action {is} open\n {print} 'You open the case and win a million dollars!'" - 8: - mp_choice_options: - - feedback: Yes you can. - option: You can't put two questions in a row - - feedback: Keen eye! Good job! - option: The variable called 'age' is later on used as 'years' - - option: You're not allowed to start with 8 spaces, like line 5 does - feedback: You actually must start like that. - - feedback: That's not true. - option: A code must always start with a `{print}` command in the first line - code: "age = {ask} 'Happy Birthday! How old are you?'\nsinging = {ask} 'Would you like us to sing?'\n{if} singing {is} yes\n {repeat} years {times}\n {print} 'Hip Hip Hooray'" - correct_answer: B - question_score: '10' - hint: The indentation is done right this time - question_text: What is wrong in this code? - 1: - 1: - mp_choice_options: - - option: Hedy - feedback: Good job! - - option: Heddy - feedback: Not this one! - - option: Haydie - feedback: Not this one! - - feedback: Not this one! - option: Heidi - hint: It's named after Hedy Lamarr. - correct_answer: A question_score: '10' - question_text: What's this programming language called? 6: question_text: What's wrong with this code? - mp_choice_options: - - feedback: '`{print}` in line 1 is correct.' - option: In line 1 `{print}` should be replaced with `{ask}`. + code: |- + {print} Hi im Hedy! + {print} Which football team do you support? + {echo} You support... + {print} Cool! Me too! + mp_choice_options: + - option: In line 1 `{print}` should be replaced with `{ask}`. + feedback: '`{print}` in line 1 is correct.' - option: In line 2, `{print}` should be replaced with `{ask}`. feedback: Great! You paid attention! - - feedback: '`{echo}` is correct.' - option: Line 3 has to begin with `{print}` instead of `{echo}`. - - feedback: No, there is a mistake somewhere else - option: In line 4, `{print}` is spelled wrong. - code: "{print} Hi im Hedy!\n{print} Which football team do you support?\n{echo} You support...\n{print} Cool! Me too!" + - option: Line 3 has to begin with `{print}` instead of `{echo}`. + feedback: '`{echo}` is correct.' + - option: In line 4, `{print}` is spelled wrong. + feedback: No, there is a mistake somewhere else hint: Check the `{print}` commands. - question_score: '10' correct_answer: B + question_score: '10' 7: + question_text: What's wrong with this code? + code: |- + {print} Welcome at Hedys restaurant! + {ask} What would you like to eat? + {echo} So you want to order ... + {print} Coming right up! Enjoy! mp_choice_options: - option: In line 1 `{print}` needs to be replaced with `{ask}` feedback: Are you sure something is wrong? - option: In line 1 `{print}` needs to be replaced with `{echo}` feedback: Are you sure something's wrong? - - feedback: Are you sure something is wrong? - option: In line 3 `{echo}` needs to be replaced with `{print}` + - option: In line 3 `{echo}` needs to be replaced with `{print}` + feedback: Are you sure something is wrong? - option: Nothing! This is a perfect code! feedback: Correct! - question_score: '10' - correct_answer: D - question_text: What's wrong with this code? - code: "{print} Welcome at Hedys restaurant!\n{ask} What would you like to eat?\n{echo} So you want to order ...\n{print} Coming right up! Enjoy!" hint: Check the code line by line - 2: - mp_choice_options: - - feedback: '`{echo}` repeats a given answer.' - option: '`{echo}`' - - option: '`{print}`' - feedback: Correct! - - option: '`hello`' - feedback: Hello isn't a command. - - feedback: With `{ask}`, you can ask a question. - option: '`{ask}`' - code: _ Hello! - correct_answer: B - question_score: '10' - hint: _ Hello world! - question_text: Which need to be filled in on the blanks to make the text Hello! appear? - 4: - question_text: What is wrong with this code? - mp_choice_options: - - feedback: Correct! - option: '`{print}` in line 1 is missing.' - - option: The command in line 2 is spelled wrong. - feedback: The command is spelled correctly. - - option: "`{echo}` isn't a command." - feedback: "`{echo}` is a command, there's another mistake." - - option: Nothing! This is a perfect code! - feedback: Wrong, look carefully! - code: "Hi Im Hedy!\n{ask} Who are you?\n{echo} Hi..." - hint: Line 1 doesn't seem right + correct_answer: D question_score: '10' - correct_answer: A 8: - correct_answer: C question_text: How do you use the `{echo}` command? mp_choice_options: - option: You can use it to `{ask}` a question. feedback: That's what `{ask}` is for! - - feedback: That's what `{print}` is for! - option: You can use it exactly the same way as `{print}`. - - feedback: Good job! - option: You can use it to repeat an answer. - - feedback: That's not right... - option: You can use it to make text disappear. + - option: You can use it exactly the same way as `{print}`. + feedback: That's what `{print}` is for! + - option: You can use it to repeat an answer. + feedback: Good job! + - option: You can use it to make text disappear. + feedback: That's not right... hint: '`{echo}` is used after an `{ask}` command.' - question_score: '10' - 3: - mp_choice_options: - - feedback: "`{print}` prints text, but it doesn't ask questions." - option: "```\n{print} What is your favorite color?\n```" - - option: "```\n{ask} {print} What is your favorite color?\n```" - feedback: You only need one command, not two. - - option: "```\n{ask} What is your favorite color?\n```" - feedback: Great! - - feedback: '`{echo}` repeats your answer back to you.' - option: "```\n{echo} What is your favorite color?\n```" - hint: You can ask something with the `{ask}` command correct_answer: C question_score: '10' - question_text: How do you ask what someone's favorite color is? 9: + question_text: What's wrong with this code? + code: |- + {print} Hello! + {print} How are you doing? + {echo} So you are doing... mp_choice_options: - option: '`{print}` in line 1 should be `{ask}`' feedback: No, `{print}` is right. Where is the question being asked? - - feedback: Super! - option: '`{print}` in line 2 should be `{ask}`' - - feedback: No, `{echo}` is right. Where is the question being asked? - option: '`{echo}` in line 3 should be `{ask}`' - - feedback: Look carefully for the mistake... - option: Nothing. This is a perfect code! + - option: '`{print}` in line 2 should be `{ask}`' + feedback: Super! + - option: '`{echo}` in line 3 should be `{ask}`' + feedback: No, `{echo}` is right. Where is the question being asked? + - option: Nothing. This is a perfect code! + feedback: Look carefully for the mistake... hint: '`{ask}` allows you to ask a question' correct_answer: B - code: "{print} Hello!\n{print} How are you doing?\n{echo} So you are doing..." - question_text: What's wrong with this code? - question_score: '10' - 5: - code: "{ask} What is your favorite pet?\n_ So your favorite pet is..." - correct_answer: D - mp_choice_options: - - feedback: No, you would like the answer to be repeated back to you. - option: '`{print}`' - - option: '`Hedy`' - feedback: Hedy isn't a command. - - option: '`{ask}`' - feedback: With `{ask}` you can ask a question. - - feedback: Right on! - option: '`{echo}`' - question_text: Which command is missing in line 2? question_score: '10' - hint: You want to see the answer at the end of line 2... 10: - code: "{ask} Are you ready to go to level 2?\n{echo}\n{echo}" + question_text: Which output will be in your output screen after you've run this code? + code: |- + {ask} Are you ready to go to level 2? + {echo} + {echo} mp_choice_options: - option: Are you ready to go to level 2? feedback: There are two `{echo}` commands - - feedback: Great job! - option: "Yes!\nYes!" + - option: |- + Yes! + Yes! + feedback: Great job! - option: Yes! feedback: There are two `{echo}` commands - - option: "Are you ready to go to level 2?\nYes!" + - option: |- + Are you ready to go to level 2? + Yes! feedback: There are two `{echo}` commands - question_text: Which output will be in your output screen after you've run this code? - correct_answer: B hint: Let's go! + correct_answer: B question_score: '10' - 12: - 10: + 2: + 1: + question_text: Which statement is true? mp_choice_options: - - option: "```\n{for} i {in} {range} 1 {to} 3\n```" - feedback: This is a hard one! All the actions on the list must be in the song. - - option: "```\n{for} action {in} actions\n```" - feedback: You are amazing! - - feedback: This is a hard one! All the actions on the list must be in the song. - option: "```\n{repeat} 3 {times}\n```" - - feedback: This is a hard one! All the actions on the list must be in the song. - option: "```\n{print} actions {at} {random}\n```" + - option: You can use the `{print}` command to ask questions. + feedback: That is what ask is for + - option: You can use the `{ask}` command to echo answers. + feedback: That is not true + - option: With the `{print}` command you can make text appear + feedback: Good + - option: With the `{sleep}` command, you can remove text from the screen. + feedback: That's not how `{sleep}` works. + hint: '`{print}` still works the same way as in level 1' + correct_answer: C + question_score: '10' + 2: + question_text: Which code is correct? + mp_choice_options: + - option: |- + ``` + name {is} {ask} What is your name? + ``` + feedback: Super! + - option: |- + ``` + {ask} {is} name What is your name + ``` + feedback: The words are right, the order is not! + - option: |- + ``` + {ask} What is your name? + ``` + feedback: This worked in level 1, but in level 2 and up it works differently. + - option: |- + ``` + {ask} What is your name? {is} name + ``` + feedback: The words are right, the order isn't! + hint: '`{ask}` doesn''t work like in level 1' + correct_answer: A + question_score: '10' + 3: + question_text: What appears on your output screen when you run this code? + code: |- + name {is} Marleen + {print} name goes to the market and she buys an apple. + mp_choice_options: + - option: name goes to the market and she buys an apple. + feedback: The word name is replaced with Marleen + - option: Marleen goes to the market. + feedback: The second part of the sentence isn't left out! + - option: Marleen goes to the market and she buys an apple. + feedback: Right on! + - option: Marleen goes to the market and Marleen buys an apple. + feedback: She is not replaced with the name + hint: The word name is replaced with Marleen + correct_answer: C question_score: '10' - hint: This is a hard one! All the actions on the list must be in the song. - question_text: Which line of code should be filled in at the ??? to complete the song ? - correct_answer: B - code: "actions = 'clap your hands', 'stomp your feet', 'shout Hurray!'\n???\n {for} i {in} {range} 0 {to} 1\n {print} 'if youre happy and you know it'\n {print} action\n {print} 'if youre happy and you know it and you really want to show it'\n {print} 'if youre happy and you know it'\n {print} action" 4: + question_text: What will you see on the output screen when you run this code? + code: |- + name {is} Hedy + {print} Hi my name is name! mp_choice_options: - - feedback: No - option: Line 1 and 2 - - feedback: No - option: Line 1, 2 and 3 - - option: Line 1, 2 and 4 - feedback: No - - feedback: Perfect! - option: All of the lines + - option: Hi my name is name + feedback: The variable name is replaced with Hedy + - option: Hi my name is Hedy + feedback: The variable name is replaced with Hedy + - option: Hi my Hedy is name + feedback: The variable name is replaced with Hedy + - option: Hi my Hedy is Hedy + feedback: Correct, this mistake will be fixed in level 4! + hint: '''name'' is being replaced with ''Hedy'' in both places' correct_answer: D question_score: '10' - hint: Does line 3 need quotation marks too? - code: "{print} Welcome to the online shoe shop\ncategory = {ask} What kind of shoes are you looking for?\n{if} category = high heels\n {print} High heels are 50% off now!" - question_text: In which lines are quotation marks needed to get the code to work? - 3: - hint: The quotation marks are used correctly + 5: + question_text: What happens when you use the `{sleep}` command? mp_choice_options: - - option: The name of the variable is different in line 1 than in line 2. - feedback: Correct! - - feedback: That's not true - option: The quotation marks aren't used correctly in line 2 - - option: You can't use the = sign when using an {ask} command - feedback: That's not true - - feedback: That's not true - option: Nothing is wrong. - code: "favorite_animal = {ask} 'What is your favorite animal?'\n{print} 'I like ' favoriteanimal ' too!'" - correct_answer: A - question_text: What's wrong with this code? + - option: It slows down your computer + feedback: fortunately not! + - option: It closes down Hedy + feedback: fortunately not! + - option: Your program pauses for a second and then continues + feedback: That's right! + - option: You put it at the end so Hedy knows your program is finished + feedback: No it would be useless at the end of your code + hint: The computer waits for a second at the `{sleep}` command + correct_answer: C question_score: '10' - 8: + 6: + question_text: What should be on the lines? + code: |- + {print} And the award for best programming language goes to... + _ + {print} Hedy! mp_choice_options: - - feedback: No - option: "```\n{print} '7 / 2'\n```" - - option: "```\n{print} 7 / 2\n```" - feedback: That is right! - - option: "```\n{print} 7 : 2\n```" - feedback: No - - feedback: No - option: "```\n{print} 7 * 2\n```" - hint: 7 devided by 2 is 3.5 - code: '3.5' - question_text: Which code was used to create this output? + - option: '`{sleep}`' + feedback: Perfect! + - option: '`{echo}`' + feedback: There is nothing to repeat back here + - option: '`{print}`' + feedback: There is no text there to `{print}` there + - option: '`{ask}`' + feedback: There is no question there to be asked + hint: Pause for dramatic effect... + correct_answer: A question_score: '10' + 7: + question_text: What command should be used on line 2? + code: |- + {print} I will explode in 3 seconds! + _ + {print} BOOM! + mp_choice_options: + - option: |- + ``` + {print} 3 + ``` + feedback: You don't need to `{print}` + - option: |- + ``` + {sleep} 3 + ``` + feedback: Perfect! + - option: |- + ``` + {sleep} + ``` + feedback: This way the bomb will explode in 1 second + - option: |- + ``` + {sleep} {sleep} {sleep} + ``` + feedback: Make it easier on yourself by using the number 3 + hint: You want the computer to wait for 3 seconds correct_answer: B - 9: question_score: '10' - mp_choice_options: - - feedback: You won nothing - option: "```\nprizes = 'one' 'million' 'dollars', 'nothing'\n```" - - feedback: You won nothing - option: "```\nprizes = 'one million dollars, nothing'\n```" - - option: "```\nprizes = 'one million dollars', 'nothing'\n```" - feedback: Winner! - - feedback: You won nothing - option: "```\n'prizes' = 'one million dollars', 'nothing'\n```" - hint: The items on the list should be in quotation marks + 8: + question_text: How would you correct the first line of code? + code: |- + {ask} {is} How old are you? + {print} age + mp_choice_options: + - option: |- + ``` + age {ask} {is} How old are you? + ``` + feedback: That is the wrong order + - option: |- + ``` + {ask} {is} age How old are you? + ``` + feedback: That is the wrong order + - option: |- + ``` + age {is} {ask} How old are you? + ``` + feedback: You get it! + - option: |- + ``` + age {is} How old are you? + ``` + feedback: Where is the `{ask}` command? + hint: The variable name should come first correct_answer: C - code: "???\n{print} 'You won ' prizes {at} {random} '!'" - question_text: Which code should be filled in in line 1 at the ??? - 7: - mp_choice_options: - - feedback: Terrific! - option: "It's my birthday! I've brought some snacks!\nFor you I have brought:\ncookies\ngrapes" - - option: "It's my birthday! I've brought some snacks!\nFor you I have brought:\ngrapes" - feedback: There's more options than just one - - option: "It's my birthday! I've brought some snacks!\nFor you I have brought:\ncheese\ngrapes" - feedback: A vegan person can't have cheese - - option: "It's my birthday! I've brought some snacks!\nFor you I have brought:\ngrapes\ncookies" - feedback: Almost there, but look at the order of snacks in the list - question_text: Which output does a vegan get? - hint: What item is removed from the list when you answer 'vegan'? - code: "menu = 'cookies', 'cheese', 'grapes'\n{print} \"It's my birthday! I`ve brought some snacks!\"\ndiet = {ask} 'Do you have any dietary restrictions?'\n{if} diet = 'gluten free'\n {remove} 'cookies' {from} menu\n{if} diet = 'vegan'\n {remove} 'cheese' {from} menu\n{print} 'For you I have brought: '\n{for} snack {in} menu\n {print} snack" question_score: '10' - correct_answer: A - 2: - hint: The second line is the same in each code, pay attention to the first line + 9: + question_text: What is going wrong in this code? + code: |- + dogs {is} animal + {print} I love animal mp_choice_options: - - feedback: All the different values of flavors should be in quotation marks. - option: "```\nflavors {is} vanilla, strawberry, chocolate\n{print} 'I would like a ' flavors {at} {random} ' cake.'\n```" - - feedback: All the different values of flavors should be in quotation marks. - option: "```\n'flavors = vanilla, strawberry, chocolate'\n{print} 'I would like a ' flavors {at} {random} ' cake.'\n```" - - option: "```\nflavors = 'vanilla', 'strawberry', 'chocolate'\n{print} 'I would like a ' flavors {at} {random} ' cake.'\n```" - feedback: Alright! - - feedback: All the different values of flavors should be in quotation marks. - option: "```\n flavors = 'vanilla, strawberry, chocolate'\n {print} 'I would like a ' flavors {at} {random} ' cake.'\n ```" - correct_answer: C + - option: 'Line 1 should say: dogs `{is}` animals' + feedback: The variable name is animal + - option: 'Line 1 should say: animal `{is}` dogs' + feedback: Great! + - option: 'Line 2 should say: `{print}` I love animals' + feedback: The variable name is animal + - option: 'Line 2 should say: `{sleep}` I love animals' + feedback: Sleep is not used to `{print}` text + hint: You want to `{print}` 'I love dogs' + correct_answer: B question_score: '10' - question_text: Which of these codes is correct? + 10: + question_text: What command should be used on the line 1? + code: |- + flavor {is} _ + {print} Your favorite icecream is... + {sleep} + {print} flavor + mp_choice_options: + - option: |- + ``` + {sleep} 3 + ``` + feedback: You want to know the favorite flavor! + - option: |- + ``` + {print} strawberries + ``` + feedback: You do not want a `{print}` command at the middle of the line... + - option: |- + ``` + strawberries, chocolate, vanilla + ``` + feedback: This way you are making a list. You don't want that now. + - option: |- + ``` + {ask} What flavor icecream do you like? + ``` + feedback: That's right! + hint: You want to `{ask}` a question + correct_answer: D + question_score: '10' + 3: 1: - code: "{print} 'three and a half plus one and a half is...'\n{print} 3.5 + 1.5" - hint: Both lines are printed! + question_text: What command(s) do you use to let Hedy pick something arbitrarily? mp_choice_options: - - feedback: Don't forget the first line of code! - option: '5' - - feedback: This is not the one! - option: 3.5 + 1.5 - - option: "three and a half plus one and a half is...\nfive" - feedback: Take a close look at the second line... - - option: "three and a half plus one and a half is...\n5" - feedback: Great job! - question_text: Which output is correct? + - option: '`{print}`' + feedback: '`{print}` is used to print text' + - option: '`{ask}`' + feedback: '`{ask}` is used to ask a question' + - option: '`{is}`' + feedback: '`{is}` is used to make a list' + - option: '`{at}` `{random}`' + feedback: Correct! + hint: Arbitrarily means without a plan or randomly. correct_answer: D question_score: '10' - 6: - correct_answer: C - question_text: Which line should be filled in at the ??? + 2: + question_text: What's wrong with this code? + code: |- + animals {is} dog cat cow + {print} animals {at} {random} mp_choice_options: - - feedback: What if you only order fries and a drink? - option: "```\nprice = 14\n```" - - option: "```\nprice = '14'\n```" - feedback: What if you only order fries and a drink? - - feedback: Excellent! - option: "```\nprice = price + 2\n```" - - feedback: Almost there! - option: "```\nprice = + 2\n```" - hint: What if you only order fries and a drink? - code: "{print} 'Welcome to McHedy!'\norder = {ask} 'Would you like a hamburger or fries?'\n{if} order = 'hamburger'\n price = 12\n{if} order = 'fries'\n price = 4\ndrinks = {ask} 'Would you like a drink with that for 2 dollars?'\n{if} drinks = 'yes'\n ???\n{print} 'That will be ' price ' dollar please'" + - option: 'You need commas in line 1: dog, cat, cow.' + feedback: Good job! + - option: Line 1 needs to start with `{print}`. + feedback: No, you don't need `{print}` + - option: Line 2 needs to say 'animal' instead of 'animals' + feedback: animals is correct. + - option: '`{at} {random}` is spelled incorrectly' + feedback: '`{at} {random}` is the correct spelling' + hint: There's something wrong in line 1 + correct_answer: A question_score: '10' - 5: - code: "name {is} {ask} 'What is your name?'\n{if} name {is} 'Agent007'\n a {is} 'Go to the airport '\nelse\n a {is} 'Go to the train station '\npassword {is} {ask} 'What is the password?'\n{if} password {is} 'TOPSECRET'\n b {is} 'tomorrow at 02.00'\n{else}\n b {is} 'today at 10.00'\n{print} a + b" - question_text: What output does Agent007 get when they put in the correct password? - mp_choice_options: - - feedback: The agent won't be catching any bad guys here - option: Go to the train station today at 10.00 - - feedback: You've cracked the code! - option: Go to the airport tomorrow at 02.00 - - option: Go to the train station tomorrow at 02.00 - feedback: The agent won't be catching any bad guys here - - option: Go to the airport tomorrow at 10.00 - feedback: The agent won't be catching any bad guys here + 3: + question_text: How do you fix the mistake in line 2? + code: |- + options {is} rock, paper, scissors + {print} rock, paper, scissors {at} {random} + mp_choice_options: + - option: |- + ``` + {at} {random} {print} options + ``` + feedback: You're almost there. The order of the words isn't right yet. + - option: |- + ``` + {print} rock {at} {random} + ``` + feedback: you don't always want the Hedy to {print} rock, sometimes you want scissors or paper. + - option: |- + ``` + {print} options {at} {random} + ``` + feedback: Very good! + - option: Nothing, the code is correct! + feedback: Look carefully for the mistake + hint: The variable (the list) is called options. + correct_answer: C question_score: '10' + 4: + question_text: What should change in line 2 to print a random price? + code: |- + prices {is} 1 dollar, 100 dollar, 1 million dollar + {print} price {at} {random} + mp_choice_options: + - option: |- + ``` + {print} price + ``` + feedback: You don't want to `{print}` the word price, but you want to `{print}` one price out of your list `{at} {random}` + - option: |- + ``` + {print} prices {at} {random} + ``` + feedback: Great! You've really paid attention. + - option: |- + ``` + {print} {at} {random} price + ``` + feedback: '`{at} {random}` is placed behind the variable.' + - option: Nothing, this code is alright. + feedback: Look carefully for the mistake you missed! + hint: The variable name is prices correct_answer: B - hint: The correct password is TOPSECRET - 5: + question_score: '10' 5: - mp_choice_options: - - feedback: Indeed! - option: Because it needs to be in capitals, so SECRET - - feedback: No, this is not the password. - option: Because the password is alarm - - option: Because it's spelled wrong. - feedback: That's not how you spell secret - - option: Because Hedy makes a mistake - feedback: No, Hedy is right + question_text: What is wrong in this code? + code: |- + question {is} {ask} What do you want to know? + {print} question + answers {is} yes, no, maybe + {print} answers {at} {random} + mp_choice_options: + - option: Line 1 needs to say `{print}` instead of `{ask}` + feedback: No, that's not wrong. + - option: Line 2 needs to say `{ask}` instead of `{print}` + feedback: No that's not wrong. + - option: Line 2 needs to say answers `{at} {random}` `{is}` yes, no, maybe + feedback: No, that's not wrong. + - option: Nothing, this code is perfect + feedback: That's right! + hint: Does this code even have a mistake? + correct_answer: D question_score: '10' - code: "password {is} {ask} 'What is the password?'\n{if} password {is} SECRET {print} 'Correct!'\n{else} {print} 'ALARM! INTRUDER!'" - correct_answer: A - hint: The spelling of the word has to be exactly the same. - question_text: Why will Hedy say 'ALARM! INTRUDER' when you type in 'secret'? - 8: + 6: + question_text: What's wrong with this code? + code: |- + question {is} {ask} What do you want to know? + answers yes, no, maybe + {print} answers {at} {random} mp_choice_options: - - option: "```\nfavorite animal\n```" - feedback: That's not the variable name. - - option: "```\nanimal\n```" - feedback: Great job! - - option: '`{if}`' - feedback: '`{if}` is already there' - - feedback: No, that's not it. - option: '`{print}`' - question_score: '10' - question_text: Which word should be on the place of the blank? - code: "animal {is} {ask} 'What is your favorite animal?'\n{if} _ {is} penguin {print} 'Thats my favorite animal too!'\n{else} {print} 'Cool! I like penguins.'" - hint: What the variable name? + - option: Line 2 needs to say question instead of answers + feedback: No that's not right + - option: Line 2 needs the `{is}` command + feedback: Correct + - option: Line 3 needs to say answer instead of answers + feedback: No the variable's called answers + - option: Nothing! This code is great! + feedback: Actually, line 2 has a mistake. + hint: There is something wrong with line 2. correct_answer: B + question_score: '10' 7: - hint: After `{else}` a `{print}` command follows - mp_choice_options: - - feedback: '`{if}` is in the line above.' - option: '`{if}`' - - option: '`{at}` `{random}`' - feedback: No, you don't need `{at} {random}`. - - feedback: There already is an `{else}` command - option: '`{else}`' - - feedback: Awesome! - option: '`{print}`' + question_text: What does the `{add}` command do? + code: |- + books {is} Harry Potter, The Hobbit, Green Eggs and Ham + your_book {is} {ask} What is your favorite book? + {add} your_book {to} books + {print} books {at} {random} + mp_choice_options: + - option: The `{add}` command removes a random book from the list + feedback: The remove command removes, the add command adds + - option: The `{add}` command adds a random book to a list + feedback: It doesn't. It adds your answer to the list! + - option: The `{add}` command adds your favorite book to the list + feedback: Correct! + - option: The `{add}` command prints your favorite book. + feedback: No, it adds your favorite book to the list + hint: The `{add}` command adds a book, but which one? + correct_answer: C question_score: '10' - question_text: Which word should be in the place of the blank? + 8: + question_text: What is the output of this code? + code: |- + crisps {is} sea salt, paprika, sour cream + {remove} sea salt {from} crisps + {remove} paprika {from} crisps + {print} crisps {at} {random} + mp_choice_options: + - option: You can't tell, because Hedy will `{print}` one of the 3 flavors `{at} {random}` + feedback: Take a look at the `{remove}` commands + - option: sea salt + feedback: sea salt is removed from the list + - option: paprika + feedback: Paprika is removed from the list + - option: sour cream + feedback: That's right! + hint: There are 3 flavors, bit 2 are removed. Which one remains? correct_answer: D - code: "{print} 'I can predict if you will be a millionair or not!'\nname {is} {ask} 'Whats your name?'\n{if} name {is} Hedy {print} 'You will be a millionair!'\n{else} _ 'Unfortunately... No big money for you.'" + question_score: '10' + 9: + question_text: What's wrong with this code? + code: |- + colors {is} blue, purple, green + chosen_color {is} {ask} Which hair color wouldn't you like to have? + {remove} chosen_color {from} colors + {print} I will dye my hair color {at} {random} + mp_choice_options: + - option: 'Line 3 should say: `{remove}` blue `{from}` colors' + feedback: Maybe you want blue hair though! + - option: Line 3 should have an `{add}` command instead of a `{remove}` command + feedback: You want to remove the chosen color so `{remove}` is right. + - option: In line 4 the variable should be called colors instead of color + feedback: Great job! + - option: Nothing, this is a correct code! + feedback: Find the mistake! + hint: Look at line 4 + correct_answer: C + question_score: '10' 10: - question_text: Which monster is standing behind door 1? + question_text: What should be on the _? + code: |- + walkers {is} dad, mom, Sam, Petra + walked_yesterday {is} {ask} Who walked the dogs yesterday? + {print} walked_yesterday shouldn't have to walk the dogs again today + _ + {print} walkers {at} {random} , it's your turn to walk the dogs! + mp_choice_options: + - option: |- + ``` + {remove} walked_yesterday {from} walkers + ``` + feedback: Super! + - option: |- + ``` + {remove} walked_yesterday {to} walkers + ``` + feedback: '`{remove} {from}` or `{add} {to}`, not `{remove} {to}`' + - option: |- + ``` + {remove} walkers {from} yesterday + ``` + feedback: yesterday is not a variable + - option: |- + ``` + {add} walked_yesterday {to} walkers + ``` + feedback: This increased the chance that the person who walked yesterday now has to do it again. That's mean. + hint: The person who walked the dogs yesterday should be removed from the list. + correct_answer: A + question_score: '10' + 4: + 1: + question_text: Which of these codes is correct? mp_choice_options: - - feedback: Awesome! - option: Hedy picks a random monster each time. - - feedback: Not always... - option: vampire - - option: werewolf - feedback: Not always... - - feedback: Not always... - option: giant spider - code: "{print} 'Escape from the haunted house!'\n{print} 'There are 3 doors in front of you'\ndoor {is} {ask} 'Which door do you choose?'\nmonsters {is} vampire, werewolf, giant spider\n{if} door {is} 2 {print} 'Yay, you can escape!'\n{else} {print} 'You are being devoured by a... ' monsters {at} {random}" + - option: |- + ``` + {print} 'Im very excited to take this quiz!' + ``` + feedback: That's right + - option: |- + ``` + {print} Im very excited to take this quiz! + ``` + feedback: '{print} now needs quotation marks!' + - option: |- + ``` + {print} 'I'm very excited to take this quiz!' + ``` + feedback: do not use apostrophe or use backticks instead + - option: |- + ``` + {print} 'I'm very excited to take this quiz! + ``` + feedback: careful when using quotes and apostrophe + hint: In level 4 you need quotation marks for 2 commands. correct_answer: A question_score: '10' - hint: Mind the last 3 words... monsters `{at} {random}`... 2: + question_text: Which code uses the proper quotation marks? mp_choice_options: - - feedback: That's right! - option: fun - - option: less fun - feedback: If the name is Hedy, it will say 'fun'' - - option: Hedy - feedback: No, it doesn't print the name - - option: Error - feedback: Fortunately not! - code: "name {is} {ask} 'What is your name?'\n{if} name {is} Hedy {print} 'fun' {else} {print} 'less fun'" - question_text: What appears in your output screen when you type in the name Hedy? + - option: |- + ``` + {print} `hello` + ``` + feedback: This quotation mark is skewed, you need a straight one. + - option: |- + ``` + {print} 'hello' + ``` + feedback: Correct + - option: |- + ``` + {print} hello + ``` + feedback: There are no quotation marks here! + - option: |- + ``` + {print} ,hello, + ``` + feedback: This is a comma, you need quotation marks. + hint: Pick the right quotation marks. + correct_answer: B + question_score: '10' + 3: + question_text: Where are the quotation marks used correctly? + mp_choice_options: + - option: |- + ``` + {print} Hi Im Hedy + ``` + feedback: Add quotation marks please! + - option: |- + ``` + {print} 'Hi Im Hedy + ``` + feedback: Both before and after the words you want to print should be a quotation mark. + - option: |- + ``` + '{print} Hi Im Hedy' + ``` + feedback: The first quotation mark should be behind the word `{print}` + - option: |- + ``` + {print} 'Hi Im Hedy' + ``` + feedback: Perfect! + hint: Both before and after the words you want to print should be a quotation mark. + correct_answer: D + question_score: '10' + 4: + question_text: Which statement is true? + mp_choice_options: + - option: 'You need quotation marks around the word `{print}`, like this: `''{print}''`.' + feedback: The quotation marks shouldn't be around the command itself. + - option: You need quotation marks around the words you want to print. + feedback: Super! + - option: You do not need quotation marks when using the `{ask}` command + feedback: Both `{print}` and `{ask}` require quotation marks + - option: You can choose yourself whether to use quotation marks or not. + feedback: Unfortunately, Hedy is stricter than that. + hint: From level 4 on you need to use quotation marks. + correct_answer: B + question_score: '10' + 5: + question_text: What has to be changed in order for the game to work? + code: |- + options {is} rock, paper, scissors + {print} 'options {at} {random}' + mp_choice_options: + - option: |- + ``` + '{print} options {at} {random}' + ``` + feedback: Never put the quotation mark in front of the `{print}` command. + - option: |- + ``` + {print} 'options' {at} {random} + ``` + feedback: options is a variable. You don't literally want to print 'options {at} {random}'. + - option: |- + ``` + {print} options {at} {random} + ``` + feedback: That's right + - option: Nothing, the game already works! + feedback: Look carefully. There is an error. + hint: You don't want Hedy to literally print 'options {at} {random}', you want it to print 'rock' or 'paper' or 'scissors'. + correct_answer: C question_score: '10' - hint: '`{if}` name `{is}` Hedy `{print}` ...?' - correct_answer: A 6: + question_text: What would be a good next line in this code? + code: prices {is} 1 dollar, 100 dollars, 1 million dollars mp_choice_options: - - option: "```\n{if}\n```" - feedback: '`{if}` is already in the line above' - - feedback: No, you need `{else}`. - option: "```\n{at} {random}\n```" - - feedback: Great! - option: "```\n{else}\n```" - - option: "```\n{print}\n```" - feedback: '`{print}` is already there, we need a word before it!' - hint: '`{if}` goes together with...?' + - option: |- + ``` + {print} 'You win...' prices {at} {random} + ``` + feedback: Great! You get it! + - option: |- + ``` + {print} You win... 'prices {at} {random}' + ``` + feedback: Hedy will literally print 'prices {at} {random}' + - option: |- + ``` + {print} You win... prices {at} {random} + ``` + feedback: You need some quotation marks! + - option: |- + ``` + {print} 'You win... prices {at} {random}' + ``` + feedback: Hedy will literally print 'prices {at} {random}'' + hint: 'Think carefully: what is a variable and should be outside of the quotation marks? And what are normal words that should be inside?' + correct_answer: A + question_score: '10' + 7: + question_text: What's wrong with this code? + code: |- + question {is} {ask} What do you want to know? + answers {is} yes, no, maybe + {print} answers {at} {random} + mp_choice_options: + - option: Quotation marks are missing in line 1 + feedback: Correct! + - option: Quotation marks are missing in line 2 + feedback: A variable doesn't need quotes + - option: Quotation marks are missing in line 3 + feedback: You don't want Hedy to literally print 'answers {at} {random}' so no quotation marks needed here! + - option: Nothing, this code is good as is! + feedback: Look carefully. You missed a mistake! + hint: Check each line on whether they'd need quotation marks or not. + correct_answer: A + question_score: '10' + 8: + question_text: What would be a good next line for this code? + code: |- + {print} 'Welcome at the money show!' + {print} 'In front of you are 3 doors' + door {is} {ask} 'Which door do you choose?' + mp_choice_options: + - option: |- + ``` + {print} So you pick door door + ``` + feedback: We need quotation marks + - option: |- + ``` + {print} 'So you pick ' door door + ``` + feedback: If the player chooses door 3, Hedy will say 'So you pick 3 3' + - option: |- + ``` + {print} 'So you pick door ' door + ``` + feedback: Super! + - option: |- + ``` + {print} 'So you pick door door' + ``` + feedback: Hedy will literally print 'So you pick door door' + hint: The second word door should be replaced with the number, the first should still be the word door... correct_answer: C question_score: '10' - question_text: Which word should be on the place of the blank in the last line? - code: "{print} 'Im Hedy the football fortune teller!'\n{print} 'I will predict what place your team will end up!'\nclub is {ask} 'Which club is your favorite?'\n{if} club {is} ajax {print} 'Ajax is going to win of course!'\n_ {print} 'Sorry, your club is gonna be in last place...'" 9: + question_text: What will never appear in your output screen? + code: |- + clubs {is} Real Madrid, Bayern Munchen, Manchester United, Ajax + {print} clubs {at} {random} ' is going the win the champions league' + mp_choice_options: + - option: Ajax is going to win the champions league + feedback: Hedy could `{print}` that + - option: Real Madrid is going to win the champions league + feedback: Hedy could `{print}` that + - option: Bayern Munchen is going to win the champions league + feedback: Hedy could `{print}` that + - option: FC Barcelona is going to win the champions league + feedback: That's right. It's not in the list + hint: What are Hedy's options to randomly pick from? + correct_answer: D question_score: '10' - question_text: Which door should you choose to escape?? - correct_answer: B + 10: + question_text: Which statement is true? + code: |- + people {is} mom, dad, Emma, Sophie + {print} The dishes are done by... + {print} people {at} {random} mp_choice_options: - - feedback: Bad choice! You're being eaten - option: '1' - - feedback: Super! You escaped! - option: '2' - - feedback: Bad choice! You're being eaten. - option: '3' - - option: It's a trap, you will always be eaten! - feedback: Luckily not! - hint: One of the doors will keep you safe.. - code: "{print} 'Escape from the haunted house!'\n{print} 'There are 3 doors in front of you'\ndoor {is} {ask} 'Which door do you choose?'\nmonsters {is} vampire, werewolf, giant spider\n{if} door {is} 2 {print} 'Yay, you can escape!'\n{else} {print} 'You are being devoured by a... ' monsters {at} {random}" + - option: Quotation marks are missing in line 1 + feedback: A list doesn't need quotation marks + - option: Quotation marks are missing in line 2 + feedback: Correct + - option: Quotation marks are missing in both line 2 and 3 + feedback: Line 3 doesn't need quotation marks because it's not printed literally + - option: Nothing, this code has no mistakes + feedback: You missed one! + hint: One line needs quotation marks, because you want it to be printed literally. + correct_answer: B + question_score: '10' + 5: 1: + question_text: Which command should be filled in on the _? + code: |- + number {is} {ask} 'What is your lucky number?' + {if} number {is} 5 {print} 'Mine too!' + _ {print} 'My lucky number is 5!' mp_choice_options: - - feedback: There already is a `{print}` command. - option: '`{print}`' + - option: '`{print}`' + feedback: There already is a `{print}` command. - option: '`{if}`' feedback: The `{if}` command is used in the line above. - option: '`{sleep}`' feedback: That's not it! - option: '`{else}`' feedback: That's right! - question_text: Which command should be filled in on the _? hint: Which one goes together with the `{if}` command? - question_score: '10' correct_answer: D - code: "number {is} {ask} 'What is your lucky number?'\n{if} number {is} 5 {print} 'Mine too!'\n_ {print} 'My lucky number is 5!'" + question_score: '10' + 2: + question_text: What appears in your output screen when you type in the name Hedy? + code: |- + name {is} {ask} 'What is your name?' + {if} name {is} Hedy {print} 'fun' {else} {print} 'less fun' + mp_choice_options: + - option: fun + feedback: That's right! + - option: less fun + feedback: If the name is Hedy, it will say 'fun'' + - option: Hedy + feedback: No, it doesn't print the name + - option: Error + feedback: Fortunately not! + hint: '`{if}` name `{is}` Hedy `{print}` ...?' + correct_answer: A + question_score: '10' + 3: + question_text: What is the right password? + code: |- + password {is} {ask} 'What is the password?' + {if} password {is} SECRET {print} 'Correct!' + {else} {print} 'ALARM! INTRUDER!' + mp_choice_options: + - option: Correct! + feedback: This is printed when you type in the correct password + - option: SECRET + feedback: That's right! + - option: password + feedback: The password isn't password... + - option: ALARM INTRUDER + feedback: This is printed when you type in the incorrect password! + hint: '`{if}` password `{is}` ... `{print}` ''Correct!''' + correct_answer: B + question_score: '10' 4: - code: "password {is} {ask} 'What is the password?'\n{if} password {is} SECRET {print} 'Correct!'\n{else} {print} 'ALARM! INTRUDER!'" + question_text: What does Hedy print when you type in the wrong password? + code: |- + password {is} {ask} 'What is the password?' + {if} password {is} SECRET {print} 'Correct!' + {else} {print} 'ALARM! INTRUDER!' mp_choice_options: - - feedback: That's printed if the correct answer is given, not the wrong one... - option: Correct - - feedback: That's not the right answer - option: SECRET + - option: Correct + feedback: That's printed if the correct answer is given, not the wrong one... + - option: SECRET + feedback: That's not the right answer - option: Wrong! feedback: No, this is not what Hedy will print - option: ALARM! INTRUDER! @@ -732,1662 +907,2918 @@ levels: hint: Your computer will sound the alarm for intruders! correct_answer: D question_score: '10' - question_text: What does Hedy print when you type in the wrong password? - 3: + 5: + question_text: Why will Hedy say 'ALARM! INTRUDER' when you type in 'secret'? + code: |- + password {is} {ask} 'What is the password?' + {if} password {is} SECRET {print} 'Correct!' + {else} {print} 'ALARM! INTRUDER!' + mp_choice_options: + - option: Because it needs to be in capitals, so SECRET + feedback: Indeed! + - option: Because the password is alarm + feedback: No, this is not the password. + - option: Because it's spelled wrong. + feedback: That's not how you spell secret + - option: Because Hedy makes a mistake + feedback: No, Hedy is right + hint: The spelling of the word has to be exactly the same. + correct_answer: A + question_score: '10' + 6: + question_text: Which word should be on the place of the blank in the last line? + code: |- + {print} 'Im Hedy the football fortune teller!' + {print} 'I will predict what place your team will end up!' + club is {ask} 'Which club is your favorite?' + {if} club {is} ajax {print} 'Ajax is going to win of course!' + _ {print} 'Sorry, your club is gonna be in last place...' + mp_choice_options: + - option: |- + ``` + {if} + ``` + feedback: '`{if}` is already in the line above' + - option: |- + ``` + {at} {random} + ``` + feedback: No, you need `{else}`. + - option: |- + ``` + {else} + ``` + feedback: Great! + - option: |- + ``` + {print} + ``` + feedback: '`{print}` is already there, we need a word before it!' + hint: '`{if}` goes together with...?' + correct_answer: C + question_score: '10' + 7: + question_text: Which word should be in the place of the blank? + code: |- + {print} 'I can predict if you will be a millionair or not!' + name {is} {ask} 'Whats your name?' + {if} name {is} Hedy {print} 'You will be a millionair!' + {else} _ 'Unfortunately... No big money for you.' mp_choice_options: - - feedback: This is printed when you type in the correct password - option: Correct! - - feedback: That's right! - option: SECRET - - option: password - feedback: The password isn't password... - - feedback: This is printed when you type in the incorrect password! - option: ALARM INTRUDER + - option: '`{if}`' + feedback: '`{if}` is in the line above.' + - option: '`{at}` `{random}`' + feedback: No, you don't need `{at} {random}`. + - option: '`{else}`' + feedback: There already is an `{else}` command + - option: '`{print}`' + feedback: Awesome! + hint: After `{else}` a `{print}` command follows + correct_answer: D question_score: '10' - question_text: What is the right password? - hint: "`{if}` password `{is}` ... `{print}` 'Correct!'" + 8: + question_text: Which word should be on the place of the blank? + code: |- + animal {is} {ask} 'What is your favorite animal?' + {if} _ {is} penguin {print} 'Thats my favorite animal too!' + {else} {print} 'Cool! I like penguins.' + mp_choice_options: + - option: |- + ``` + favorite animal + ``` + feedback: That's not the variable name. + - option: |- + ``` + animal + ``` + feedback: Great job! + - option: '`{if}`' + feedback: '`{if}` is already there' + - option: '`{print}`' + feedback: No, that's not it. + hint: What the variable name? correct_answer: B - code: "password {is} {ask} 'What is the password?'\n{if} password {is} SECRET {print} 'Correct!'\n{else} {print} 'ALARM! INTRUDER!'" - 15: + question_score: '10' 9: + question_text: Which door should you choose to escape?? + code: |- + {print} 'Escape from the haunted house!' + {print} 'There are 3 doors in front of you' + door {is} {ask} 'Which door do you choose?' + monsters {is} vampire, werewolf, giant spider + {if} door {is} 2 {print} 'Yay, you can escape!' + {else} {print} 'You are being devoured by a... ' monsters {at} {random} mp_choice_options: - - feedback: No - option: Nothing. 1600 is not programmed into the app. - - feedback: No - option: you could eat some more - - option: That is alright - feedback: Yes! - - option: You have eaten enough for today - feedback: No - hint: 1600 is between 1000 and 2000 + - option: '1' + feedback: Bad choice! You're being eaten + - option: '2' + feedback: Super! You escaped! + - option: '3' + feedback: Bad choice! You're being eaten. + - option: It's a trap, you will always be eaten! + feedback: Luckily not! + hint: One of the doors will keep you safe.. + correct_answer: B question_score: '10' - correct_answer: C - code: "calories = {ask} 'How many calories have you eaten today?'\n {while} calories <= 1000\n {print} 'You could eat some more'\n {while} calories > 1000 {and} calories =< 2000\n {print} 'That is alright'\n {while} calories > 2000\n {print} 'You have had enough for today'" - question_text: What will the diet app say if you have eaten 1600 calories today? - 1: - mp_choice_options: - - feedback: That is not right. - option: '`=!`' - - option: '`==`' - feedback: You don't have to keep guessing if you've given the right answer. - - feedback: Correct - option: '`!=`' - - feedback: That's not it - option: '`=`' - correct_answer: C - hint: Keep guessing until you say Amsterdam + 10: + question_text: Which monster is standing behind door 1? + code: |- + {print} 'Escape from the haunted house!' + {print} 'There are 3 doors in front of you' + door {is} {ask} 'Which door do you choose?' + monsters {is} vampire, werewolf, giant spider + {if} door {is} 2 {print} 'Yay, you can escape!' + {else} {print} 'You are being devoured by a... ' monsters {at} {random} + mp_choice_options: + - option: Hedy picks a random monster each time. + feedback: Awesome! + - option: vampire + feedback: Not always... + - option: werewolf + feedback: Not always... + - option: giant spider + feedback: Not always... + hint: Mind the last 3 words... monsters `{at} {random}`... + correct_answer: A question_score: '10' - code: "answer = 0\n{while} answer _ 'Amsterdam'\n answer = {ask} 'What is the capital city of the Netherlands?'\n{print} 'You have given the correct answer'" - question_text: 'Which symbol should be used on the blank? Tip: You must keep guessing until you get it right.' - 4: - question_text: What's wrong with this code? + 6: + 1: + question_text: What's Hedy's output when you run this code? + code: '{print} 2*10' mp_choice_options: - - option: In line 1 == should be used instead of = - feedback: No that's not it - - option: Line 2 misses quotation marks - feedback: That's not right - - feedback: That's not it - option: In line 5 {if} should have been used instead of {while} - - feedback: You are correct - option: In line 5 != should have been used instead of == - code: "options = 1, 2, 3, 4, 5, 6\n{print} 'Throw 6 as fast as you can!'\nthrown = 0\ntries = 0\n{while} thrown == 6\n thrown = options {at} {random}\n {print} 'You threw ' thrown\n tries = tries + 1\n{print} 'Yes! You have thrown 6 in ' tries ' tries.'" - hint: There is something wrong in line 5 + - option: '20' + feedback: Correct! + - option: '12' + feedback: No, the plus sign is used in addition + - option: 2*10 + feedback: No, Hedy will calculate the answer + - option: '210' + feedback: Mind it's a calculation. + hint: The `*` is used as a multiplication sign + correct_answer: A question_score: '10' - correct_answer: D - 3: - code: "_ age < 18\n {print} 'you are not allowed in this bar'" + 2: + question_text: What do you use when you want to add two numbers? mp_choice_options: - - option: '`{in}`' + - option: '`-`' feedback: That's not it - - option: '`{while}`' - feedback: You are right - - option: '`{for}`' + - option: plus feedback: That's not it - - option: '`{range}`' + - option: '`*`' feedback: That's not it + - option: '`+`' + feedback: Correct! + hint: It's the plus sign. + correct_answer: D question_score: '10' - question_text: Which command should be filled in on the blank? - correct_answer: B - hint: You are not allowed in the bar as long as you are 17 or younger - 2: - mp_choice_options: - - feedback: No - option: "```\n{while} name = Hedy\n```" - - option: "```\n{while} age = 24\n```" - feedback: No - - feedback: Yes! - option: "```\n{while} time > 0\n```" - - option: "```\n{while} answer == yes'\n```" - feedback: A quotation mark is missing - question_text: Which of these codes has used the correct symbol(s)? - hint: When you are comparing two answers you should use == - question_score: '10' + 3: + question_text: What's Hedy's output when you run this code? + code: '{print} ''3*10''' + mp_choice_options: + - option: '30' + feedback: This would be the right answer if there were no quotation marks. + - option: '13' + feedback: Try again… + - option: 3*10 + feedback: Correct! There are quotation marks, so Hedy will print it literally. + - option: Nothing, Hedy will give an error message. + feedback: No, Hedy will print it literally. + hint: Mind the quotation marks!! correct_answer: C - 7: - hint: The last one should say you win. question_score: '10' - mp_choice_options: - - option: '... change the first {if} into a {while}' - feedback: Perfect! - - feedback: That's not quite right. - option: '... change the second {if} into a {while}' - - feedback: That's not quite right. - option: '... change the third {if} into a {while}' - - feedback: That's not quite right. - option: '... change the fourth {if} into a {while}' - correct_answer: A - question_text: How should this program be changed so that it works? - code: "{print} 'Guess which number'\nnumbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\nnumber = numbers {at} {random}\ngame = 'on'\n{if} game == 'on'\n guess = {ask} 'Which number do you think it is?'\n {if} guess < number\n {print} _\n {if} guess > number\n {print} _\n {if} guess == number\n {print} _\n game = 'over'" - 5: - hint: wetness should get less each time - mp_choice_options: - - option: = wetness - feedback: That will not change anything - - feedback: You can't have two times = in one line - option: = wetness = 1 - - option: = wetness - 1 - feedback: You are correct! - - feedback: The program should count down - option: = wetness + 1 + 4: + question_text: Kim is 10 years old. What will Hedy print for her? + code: |- + name = {ask} 'How many letters are in your name?' + age = {ask} 'How old are you?' + luckynumber = name*age + {print} 'Your lucky number is...' luckynumber + mp_choice_options: + - option: '30' + feedback: Mind, Hedy also prints 'Your lucky number is...' + - option: '10' + feedback: Please try again. + - option: Your lucky number is... 30 + feedback: That's right! + - option: Your lucky number is... 10 + feedback: Her lucky number is name times age... + hint: 'Kim has 3 letters, she is 10 years old so: letters times age = 3*10 = 30.' correct_answer: C - question_text: What should be placed on the blank to make this program work correctly? question_score: '10' - code: "wetness = 10\n{while} wetness != 0\n {print} 'Your hair is still wet, hair dryer on!'\n {sleep} 1\n {clear}\n wetness _\n\n{print} 'All dry!'" - 6: + 5: + question_text: If 5 people eat at this restaurant, how much do they have to pay in total? + code: |- + {print} 'Welcome to Hedys!' + people = {ask} 'How many people are eating with us tonight?' + price = people * 10 + {print} 'That will be ' price 'dollar please' mp_choice_options: - - option: '{while} should be {if}' - feedback: No that is not right - - feedback: No that is not right - option: '{if} should be {while}' - - option: Line 3 should start with more indentation - feedback: No that's not right - - feedback: That is correct - option: Line 2 should start with less indentation - hint: Look closely at the indentation + - option: 5 dollars + feedback: Unfortunately, it's not that cheap. + - option: 10 dollars + feedback: No, it's 10 dollars each. + - option: 15 dollars + feedback: The * means multiplication. + - option: 50 dollars + feedback: Great! + hint: '`price` `is` `people` `times` 10' correct_answer: D - question_text: What is wrong with this code? - question_score: '10' - code: "lives = 100\n {while} lives != 0\n answer = {ask} 'Are you annoyed yet?'\n {if} answer == 'yes'\n lives = lives - 1" - 8: - mp_choice_options: - - option: The lights and air freshener will turn off after 1 minute - feedback: False! - - option: The air freshener sprays once every minute and the lights stay on the whole time while you are on the toilet - feedback: Great job - - option: The air freshener sprays once you leave the toilet. - feedback: It only sprays when you're in there. - - feedback: That wouldn't be right. - option: The lights will always stay on. - hint: The block after the {while} command keeps happening while the toilet is occupied. - code: "{while} toilet == 'occupied'\n lights = 'on'\n air_freshener_sprays = 'yes'\n {sleep} 60\nlights = 'off'\nair_freshener_sprays = 'no'" question_score: '10' - correct_answer: B - question_text: Which statement is true about this automated toilet system? - 10: - hint: You win the game by having the most points. Your name should appear on the screen + 6: + question_text: How much does a hamburger cost in this virtual restaurant? + code: |- + {print} 'Welcome at Hedys diner' + food = {ask} 'What would you like to eat?' + price = 0 + {if} food {is} hamburger price = 15 + {if} food {is} fries price = 6 + mp_choice_options: + - option: 15 dollars + feedback: Super! + - option: 6 dollars + feedback: The fries are 6 dollars + - option: 0 dollars + feedback: The hamburger isn't free! + - option: 21 dollars + feedback: That's the price for a hamburger and fries! + hint: Mind the fourth line. correct_answer: A - mp_choice_options: - - option: name_player_1 - feedback: You are right! - - feedback: No they are losing! - option: name_player_2 - - feedback: You should fill in a name, not a number - option: points_player_1 - - feedback: You should fill in a name, not a number - option: points_player_2 - question_text: 'What should be filled in in the blanks? Tip: the player with the most points is in the lead.' - question_score: '10' - code: "name_player_1 = {ask} 'Name player 1:'\nname_player_2 = {ask} 'Name player 2:'\n{while} points_player_1 > points_player_2\n {print} _ ' is in the lead right now!'" - 2: - 10: - correct_answer: D - mp_choice_options: - - feedback: You want to know the favorite flavor! - option: "```\n{sleep} 3\n```" - - option: "```\n{print} strawberries\n```" - feedback: You do not want a `{print}` command at the middle of the line... - - option: "```\nstrawberries, chocolate, vanilla\n```" - feedback: This way you are making a list. You don't want that now. - - feedback: That's right! - option: "```\n{ask} What flavor icecream do you like?\n```" - hint: You want to `{ask}` a question - question_text: What command should be used on the line 1? question_score: '10' - code: "flavor {is} _\n{print} Your favorite icecream is...\n{sleep}\n{print} flavor" - 8: - hint: The variable name should come first + 7: + question_text: Why does line 7 say 'price is price + 3' instead of 'price is 3'? + code: |- + {print} 'Welcome at Hedys diner' + food = {ask} 'What would you like to eat?' + price = 0 + {if} food {is} hamburger price = price + 15 + {if} food {is} fries price = price + 6 + drinks = {ask} 'What would you like to drink?' + {if} drinks {is} coke price = price + 3 + {if} drinks {is} water price = price + 1 + {print} price ' dollars please' mp_choice_options: - - option: "```\nage {ask} {is} How old are you?\n```" - feedback: That is the wrong order - - feedback: That is the wrong order - option: "```\n{ask} {is} age How old are you?\n```" - - option: "```\nage {is} {ask} How old are you?\n```" - feedback: You get it! - - option: "```\nage {is} How old are you?\n```" - feedback: Where is the `{ask}` command? - question_text: How would you correct the first line of code? + - option: It could have been `price = 3` just as well. + feedback: No, that's not true. Hedy needs to add 3 dollars to the total. + - option: Because Hedy doesn't understand `price = 3`. + feedback: Hedy would understand, but it wouldn't be right. + - option: Because Hedy would otherwise forget about the previous order. The price would be 3 dollars in total. + feedback: That's right! + - option: Because the price is 0 dollars to begin with. + feedback: That's true, but not the reason + hint: The price shouldn't be 3, but 3 dollars more than it already was correct_answer: C - code: "{ask} {is} How old are you?\n{print} age" question_score: '10' - 5: + 8: + question_text: Why is this code incorrect? + code: |- + correct answer = 3*12 + answer = {ask} 'What is 3 times 12?' + {if} answer {is} correct answer {print} 'Good job!' + {else} {print} 'No... It was ' correct answer + mp_choice_options: + - option: There shouldn't be quotation marks in line 2 + feedback: No, there should be! + - option: The variable is called correct answer, but a variable's name can only be 1 word. So it should be correct_answer + feedback: Correct! + - option: The `{if}` and `{else}` commands should be in the same line. + feedback: No, that's not true. + - option: The variable in line 2 can't be called answer, because it is too similar to the variable correct answer. + feedback: Variable names can be similar, but they can't be 2 words... + hint: Inspect what the variables are called. + correct_answer: B question_score: '10' - hint: The computer waits for a second at the `{sleep}` command - mp_choice_options: - - feedback: fortunately not! - option: It slows down your computer - - option: It closes down Hedy - feedback: fortunately not! - - feedback: That's right! - option: Your program pauses for a second and then continues - - feedback: No it would be useless at the end of your code - option: You put it at the end so Hedy knows your program is finished + 9: + question_text: Imagine you love football a 10, you've eaten 2 bananas and have washed your hands 3 times today. How smart does the silly fortune teller think you are? + code: |- + {print} 'Im Hedy the silly fortune teller' + {print} 'I will predict how smart you are!' + football = {ask} 'On a scale of 0 to 10 how much do you love football?' + bananas = {ask} 'How many bananas have you eaten this week?' + hygiene = {ask} 'How many times did you wash your hands today??' + result = bananas + hygiene + result = result * football + {print} 'You are ' result 'percent smart.' + mp_choice_options: + - option: 10% + feedback: (2 bananas + 3 hygiene) * 10 football = 5*10 =? + - option: 32% + feedback: (2 bananas + 3 hygiene) * 10 football = 5*10 =? + - option: 50% + feedback: Super! You are 100 percent smart! + - option: 100% + feedback: (2 bananas + 3 hygiene) * 10 football = 5*10 =? + hint: (2 bananas + 3 hygiene) * 10 football = 5*10 =? correct_answer: C - question_text: What happens when you use the `{sleep}` command? - 4: - mp_choice_options: - - option: Hi my name is name - feedback: The variable name is replaced with Hedy - - feedback: The variable name is replaced with Hedy - option: Hi my name is Hedy - - option: Hi my Hedy is name - feedback: The variable name is replaced with Hedy - - option: Hi my Hedy is Hedy - feedback: Correct, this mistake will be fixed in level 4! question_score: '10' - hint: "'name' is being replaced with 'Hedy' in both places" - code: "name {is} Hedy\n{print} Hi my name is name!" - question_text: What will you see on the output screen when you run this code? - correct_answer: D - 3: + 10: + question_text: Which statement is true? + code: |- + name _ Hedy + {print} name 'is walking trough the forrest' mp_choice_options: - - feedback: The word name is replaced with Marleen - option: name goes to the market and she buys an apple. - - option: Marleen goes to the market. - feedback: The second part of the sentence isn't left out! - - feedback: Right on! - option: Marleen goes to the market and she buys an apple. - - feedback: She is not replaced with the name - option: Marleen goes to the market and Marleen buys an apple. - correct_answer: C - code: "name {is} Marleen\n{print} name goes to the market and she buys an apple." + - option: You can only fill in the word is on the `_` + feedback: You are allowed to use the `=` sign as well + - option: You can fill in either the word is or the `=` sign on the `_` + feedback: Amazing! + - option: You have to fill in =is= on the `_` + feedback: No, one `=` sign is enough + - option: You can only use the `=` sign when working with numbers, not with words. + feedback: You can also use `=` with words. + hint: '`{is}` and `=` are both allowed' + correct_answer: B question_score: '10' - question_text: What appears on your output screen when you run this code? - hint: The word name is replaced with Marleen + 7: 1: - correct_answer: C - mp_choice_options: - - option: You can use the `{print}` command to ask questions. - feedback: That is what ask is for - - option: You can use the `{ask}` command to echo answers. - feedback: That is not true - - option: With the `{print}` command you can make text appear - feedback: Good - - option: With the `{sleep}` command, you can remove text from the screen. - feedback: That's not how `{sleep}` works. - hint: '`{print}` still works the same way as in level 1' - question_score: '10' - question_text: Which statement is true? - 7: - hint: You want the computer to wait for 3 seconds + question_text: How many lines can you repeat at once with the `{repeat}` command at this level? mp_choice_options: - - option: "```\n{print} 3\n```" - feedback: You don't need to `{print}` - - feedback: Perfect! - option: "```\n{sleep} 3\n```" - - feedback: This way the bomb will explode in 1 second - option: "```\n{sleep}\n```" - - feedback: Make it easier on yourself by using the number 3 - option: "```\n{sleep} {sleep} {sleep}\n```" + - option: '0' + feedback: No you can repeat a line. + - option: '1' + feedback: Correct, one line at a time + - option: '3' + feedback: In this level only one line at a time + - option: infinite + feedback: In this level you can only repeat one line at a time + hint: You can only repeat one line at a time correct_answer: B - code: "{print} I will explode in 3 seconds!\n_\n{print} BOOM!" - question_text: What command should be used on line 2? question_score: '10' 2: + question_text: Which code is right? mp_choice_options: - - option: "```\nname {is} {ask} What is your name?\n```" - feedback: Super! - - feedback: The words are right, the order is not! - option: "```\n{ask} {is} name What is your name\n```" - - feedback: This worked in level 1, but in level 2 and up it works differently. - option: "```\n{ask} What is your name?\n```" - - feedback: The words are right, the order isn't! - option: "```\n{ask} What is your name? {is} name\n```" - question_text: Which code is correct? - hint: "`{ask}` doesn't work like in level 1" + - option: |- + ``` + {print} 100 {times} 'hello' + ``` + feedback: '`{repeat}` 100 `{times}` `{print}` ''hello''' + - option: |- + ``` + {print} {repeat} 100 {times} 'hello' + ``` + feedback: '{repeat} 100 {times} {print} ''hello''' + - option: |- + ``` + {repeat} 'hello' 100 {times} + ``` + feedback: '{repeat} 100 {times} {print} ''hello''' + - option: |- + ``` + {repeat} 100 {times} {print} 'hello' + ``` + feedback: That's right! + hint: First the `{repeat}` command, then the `{print}` command + correct_answer: D question_score: '10' - correct_answer: A - 9: + 3: + question_text: Is this code right or wrong? + code: '{repeat} 100 {times} ''Hello!''' mp_choice_options: - - feedback: The variable name is animal - option: 'Line 1 should say: dogs `{is}` animals' - - option: 'Line 1 should say: animal `{is}` dogs' - feedback: Great! - - option: 'Line 2 should say: `{print}` I love animals' - feedback: The variable name is animal - - option: 'Line 2 should say: `{sleep}` I love animals' - feedback: Sleep is not used to `{print}` text + - option: Right + feedback: No, a word is missing + - option: Wrong, the word `{repeat}` is missing + feedback: The word `{repeat}` is there, another word is missing + - option: Wrong, the word `{times}` is missing + feedback: The word `{times}` is there, another word is missing. + - option: Wrong, the word `{print}` is missing + feedback: Correct + hint: 'It should be: `{repeat}` 100 `{times}` `{print}` ''Hello''' + correct_answer: D question_score: '10' - question_text: What is going wrong in this code? - code: "dogs {is} animal\n{print} I love animal" - hint: You want to `{print}` 'I love dogs' - correct_answer: B - 6: - question_text: What should be on the lines? - code: "{print} And the award for best programming language goes to...\n_\n{print} Hedy!" - hint: Pause for dramatic effect... - mp_choice_options: - - feedback: Perfect! - option: '`{sleep}`' - - feedback: There is nothing to repeat back here - option: '`{echo}`' + 4: + question_text: Which word is wrong in the code? + code: |- + {print} 'I'm blue' + {repeat} 7 {times} {print} 'da ba dee, da ba da' + mp_choice_options: + - option: |- + ``` + I'm + ``` + feedback: That's right! - option: '`{print}`' - feedback: There is no text there to `{print}` there - - option: '`{ask}`' - feedback: There is no question there to be asked + feedback: '`{print}` is spelled correctly' + - option: '`{repeat}`' + feedback: '`{repeat}` is spelled correctly' + - option: '`{times}`' + feedback: '`{times}` is spelled correctly' + hint: I'm is wrong, you can't use apostrophes in a sentence correct_answer: A question_score: '10' - 14: - 1: + 5: + question_text: Is this code right or wrong? + code: '{repeat} 100 {times} {print} ''Hedy is awesome!''' mp_choice_options: - - feedback: This is not a symbol. - option: '`=>`' - - option: '`==`' - feedback: We are not comparing anything, just asking. - - option: '`!=`' - feedback: We are not comparing anything, just asking - - feedback: Right! - option: '`=`' - code: "name _ {ask} 'Who are you?'\n{if} name == 'Hedy'\n {print} 'Me too!'" - hint: We are not comparing anything, we are just asking a name. - question_text: Which symbol should be used on the blank? + - option: Correct + feedback: That's right! + - option: Wrong + feedback: That's not it + hint: The code is correct! + correct_answer: A question_score: '10' + 6: + question_text: What will be the output from this code? + code: |- + {print} 'The wheels on the bus go' + {repeat} 3 {times} {print} ' round and round' + mp_choice_options: + - option: |- + the wheels on the bus go + round and round + feedback: Only the second line is repeated 3 times + - option: |- + the wheels on the bus go + the wheels on the bus go + the wheels on the bus go + round and round + feedback: Only the second line is repeated 3 times + - option: |- + the wheels on the bus go + round and round + the wheels on the bus go + round and round + the wheels on the bus go + round and round + feedback: Only the second line is repeated 3 times + - option: |- + the wheels on the bus go + round and round + round and round + round and round + feedback: All through the town! Perfect! + hint: Only 'round and round' is repeated 3 times. correct_answer: D + question_score: '10' + 7: + question_text: What will be the output from this code? + code: |- + {repeat} 2 {times} {print} 'We will' + {print} 'ROCK YOU!' + mp_choice_options: + - option: |- + We will We will + ROCK YOU! + feedback: '''We will'' won''t appear twice in the same line' + - option: |- + We will + We will + ROCK YOU! + feedback: Great! + - option: |- + We will + ROCK YOU! + We will + ROCK YOU! + feedback: ROCK YOU! won't be repeated + - option: |- + We will + ROCK YOU! + feedback: Mind the `{repeat}` command + hint: Mind the `{repeat}` command. + correct_answer: B + question_score: '10' 8: - mp_choice_options: - - feedback: True! - option: You must be taller than 120 cm to go on the roller coaster - - feedback: If you are 120 cm you won't get in - option: You must be taller than 119 cm to go on the roller coaster - - feedback: '> means greater than' - option: You must be shorter than 120 cm to go on the roller coaster - - option: There are no length restrictions to go on the roller coaster - feedback: There are. + question_text: What Hedy code belongs to this output? + code: |- + Here comes the sun + Do do do do + Here comes the sun + And I say + Its alright + mp_choice_options: + - option: |- + ``` + {print} 'Here comes the sun' + {print} 'Do do do do' + {print} 'Here comes the sun' + {print} 'And I say' + {print} 'Its alright' + ``` + feedback: Awesome, you can't use the `{repeat}` command here. + - option: |- + ``` + {repeat} 2 {times} {print} 'Here comes the sun' + {print} 'And I say' + {print} 'Its alright' + ``` + feedback: Where did you leave 'Do do do do'? + - option: |- + ``` + {repeat} 2 {times} {print} 'Here comes the sun' + {print} 'Do do do do' + {print} 'And I say' + {print} 'Its alright' + ``` + feedback: This is not the correct order. + - option: |- + ``` + {repeat} 2 {times} {print} 'Here comes the sun' + {repeat} 2 {times} {print} 'Do do' + {print} 'And I say' + {print} 'Its alright' + ``` + feedback: This is not the correct order. + hint: '`{repeat}` can only be used if you want to execute the same line multiple times in a row.' correct_answer: A - question_text: Which statement is true about this roller coaster? - hint: '> means greater than' - code: "length = {ask} 'Please fill in your length in cm'\n{if} length < 120\n {print} 'Sorry, you cannot go on this roller coaster.'\n{else}\n {print} 'Enjoy the ride'" question_score: '10' - 7: - mp_choice_options: - - feedback: That's not quite right. - option: "`'Lower'` and `'Higher'` and `'You win!'`" - - option: "`'Higher'` and `'Lower'` and `'You win!'`" - feedback: You win! - - option: "`'You win!'` and `'Lower!'` and `'Higher'`" - feedback: That's not quite right. - - option: "`'Lower!'` and `'You win!'` and `'Higher!'`" - feedback: That's not quite right. - hint: The last one should say you win. + 9: + question_text: What Hedy code belongs to this output? + code: |- + Batman was flying through Gotham. + When suddenly he heard someone screaming... + Help! + Help! + Help! + Please help me! + mp_choice_options: + - option: |- + ``` + {print} 'Batman was flying through Gotham. ' + {print} 'When suddenly he heard someone screaming…' + {print} 'Help!' + {repeat} 3 {times} {print} 'Please help me!' + ``` + feedback: Your repeated line is incorrect. + - option: |- + ``` + {print} 'Batman was flying through Gotham.' + {print} 'When suddenly he heard someone screaming…' + {repeat} 3 {times} 'Help!' + {print} 'Please help me!' + ``` + feedback: The `{print}` command is missing on line 3. + - option: |- + ``` + {print} Batman was flying through Gotham. + {print} When suddenly he heard someone screaming… + {repeat} 3 {times} {print} Help! + {print} Please help me! + ``` + feedback: You're missing the quotation marks + - option: |- + ``` + {print} 'Batman was flying through Gotham.' + {print} 'When suddenly he heard someone screaming…' + {repeat} 3 {times} {print} 'Help!' + {print} 'Please help me!' + ``` + feedback: Perfect + hint: '''Help!'' is repeated 3 times.' + correct_answer: D + question_score: '10' + 10: + question_text: Which code belongs to this output? + code: |- + if youre happy and you know it clap your hands + if youre happy and you know it clap your hands + if youre happy and you know it and you really want to show it + if youre happy and you know it clap your hands + mp_choice_options: + - option: |- + ``` + {repeat} 2 {times} 'if youre happy and you know it clap your hands' + {print} 'if youre happy and you know it and you really want to show it' + {print} 'if youre happy and you know it clap your hands' + ``` + feedback: Almost! the first line needs an extra word + - option: |- + ``` + {repeat} 2 {times} {print} 'if youre happy and you know it clap your hands' + {print} 'if youre happy and you know it and you really want to show it' + {print} 'if youre happy and you know it clap your hands' + ``` + feedback: Great! + - option: |- + ``` + {repeat} 3 {times} {print} 'if youre happy and you know it clap your hands' + {print} 'if youre happy and you know it and you really want to show it' + ``` + feedback: This is not in the right order. + - option: |- + ``` + {repeat} 4 {times} 'if youre happy and you know it' + {repeat} 2 {times} 'clap your hands' + {print} 'and you really want to show it' + {print} 'clap your hands' + ``` + feedback: This is not in the right order. + hint: Mind the order of the sentences. correct_answer: B - question_text: What should be filled in on the three blanks? question_score: '10' - code: "{print} 'Guess which number'\nnumbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\nnumber = numbers {at} {random}\ngame = 'on'\n{for} i {in} {range} 1 {to} 10\n {if} game == 'on'\n guess = {ask} 'Which number do you think it is?'\n {if} guess < number\n {print} _\n {if} guess > number\n {print} _\n {if} guess == number\n {print} _\n game = 'over'" + 8: + 1: + question_text: Which output will be produced by this code? + code: |- + {repeat} 2 {times} + {print} 'Hello' + {print} 'Im Hedy!' + mp_choice_options: + - option: |- + Hello + Im Hedy! + feedback: Everything is printed twice. + - option: |- + Hello + Hello + Im Hedy + feedback: The second line is repeated twice as well. + - option: |- + Hello + Im Hedy! + Hello + Im Hedy! + feedback: Super! + - option: |- + Hello + Hello + Im Hedy! + Im Hedy! + feedback: Everything is printed twice + hint: Both lines are repeated twice. + correct_answer: C + question_score: '10' 2: + question_text: What is wrong with this code? + code: |- + {repeat} 5 {times} + {print} 'Hedy is cool!' mp_choice_options: - - feedback: No - option: '{if} name = Hedy' - - option: '{if} age = 24' - feedback: No - - option: answer = {ask} 'What is your answer' - feedback: Yes! - - feedback: No - option: answer == {ask} 'How are you doing?' + - option: This should be only one line, not 2. + feedback: No it should be 2 lines. + - option: This `{print}` command has to be removed. + feedback: No, you need it. + - option: There is a spelling mistake in the `{repeat}` command. + feedback: No, `{repeat}` is the correct spelling + - option: The second line needs to start with 4 spaces as indentation. + feedback: Correct! + hint: Something is missing in the second line? + correct_answer: D + question_score: '10' + 3: + question_text: What output will be produced when you run this program? + code: |- + {repeat} 3 {times} + {print} 'Baby shark tututudutudu' + {print} 'Baby shark' + mp_choice_options: + - option: |- + Baby shark tututudutudu + Baby shark + feedback: Mind the `{repeat}` command! + - option: |- + Baby shark tututudutudu + Baby shark + Baby shark tututudutudu + Baby shark + Baby shark tututudutudu + Baby shark + feedback: The last line has no indentation, so it's not repeated. + - option: |- + Baby shark tututudutudu + Baby shark tututudutudu + Baby shark tututudutudu + Baby shark + feedback: Right! + - option: |- + Baby shark tututudutudu + Baby shark + Baby shark + Baby shark + feedback: What is being repeated and what isn't. + hint: What is being repeated and what is not? correct_answer: C question_score: '10' - hint: When you are comparing two answers you should use == - question_text: Which of these codes has used the correct = or == symbol? 4: - hint: The symbols are right + question_text: Which output is correct? + code: |- + {print} 'The children went:' + {repeat} 2 {times} + {print} 'Yay!' + {print} 'We are going on vacation!' + mp_choice_options: + - option: |- + The children went: + Yay! + We are going on vacation! + feedback: Mind the `{repeat}` command! + - option: |- + The children went: + Yay! + We are going on vacation! + Yay! + We are going on vacation! + feedback: Correct! + - option: |- + The children went: + Yay! + Yay! + We are going on vacation! + We are going on vacation! + feedback: This order is incorrect. + - option: |- + The children went: + Yay! + Yay! + We are going on vacation! + feedback: The last line is repeated too. + hint: The block under the `{repeat}` command is repeated twice. + correct_answer: B + question_score: '10' + 5: + question_text: What is wrong with this code? + code: |- + end = {ask} 'Do you want a happy or a sad ending?' + {if} end {is} happy {print} 'They lived happily ever after' + {else} {print} 'The world exploded. The end.' mp_choice_options: - - option: In line 1 == should be used instead of = - feedback: No that's not it - - option: Line 2 misses quotation marks - feedback: You are correct - - feedback: No that's not it - option: In line 4 = should have been used instead of == - - option: In line 4 <= should have been used instead of >= - feedback: No that's not it - code: "price = 10\nmoney = {ask} How much money do you have?\nbuy = {ask} 'Would you like to buy this teddy bear?'\n{if} money >= price {and} buy == 'yes'\n {print} 'You can buy the bear!'\n{else}\n {print} 'You cannot buy this bear!'" - question_text: What's wrong with this code? - correct_answer: B - question_score: '10' - 5: - mp_choice_options: - - feedback: 12 year olds are allowed too - option: '`> 12`' - - feedback: Great! - option: '`>= 12`' - - option: '`< 12`' - feedback: These kids are too young! - - feedback: These kids are too young - option: '`<= 12`' - hint: '> means greater than' - code: "age = {ask} 'How old are you?'\nticket = {ask} 'Do you have a ticket?'\n{if} age _ {and} ticket == 'yes'\n {print} 'You can enter the movie theater.'\n{else}\n {print} 'You are not allowed to come in!'" + - option: The `{print}` commands on the last two lines should start on new lines and start with 4 spaces. + feedback: That's right! + - option: '`{else}` is not a command!' + feedback: It is! + - option: Lines that start with `{if}` should start with 4 spaces + feedback: That's not true + - option: '`{ask}` is no longer a command' + feedback: That's not true + hint: Something is wrong with indentation + correct_answer: A question_score: '10' - question_text: Which symbol should be filled in on the blanks if the movie is suitable for kids for the age of 12 and up? - correct_answer: B 6: - question_score: '10' - mp_choice_options: - - feedback: It stops after 2 times - option: 10 times - - option: 0 times - feedback: It stops after 2 times - - option: 1 time - feedback: It stops after 2 times - - feedback: That is correct - option: 2 times + question_text: What will be the output of this code when we enter pancakes? + code: |- + {print} 'Welcome to restaurant Hedy' + {repeat} 2 {times} + food {is} {ask} 'What do you want to eat?' + {print} food + mp_choice_options: + - option: |- + Welcome to restaurant Hedy + Pancakes + feedback: There is no repetition in this answer. + - option: |- + Welcome to restaurant Hedy + Welcome to restaurant Hedy + Pancakes + Pancakes + feedback: This answer also repeats the welcome message + - option: |- + Welcome to restaurant Hedy + What do you want to eat? + What do you want to eat? + Pancakes + Pancakes + feedback: Almost! But look at the question, it is not repeated. + - option: |- + Welcome to restaurant Hedy + Pancakes + Pancakes + feedback: Well done! + hint: The first sentence and question will not be repeated correct_answer: D - question_text: How many times do you have to say you are annoyed before this annoying game stops? - code: "lives = 2\n{repeat} 10 {times}\n {if} lives != 0\n answer = {ask} 'Are you annoyed yet?'\n {if} answer == 'yes'\n lives = lives - 1" - hint: "!= means 'is not'" - 10: - correct_answer: B - mp_choice_options: - - feedback: Look at who has the highest score! - option: "'player 1 wins'" - - option: "'player 2 wins'" - feedback: Yes! - - option: "'player 2 loses'" - feedback: Look at who has the highest score! - - feedback: No it's not, one player has a higher score - option: "'It is a tie'" - hint: You win the game by having the most points - code: "{print} 'Whoever gets the most points wins!'\n{if} points_player_1 < points_player_2\n {print} _" - question_text: What should be filled in in the blanks? question_score: '10' - 9: + 7: + question_text: What is wrong with this code? + code: |- + food = {ask} 'What would you like to eat?' + {if} food {is} fries + sauce = {ask} 'What sauce would you like?' + {print} 'One fries with ' sauce + {if} food {is} pizza + topping = {ask} 'What topping would you like?' + {print} 'One pizza with ' topping + {print} 'Thank you for your order' mp_choice_options: - - option: 1 or more - feedback: No - - option: 2 or more - feedback: No - - option: 8 or more - feedback: Almost - - feedback: Great! - option: 9 or more - code: "chocolate = {ask} 'How many pieces of chocolate have you eaten?'\n {if} chocolate <= 2\n {print} 'That is a healthy amount'\n {if} chocolate > 2 {and} chocolate =< 8\n {print} 'That is a bit much'\n {if} chocolate > 8\n {print} 'You will get a stomach ache!'" - hint: '> 8 means more than 8' - question_text: How many pieces of chocolate will give you a stomach ache according to this fitbit? - question_score: '10' + - option: Nothing. This code is correct! + feedback: Something is wrong! + - option: You're not allowed to use an `{if}` command after an `{ask}` command. + feedback: You are! + - option: You don't have to use indentation twice. Only in the first `{if}` command. + feedback: You always have to use indentation. + - option: The indentation is wrong in the first `{if}` command. + feedback: That's right. + hint: Take a careful look at the indentation. correct_answer: D - 3: question_score: '10' + 8: + question_text: In which of the codes is the indentation done right? mp_choice_options: - - option: '`>` and `<`' - feedback: That's not it - - option: '`=` and `>=`' - feedback: That's not it - - option: '`<` and `>=`' - feedback: You are right - - option: '`+` and `==`' - feedback: That's not it + - option: |- + ``` + {if} answer {is} 32 + {print} 'You are...' + {sleep} + {print} 'right!' + {else} + {print} 'You are wrong!' + ``` + feedback: You are wrong! + - option: |- + ``` + {if} answer {is} 32 + {print} 'You are...' + {sleep} + {print} 'right!' + {else} + {print} 'You are wrong!' + ``` + feedback: You are wrong! + - option: |- + ``` + {if} answer {is} 32 + {print} 'You are...' + {sleep} + {print} 'right!' + {else} + {print} 'You are wrong!' + ``` + feedback: You are... right! + - option: |- + ``` + {if} answer {is} 32 + {print} 'You are...' + {sleep} + {print} 'right!' + {else} + {print} 'You are wrong!' + ``` + feedback: You are wrong! + hint: What should happen if the person is right? And what else? correct_answer: C - code: "guests = {ask} 'How many people are at the party?'\n{if} guests _ 130\n {print} 'You can come in!'\n{if} guests _ 130\n {print} 'Im sorry, the club is full. '\n {print} 'You have to wait for a guest to leave'" - hint: There are 130 people allowed in the club - question_text: Which symbols should be filled in on the two blanks? - 16: - 7: - mp_choice_options: - - feedback: That is not right. - option: Line 1 needs less quotation marks - - feedback: It should not! - option: Line 3 should start with indentation - - feedback: It should not - option: Line 4 should start without indentation - - feedback: Amazing! - option: Line 4 needs more quotation marks. - question_text: What's wrong with this code? + question_score: '10' + 9: + question_text: What line(s) in this code should start with 4 spaces? + code: |- + 1 music = {ask} 'What is your favorite music genre?' + 2 {if} music {is} rock + 3 {print} '🤘' + 4 {else} + 5 {print} '👎' + mp_choice_options: + - option: Line 2 and 4 + feedback: The lines after the `{if}` and `{else}` command should start with 4 spaces + - option: Only line 3 + feedback: Not only 3... + - option: Line 3, 4 and 5 + feedback: Line 4 shouldn't + - option: Line 3 and 5 + feedback: Great job! + hint: The lines after an `{if}` or `{else}` command should start with 4 spaces. correct_answer: D - code: "people = ['Savi', 'Senna', 'Fayenne']\ntransportation = ['bike', 'train', 'car']\n{for} i {in} {range} 1 {to} 3\n {print} people[i] goes to school by transportation[i]" - hint: There is a mistake made in the usage of quotation marks. question_score: '10' 10: + question_text: Which statement is true? + code: |- + 1 level = {ask} 'What level are you on?' + 2 {if} level {is} 8 + 3 {print} 'Great job!' mp_choice_options: - - feedback: Almost there... but adding the winner to the list makes this raffle unfair - option: "```\nchosen_number = list_of_numbers at random\nprint books[i] ' will go to person number ' chosen_number\n{add} chosen_number {to} list_of_numbers\n```" - - option: "```\nprint person[i] ' wins ' book[i]\n```" - feedback: There is no list called 'person' - - feedback: This is not it. - option: "```\nchosen_number = list_of_numbers[people]\nprint books[people] ' will go to person number ' chosen_number\n{remove} chosen_number {from} list_of_numbers\n```" - - option: "```\nchosen_number = list_of_numbers[random]\nprint books[i] ' will go to person number ' chosen_number\n{remove} chosen_number {from} list_of_numbers\n```" - feedback: Fantastic! - hint: You need to use the {remove} command + - option: All lines should start with 4 spaces + feedback: That's not true + - option: Line 2 and 3 should start with 4 spaces + feedback: That's not true + - option: Line 2 should start with 4 spaces + feedback: That's not true + - option: Line 3 should start with 4 spaces + feedback: You are correct! + hint: Only one line starts with 4 spaces, but which one...? correct_answer: D - code: "{print} 'The book raffle will start soon'\n{print} 'Get your tickets now!'\n{books} = ['Narnia', 'The Hobbit', 'Oliver Twist', 'Harry Potter', 'Green eggs and ham']\npeople = {ask} 'How many raffle tickets are sold?'\nlist_of_raffle_numbers = [1, 2]\n{for} i {in} {range} 3 {to} people\n {add} i {to} list_of_raffle_numbers\n{for} i {in} {range} 1 {to} 5" - question_text: Which 3 lines will complete this code correctly? - question_score: '10' - 9: - code: "countries = ['Canada', 'Zimbabwe', 'New Zealand']\n{for} i {in} {range} 0 {to} 1\n {print} 'I will travel to ' countries[random]" - mp_choice_options: - - option: "```\nI will travel to Canada\nI will travel to Canada\n```" - feedback: Great job! - - feedback: It will be repeated twice - option: "```\nI will travel to Canada\n```" - - feedback: This is not it. - option: "```\nI will travel to Canada, Zimbabwe and New Zealand\n```" - - feedback: It's only repeated twice - option: "```\nI will travel to Canada\nI will travel to Zimbabwe\nI will travel to New Zealand\n```" - hint: Range 0 to 1 is 2 times question_score: '10' - question_text: What is a possible output for this code? + 9: + 1: + question_text: What is wrong with this code? + code: |- + {repeat} 3 {times} + food = {ask} 'What would you like to eat?' + {if} food {is} fries + sauce = {ask} 'What sauce would you like?' + {print} 'One fries with ' sauce + {if} food {is} pizza + topping = {ask} 'What topping would you like?' + {print} 'One pizza with ' topping + {print} 'Thank you for your order' + mp_choice_options: + - option: Nothing, this code is correct! + feedback: That's right! + - option: You're not allowed to use an `{if}` command after an `{ask}` command. + feedback: You are! + - option: You don't have to use indentation twice. + feedback: You always have to use indentation. + - option: The indentation is wrong in the last `{if}` command. + feedback: It is not the indentation. + hint: All the indentation is done correctly. correct_answer: A + question_score: '10' 2: - mp_choice_options: - - feedback: Mind the spacing. - option: "```\nfriends[i] has to do chores [i]\n```" - - option: "```\nfriends[1] has to do chores[1]\n```" - feedback: It will print 3 times that Wesley has to do the cooking - - feedback: The person has to do the chore, not the other way around - option: "```\nchores[i] ' has to do ' friends[random]\n```" - - option: "```\nfriends[i] ' has to do ' chores[i]\n```" - feedback: Fantastic! - code: "friends = ['Wesley', 'Eric', 'Kaylee']\nchores = [the cooking, the cleaning, nothing]\n{for} i {in} {range} 1 {to} 3\n {print} _" - question_text: What should be filled in on the blanks if you want a list of what chores are done by whom? - hint: '`i` tells us what item in the list it is. So friend 1 does chore 1 etc.' + question_text: What will be printed after entering the correct password? + code: |- + password = {ask} 'What is the password?' + correct_password = Hedy + {if} password {is} correct_password + {repeat} 2 {times} + {print} 'Good job!' + {print} 'You can use the computer!' + {else} + {print} 'The computer will explode in 5... 4... 3... 2... 1...' + mp_choice_options: + - option: |- + ``` + Good job! + Good job! + ``` + feedback: That's not it! + - option: |- + ``` + The computer will explode in 5... 4... 3... 2... 1... + ``` + feedback: That's not it! + - option: |- + ``` + Good job! + Good job! + You can use the computer! + ``` + feedback: That's not it! + - option: |- + ``` + Good job! + You can use the computer! + Good job! + You can use the computer! + ``` + feedback: Correct! + hint: Everything under the `{repeat}` command is repeated twice. correct_answer: D question_score: '10' - 8: - mp_choice_options: - - option: "```\nteams = ['Macy and Kate', 'Lionell and Raj', 'Kim and Leroy']\nposition = ['first', 'second', 'third']\n{for} i {in} {range} 0 {to} 3\n{print} teams[random] ' get to go ' position[i]\n```" - feedback: This is not right - - option: "```\nteams = ['Macy and Kate', 'Lionell and Raj', 'Kim and Leroy']\nposition = ['first', 'second', 'third']\n{for} i {in} {range} 1 {to} 3\n {print} teams[i] ' get to go ' position[i]\n```" - feedback: Amazing! - - feedback: This is not it. - option: "```\nteams = ['Macy', 'Kate', 'Lionell', 'Raj', 'Kim', 'Leroy']\nposition = ['first', 'second', 'third']\n{for} i {in} {range} 1 {to} 6\n {print} teams[random] ' get to go ' position[random]\n```" - - option: "```\nteams = ['Macy and Kate' 'Lionell and Raj' 'Kim and Leroy']\nposition = ['first' 'second' 'third']\n{for} teams {in} {range} 0 {to} 3\n {print} teams[i] ' get to go ' position[i]\n```" - feedback: This is not going to work! - correct_answer: B - code: "Macy and Kate get to go first\nLionell and Raj get to go second\nKim and Leroy get to go third" - hint: If you look carefully at the first line, you'll see that only the first two answers are possibly correct. - question_score: '10' - question_text: Which of these codes belongs to this output? 3: - code: "friends = ['Wesley', 'Eric', 'Kaylee']\nchore = [the cooking, the cleaning, nothing]\n{for} i {in} {range} 1 {to} 3\n {print} friends[i] has to do chores[i]" - mp_choice_options: - - feedback: Super! - option: "```\nWesley has to do the cooking\nEric has to do the cleaning\nKaylee has to do nothing\n```" - - option: "```\nKaylee has to do the cooking\nWesley has to do the cleaning\nEric has to do nothing\n```" - feedback: No, it is not random. - - feedback: Poor Wesley! - option: "```\nWesley has to do the cooking\nWesley has to do the cleaning\nWesley has to do the nothing\n```" - - feedback: That's not it - option: "```\nWesley has to do the cooking\nWesley has to do the cooking\nWesley has to do the cooking\n```" - hint: It's not random... - correct_answer: A - question_score: '10' - question_text: What is a possible output for this program? - 5: - mp_choice_options: - - option: noises = ['moo', 'woof', 'neigh'] - feedback: Mind the variable name and the order of the sounds. - - feedback: Look at line one to see how brackets are supposed to be used. - option: sounds = '[woof], [moo], [neigh]'. - - feedback: Don't forget the quotation marks! - option: sounds = [woof, moo, neigh] - - feedback: Great job! - option: sounds = ['woof', 'moo', 'neigh'] - hint: Look at line 1 to see proper use of brackets and quotation marks. - question_score: '10' - question_text: Which line should be filled in in the blank? + question_text: Which case should you choose to win a million dollars? + code: |- + {print} 'Choose the right case and win!' + case = {ask} 'Which case will you pick? 1 or 2?' + {if} case {is} 1 + action = {ask} 'Open it or sell it?' + {if} action {is} sell + {print} 'You sell your case for 10 dollars' + {if} action {is} open + {print} 'You open the case and win an apple pie' + {if} case {is} 2 + action = {ask} 'Open it or sell it?' + {if} action {is} sell + {print} 'You sell the case for 500 dollars' + {if} action {is} open + {print} 'You open the case and win a million dollars!' + mp_choice_options: + - option: case 1, sell + feedback: You don't win a million! + - option: case 1, open + feedback: You don't win a million + - option: case 2, sell + feedback: You don't win a million + - option: case 2, open + feedback: Great job! You win! + hint: Follow the right path correct_answer: D - code: "animals = ['dog', 'cow', 'horse']\n_\n{for} i {in} {range} 1 {to} 3\n {print} 'the ' animals[i] ' says ' sounds[i]" - 6: - mp_choice_options: - - option: You are not allowed to use the variable o. It should be named i. - feedback: i is the most commonly used variable name in this case, but it's not mandatory to use i. - - feedback: No, he likes minecraft. - option: The output will say that Jaylino likes fortnite. - - feedback: Correct - option: The output will say that Ryan likes fifa - - option: This code will not work. It will give and error. - feedback: No, the code is correct. question_score: '10' - correct_answer: C - code: "people = ['Chris', 'Jaylino', 'Ryan']\ngames = ['fortnite', 'minecraft', 'fifa']\n{for} o {in} {range} 1 {to} 3\n {print} people[o] ' likes ' games[o]" - hint: There is nothing wrong with this code. - question_text: Which statement is true? 4: + question_text: Which statement is true? + code: |- + name = {ask} 'What is your name?' + size = {ask} 'What is your shoe size?' + {if} size {is} 38 + {if} name {is} Cinderella + {print} '❤️❤️❤️' + {else} + {print} 'You are not the one!' + {else} + {print} 'Ill keep looking' mp_choice_options: - - option: The variable in line 4 should be 'friend[i]', not 'friends[i]' - feedback: That is not right. - - option: Line 3 should say 'in range 1 to 3' not 'in range 0 to 3' - feedback: Good catch! - - feedback: It's not a variable, it's just text. - option: Line 4 should say 'lucky_number', not 'lucky number - - feedback: That's not it - option: '{in} in line 3 should be removed' - correct_answer: B - hint: There's nothing wrong with line 4 - code: "friends = ['Jaylee', 'Erin', 'Fay']\nlucky_numbers = [15, 18, 6]\n{for} i {in} {range} 0 {to} 3\n print 'the lucky number of ' friends[i]\n print 'is ' lucky_numbers[i]" - question_score: '10' - question_text: What is wrong with this code? - 1: - mp_choice_options: - - feedback: This is the old way. - option: '`snacks {at} {random}`' - - option: '`[{random} snack]`' - feedback: The order is wrong. - - option: '`snacks[{random}]`' - feedback: Correct - - option: '`snacks[{at} {random}]`' - feedback: We do not need `at`anymore - code: "snacks = nachos, chips, cucumber, sweets\n{print} _" - question_score: '10' - correct_answer: C - hint: We no longer use {at} - question_text: Which command should be filled in on the blanks to print a random snack? - 13: - 1: - mp_choice_options: - - option: "```\n{if} birthday {and} song = 'yes'\n```" - feedback: Almost there - - feedback: Hedy only sings for you if you like to hear a song - option: "```\n{if} birthday = 'yes' {and} name = 'Hedy'\n```" - - option: "```\n{if} song = 'yes' {and} birthday = 'yes'\n```" - feedback: Super! - - feedback: Hedy only sings if both answers are yes - option: "```\n{if} song = 'yes' {or} birthday = 'yes'\n```" + - option: Sleeping Beauty with shoe size 38 gets the output 'Ill keep looking' + feedback: No, she gets 'You are not the one!' + - option: Cinderella with shoe size 40 gets the output '❤️❤️❤️' + feedback: No, she gets 'Ill keep looking' + - option: Sleeping Beauty with shoe size 40 gets the output 'Ill keep looking' + feedback: That's right! + - option: Cinderella with shoe size 38 gets the output 'Ill keep looking' + feedback: No she gets '❤️❤️❤️' + hint: No matter what your name is, if you have shoe size 40 you will get the message 'Ill keep looking'. correct_answer: C - question_text: Which code should be filled in at the ??? ? - code: "name = {ask} 'What is your name?'\nsong = {ask} 'Whould you like to hear a song?'\nbirthday = {ask} 'Is today your birthday?'\n???\n {print} 'Happy Birthday to you!'\n {print} 'Happy Birthday to you!'\n {print} 'Happy Birthday dear ' name\n {print} 'Happy Birthday to you!'" question_score: '10' - hint: Hedy sings if you want to hear a song and it's you birthday 5: - mp_choice_options: - - feedback: The prince is a little more picky than that! - option: Every person with shoe size 38 is this prince's one true love - - option: Every person named Cinderella is this prince's one true love - feedback: The prince is a little more picky than that! - - feedback: Fantastic! - option: Every person that is named Cinderella and has shoe size 38 is this prince's one true love - - feedback: The prince is a little more picky than that! - option: Every person that's not named Cinderella and does not have shoe size 38 is this prince's one true love - question_text: Which statement is true about this code? - code: "{if} name = 'Cinderella' {and} shoe_size = 38\n {print} 'You are my one true love!'" - hint: Both statements have to be true + question_text: Which code produced this output? + output: |- + Icecream is the best! + Icecream is the best! + Icecream is the best! + mp_choice_options: + - option: |- + ``` + dessert = {ask} 'What is your favorite type of dessert?' + {if} dessert {is} icecream + {repeat} 3 {times} + {print} 'Icecream is the best!' + ``` + feedback: Don't forget the indentation after `{repeat}` commands. + - option: |- + ``` + dessert = {ask} 'What is your favorite type of dessert?' + {if} dessert {is} icecream + {repeat} 3 {times} + {print} 'Icecream is the best!' + ``` + feedback: Use indentation after an `{if}` command + - option: |- + ``` + dessert = {ask} 'What is your favorite type of dessert?' + {if} dessert {is} icecream + {repeat} 3 {times} + {print} 'Icecream is the best!' + ``` + feedback: Perfect + - option: |- + ``` + {repeat} 3 {times} + dessert = {ask} 'What is your favorite type of dessert?' + {if} dessert {is} icecream + {repeat} 3 {times} + {print} 'Icecream is the best!' + ``` + feedback: There are 2 `{repeat}` commands in this code. + hint: Watch the indentation correct_answer: C question_score: '10' - 7: + 6: + question_text: After which command(s) should you use indentation (starting the next line with 4 spaces)? mp_choice_options: - - option: The grey cat is called Abby - feedback: This is true! - - option: Milo the orange cat eats 4 scoops of cat nibbles - feedback: This is true - - feedback: Great job! - option: The black hamster needs to be fed a piece of carrot - - option: The yellow bird was fed this morning - feedback: This is true - question_text: Which statement is false? - hint: Read the last 4 lines carefully - question_score: '10' + - option: '`{if}`' + feedback: Don't forget the others + - option: '`{if}` `{repeat}`' + feedback: Don't forget `{else}`! + - option: '`{if}` `{else}` `{repeat}`' + feedback: Keep it up! + - option: '`{if}` `{else}` `{repeat}` `{print}`' + feedback: Not with {print} + hint: Indentation happens on the line below some commands correct_answer: C - code: "{print} 'Thank you for helping me take care of my pets'\n{print} 'Here is a program to help feed them'\nanimal = {ask} 'What kind of animal are they?'\ncolor = {ask} 'What colour are they?'\n{if} animal = 'cat' {and} color = 'grey'\n {print} 'That is Abby. She eats 3 scoops of cat nibbles'\n{if} animal = 'cat' {and} color = 'orange'\n {print} 'That is Milo. He eats 4 scoops of cat nibbles'\n{if} animal = 'bird' {or} color = 'black'\n {print} 'I fed them this moring! They do not need more food today'\n{if} animal = 'hamster' {and} color = 'brown'\n {print} 'You can feed them a piece of carrot'" - 3: - question_text: Which output is given to a member without a discount code? - mp_choice_options: - - option: You get a free apple pie! - feedback: Great job! - - option: That will be 5 dollars please - feedback: That is not true - - option: This code won't work, so there is no output - feedback: There is nothing wrong with the code - - feedback: There is! Read the question carefully - option: There is no way of knowing - code: "member = {ask} 'Do you have a membership card?'\ndiscount = {ask} 'Do you have a discount code?'\n{if} member = 'yes' {or} discount = 'yes'\n {print} 'You get a free apple pie!'\n{else}\n {print} 'That will be 5 dollars please'" - hint: Mind the command `{or}` in line 3 - correct_answer: A question_score: '10' - 4: - mp_choice_options: - - option: "```\n{print} 'you win'\n```" - feedback: You win! - - feedback: You lose! - option: "```\n{print} 'you lose'\n```" - - option: "```\n{print} 'tie'\n```" - feedback: It's only a tie if both choices are the same - - option: "```\n{print} 'try again'\n```" - feedback: Try again! - code: "{if} computer_choice {is} 'rock' {and} your_choice {is} 'paper'" - question_text: Which line of code should follow this line in rock-paper-scissors game? + 7: + question_text: You'll get a 5 dollar discount if you order a medium pizza with coke.
But the code has a mistake! How to debug it? + code: |- + {if} food {is} pizza + {if} size {is} medium + {if} drink {is} coke + price = price - 5 + mp_choice_options: + - option: |- + ``` + {if} food {is} pizza + {if} size {is} medium + {if} drink {is} coke + price = price - 5 + ``` + feedback: Amazing! + - option: |- + ``` + {if} food {is} pizza + {if} size {is} medium + {if} drink {is} coke + price = price - 5 + ``` + feedback: The second `{if}` misses code! + - option: |- + ``` + {if} food {is} pizza + {if} size {is} medium + {if} drink {is} coke + price = price - 5 + ``` + feedback: Two consecutive `{if}`s is never correct. + - option: |- + ``` + {if} food {is} pizza + {if} size {is} medium + {if} drink {is} coke + price = price - 5 + ``` + feedback: Almost right. Take another look at the last line + hint: After each `{if}` command, the line below should indent correct_answer: A question_score: '10' - hint: Paper beats rock - 9: - mp_choice_options: - - option: "Line 3 should be:\n```\n{if} chocolate = 'yes' {and} sprinkles = 'yes'\n```" - feedback: Correct! - - option: "Line 3 should be: \n```\n{if} chocolate = 'no' {and} sprinkles = 'no'\n```" - feedback: This is not what I ordered! - - option: "Line 5 should be: \n```\n{if} chocolate = 'yes' {and} sprinkles = 'yes'\n```" - feedback: This is not what I ordered! - - option: "Line 7 should be:\n```\n{if} chocolate = 'yes' {and} sprinkles = 'no'\n```" - feedback: This is not what I ordered! - question_score: '10' - question_text: What is wrong with this code? - code: "1 chocolate = {ask} 'Would you like chocolate sauce on your ice cream?'\n2 sprinkles = {ask} 'Would you like sprinkles on your ice cream?'\n3 {if} chocolate {and} sprinkles = 'yes'\n4 {print} 'Ice cream with chocolate sauce and sprinkles, coming up!'\n5 {if} chocolate = 'yes' {and} sprinkles = 'no'\n6 {print} 'Ice cream with chocolate sauce, coming up!'\n7 {if} chocolate = 'no' {and} sprinkles = 'yes'\n8 {print} 'Ice cream with sprinkles, coming up'\n9 {if} chocolate = 'no' {and} sprinkles = 'no'\n10 {print} 'Just plain icecream, coming up!'" - correct_answer: A - hint: There is a mistake in line 3 - 2: - mp_choice_options: - - option: '`{and}`' - feedback: You don't have to be vegan and muslim - - feedback: Great thinking! - option: '`{or}`' - - feedback: No - option: '`+`' - - feedback: No - option: '`{print}`' - hint: Neither vegans nor muslims can eat sausage rolls. + 8: + question_text: What is wrong in this code? + code: |- + age = {ask} 'Happy Birthday! How old are you?' + singing = {ask} 'Would you like us to sing?' + {if} singing {is} yes + {repeat} years {times} + {print} 'Hip Hip Hooray' + mp_choice_options: + - option: You can't put two questions in a row + feedback: Yes you can. + - option: The variable called 'age' is later on used as 'years' + feedback: Keen eye! Good job! + - option: You're not allowed to start with 8 spaces, like line 5 does + feedback: You actually must start like that. + - option: A code must always start with a `{print}` command in the first line + feedback: That's not true. + hint: The indentation is done right this time correct_answer: B - code: "menu = 'cheese', 'sausage rolls', 'cookies'\ndiet = {ask} 'Do you have any dietary restrictions?'\n{if} diet = 'vegan' ??? diet = 'halal'\n {remove} 'sausage rolls' {from} menu" - question_text: Which command is missing in the code at the place of the ??? ? question_score: '10' - 8: - code: "{print} 'Welcome to the movie theater'\npopcorn = {ask} 'Would you like some popcorn?'\ndrink = {ask} 'Would you like a drink?'\n{if} popcorn = 'yes' {and} drink = 'yes'\n {print} 'That will be 8 dollars please'\n{if} popcorn = 'no' {and} drink = 'yes'\n {print} 'That will be 3 dollars please'\n{if} popcorn = 'yes' {and} drink = 'no'\n {print} 'That will be 5 dollars please'\n{if} popcorn = 'no' {and} drink = 'no'\n {print} 'Ok'\n{print} 'Enjoy the movie'" + 9: + question_text: How many `{if}` commands can be placed inside another `{if}` command? mp_choice_options: - - feedback: You have paid too much! - option: "Welcome to the movie theater\nThat will be 8 dollars please\nEnjoy the movie" - - option: "Welcome to the movie theater\nThat will be 5 dollars please\nEnjoy the movie" - feedback: Amazing! - - feedback: That's not enough money! - option: "Welcome to the movie theater\nThat will be 3 dollars please\nEnjoy the movie" - - option: "Welcome to the movie theater\nOk\nEnjoy the movie" - feedback: You have to pay for your popcorn! - question_text: What output do you get if you order popcorn but no drink? - hint: popcorn = yes and drink = no - correct_answer: B + - option: None, that is not allowed + feedback: You are allowed to + - option: Only 1 + feedback: You could use more if you like + - option: '3' + feedback: You could use more if you like + - option: Infinite, as long as you keep using indentation correctly + feedback: That is true + hint: You can put an `{if}` command inside an `{if}` command. + correct_answer: D question_score: '10' 10: - question_text: Which command needs to be in line 8 at the place of the ??? ? + question_text: Which statement is true? + code: |- + 1 {repeat} 2 {times} + 2 {if} level {is} 9 + 3 {print} Great job! mp_choice_options: - - feedback: There are no items that are both the list of snacks and the list of drinks - option: '`{and}`' - - feedback: Great job! - option: '`{or}`' - - option: '`{in}`' - feedback: No - - feedback: No - option: '`{if}`' + - option: All lines should start with 4 spaces + feedback: Only line 2 and 3 start with spaces + - option: Line 2 and 3 should start with 4 spaces + feedback: Line 3 should start with 8 + - option: Line 2 and 3 should start with 8 spaces + feedback: Line 2 should start with 4 + - option: line 2 should start with 4 spaces and line 3 with 8 + feedback: You are correct! + hint: The first line doesn't start with any spaces + correct_answer: D question_score: '10' - code: "{print} 'Welcome to the product finder of this supermarkt'\nitem = {ask} 'What product are you looking for?'\nbakery = 'bread', 'buns', 'muffins'\ndrinks = 'soda', 'water', 'lemonade'\nsnacks = 'chips', 'nuts', 'dips'\nfrozen = 'fries', 'icecream', 'pizza'\nfruit = 'bananas', 'apples', 'oranges'\n{if} item {in} snacks ??? item {in} drinks\n {print} 'This item is in aisle 3'\n{if} item {in} bakery {or} item {in} bakery\n {print} 'This item in in the back of the store'\n{if} item {in} fruit\n {print} 'The fruit is sold near the register'" + 10: + 1: + question_text: What do we need to fill in on the `_` if we want to print each compliment? + code: |- + compliments = perfect, great job, amazing + _ + {print} compliment + mp_choice_options: + - option: |- + ``` + {for} each compliment + ``` + feedback: That's not it + - option: |- + ``` + {for} compliment {in} compliments + ``` + feedback: You deserve all those compliments! + - option: |- + ``` + {if} compliment {in} compliments + ``` + feedback: That's not it + - option: |- + ``` + {for} compliments {in} compliment + ``` + feedback: Almost there! + hint: '`{for}` each compliment in the lists of compliments...' correct_answer: B - hint: The item is either in the list of snacks, or in the list of drinks - 6: + question_score: '10' + 2: + question_text: Which output is correct? + code: |- + meals = pizza, pasta, pancakes + {for} meal {in} meals + {print} 'I love ' meal mp_choice_options: - - option: Michael is a boy with glasses - feedback: Try again - - feedback: Try again - option: Marleen is a girl with glasses - - feedback: Try again - option: Wouter is a boy without glasses - - option: Sophie is a girl with glasses - feedback: Great job! - code: "{print} 'Let me guess which family member you are!'\nglasses = {ask} 'Do you wear glasses?'\nfemale = {ask} 'Are you female?'\n{if} glasses = 'yes' {and} female = 'yes'\n {print} 'You must be Sophie!'\n{if} glasses = 'no' {and} female = 'yes'\n {print} 'You must be Marleen!'\n{if} glasses = 'yes' {and} female = 'no'\n {print} 'You must be Wouter!'\n{if} glasses = 'no' {and} female = 'no'\n {print} 'You must be Michael!'" - question_text: Which statement about this code is true? - hint: Take a good look! Or do you need glasses? + - option: I love pizza + feedback: Line 2 says `{for}` each meal in the list of meals. So each meal is printed. + - option: I love pasta + feedback: Line 2 says `{for}` each meal in the list of meals. So each meal is printed. + - option: I love pancakes + feedback: Line 2 says `{for}` each meal in the list of meals. So each meal is printed. + - option: |- + I love pizza + I love pasta + I love pancakes + feedback: Great! + hint: Line 2 says for each meal in the list of meals. So each meal is printed. correct_answer: D question_score: '10' - 3: - 10: + 3: + question_text: Which output is correct? + code: |- + animals = dogs, cats, hamsters, chickens + {for} animal {in} animals + {print} animal ' are lovely pets' mp_choice_options: - - option: "```\n{remove} walked_yesterday {from} walkers\n```" - feedback: Super! - - feedback: '`{remove} {from}` or `{add} {to}`, not `{remove} {to}`' - option: "```\n{remove} walked_yesterday {to} walkers\n```" - - option: "```\n{remove} walkers {from} yesterday\n```" - feedback: yesterday is not a variable - - feedback: This increased the chance that the person who walked yesterday now has to do it again. That's mean. - option: "```\n{add} walked_yesterday {to} walkers\n```" - question_text: What should be on the _? - hint: The person who walked the dogs yesterday should be removed from the list. - code: "walkers {is} dad, mom, Sam, Petra\nwalked_yesterday {is} {ask} Who walked the dogs yesterday?\n{print} walked_yesterday shouldn't have to walk the dogs again today\n_\n{print} walkers {at} {random} , it's your turn to walk the dogs!" - question_score: '10' - correct_answer: A - 2: + - option: dogs are lovely pets + feedback: Line 2 says {for} each animal in the list of animals. So each animal is {print}ed. + - option: dogs, cats, hamsters, chickens are lovely pets + feedback: Each animal gets their own line in the output. + - option: |- + dogs are lovely pets + cats are lovely pets + hamsters are lovely pets + chickens are lovely pets + feedback: Great! + - option: You don't know yet. Because it chooses one of the animals {at} {random}. + feedback: Line 2 says {for} each animal in the list of animals. So each animal is {print}ed. + hint: Line 2 says {for} each animal in the list of animals. So each animal is printed + correct_answer: C question_score: '10' - mp_choice_options: - - feedback: Good job! - option: 'You need commas in line 1: dog, cat, cow.' - - feedback: No, you don't need `{print}` - option: Line 1 needs to start with `{print}`. - - feedback: animals is correct. - option: Line 2 needs to say 'animal' instead of 'animals' - - feedback: '`{at} {random}` is the correct spelling' - option: '`{at} {random}` is spelled incorrectly' - correct_answer: A - hint: There's something wrong in line 1 + 4: question_text: What's wrong with this code? - code: "animals {is} dog cat cow\n{print} animals {at} {random}" - 1: + code: |- + groceries = apples, bread, milk + {for} item {in} groceries + {print} 'We need ' groceries mp_choice_options: - - option: '`{print}`' - feedback: '`{print}` is used to print text' - - feedback: '`{ask}` is used to ask a question' - option: '`{ask}`' - - option: '`{is}`' - feedback: '`{is}` is used to make a list' - - option: '`{at}` `{random}`' - feedback: Correct! - hint: Arbitrarily means without a plan or randomly. + - option: Line 2 needs to start with 4 spaces as indentation + feedback: No it doesn't. Only line 3 needs indentation, which it has. + - option: Line 3 does not need to start with 4 spaces as indentation + feedback: Line 2 is a `{for}`command so line 3 does need to start with an indent. + - option: Line 3 should say item instead of groceries + feedback: Good job! + - option: Line 2 should say groceries instead of item + feedback: No it does not. + hint: Line 2 says `{for}` each item in the list of groceries + correct_answer: C question_score: '10' - correct_answer: D - question_text: What command(s) do you use to let Hedy pick something arbitrarily? - 8: - code: "crisps {is} sea salt, paprika, sour cream\n{remove} sea salt {from} crisps\n{remove} paprika {from} crisps\n{print} crisps {at} {random}" - hint: There are 3 flavors, bit 2 are removed. Which one remains? + 5: + question_text: What word should be on the _ with these digital dice? + code: |- + {print} 'Welcome to the digital dice!' + players = Ann, John, Jesse + choices = 1, 2, 3, 4, 5, 6 + {for} player {in} players + {print} player ' throws ' _ {at} {random} mp_choice_options: - - option: You can't tell, because Hedy will `{print}` one of the 3 flavors `{at} {random}` - feedback: Take a look at the `{remove}` commands - - feedback: sea salt is removed from the list - option: sea salt - - feedback: Paprika is removed from the list - option: paprika - - option: sour cream + - option: players + feedback: It would say 'Ann throws Jesse', instead of 'Ann throws 6'. + - option: choices feedback: That's right! - correct_answer: D - question_score: '10' - question_text: What is the output of this code? - 5: + - option: choice + feedback: You are very close. But you need Hedy to pick from the list called 'choices' not 'choice'... + - option: dice + feedback: Look at the names of the variables. + hint: Hedy needs to pick a number `{at} {random}` + correct_answer: B question_score: '10' + 6: + question_text: Which of the answers below is a possible outcome when you run the code? + code: |- + choices = rock, paper, scissors + players = Kelly, Meredith + {for} player {in} players + {print} player ' chooses ' choices {at} {random} mp_choice_options: - - feedback: No, that's not wrong. - option: Line 1 needs to say `{print}` instead of `{ask}` - - feedback: No that's not wrong. - option: Line 2 needs to say `{ask}` instead of `{print}` - - feedback: No, that's not wrong. - option: Line 2 needs to say answers `{at} {random}` `{is}` yes, no, maybe - - feedback: That's right! - option: Nothing, this code is perfect + - option: Kelly chooses rock + feedback: Meredith wants to play too! + - option: |- + Meredith chooses scissors + Kelly chooses rock + feedback: So close! But Kelly is first in the list, so she goes first + - option: Meredith chooses paper + feedback: Kelly wants to play too! + - option: |- + Kelly chooses paper + Meredith chooses scissors + feedback: Amazing! + hint: Each player will pick an option. The player that's first on the list will go first. correct_answer: D - hint: Does this code even have a mistake? - code: "question {is} {ask} What do you want to know?\n{print} question\nanswers {is} yes, no, maybe\n{print} answers {at} {random}" - question_text: What is wrong in this code? - 9: - code: "colors {is} blue, purple, green\nchosen_color {is} {ask} Which hair color wouldn't you like to have?\n{remove} chosen_color {from} colors\n{print} I will dye my hair color {at} {random}" - mp_choice_options: - - feedback: Maybe you want blue hair though! - option: 'Line 3 should say: `{remove}` blue `{from}` colors' - - feedback: You want to remove the chosen color so `{remove}` is right. - option: Line 3 should have an `{add}` command instead of a `{remove}` command - - feedback: Great job! - option: In line 4 the variable should be called colors instead of color - - feedback: Find the mistake! - option: Nothing, this is a correct code! - hint: Look at line 4 question_score: '10' - question_text: What's wrong with this code? - correct_answer: C 7: - mp_choice_options: - - feedback: The remove command removes, the add command adds - option: The `{add}` command removes a random book from the list - - option: The `{add}` command adds a random book to a list - feedback: It doesn't. It adds your answer to the list! - - feedback: Correct! - option: The `{add}` command adds your favorite book to the list - - option: The `{add}` command prints your favorite book. - feedback: No, it adds your favorite book to the list - correct_answer: C - hint: The `{add}` command adds a book, but which one? - code: "books {is} Harry Potter, The Hobbit, Green Eggs and Ham\nyour_book {is} {ask} What is your favorite book?\n{add} your_book {to} books\n{print} books {at} {random}" - question_text: What does the `{add}` command do? + question_text: What line should be on the _ in this code that decides what these people will have for dinner? + code: |- + names = Ron, Leslie, April, Andy + food = pasta, fries, salad + _ + {print} name ' has to eat ' food {at} {random} ' for dinner' + mp_choice_options: + - option: |- + ``` + {for} name {in} names + ``` + feedback: You are on fire! + - option: |- + ``` + {for} names {in} name + ``` + feedback: No it should be for each name in the list nameS, so the other way around + - option: |- + ``` + {for} food {in} food + ``` + feedback: Each name should be told what they will have for dinner. + - option: |- + ``` + {for} name {in} food + ``` + feedback: Each name should be told what they will have for dinner. + hint: Each name should be told what they will have for dinner. + correct_answer: A question_score: '10' - 6: + 8: + question_text: What should be on the _ in this code that decides which color shirt you get? + code: |- + names = Donna, Tommy, Ben + colors = blue, red, purple + {for} name {in} names + {print} _ + mp_choice_options: + - option: |- + ``` + 'name gets a color shirt' + ``` + feedback: That's not it! + - option: |- + ``` + name 'gets a ' colors {at} {random} ' shirt' + ``` + feedback: Great job! This was a hard one! + - option: |- + ``` + names 'gets a ' color {at} {random} ' shirt' + ``` + feedback: You want each name printed. So the first word should not be names but... + - option: |- + ``` + people ' gets a colors shirt' + ``` + feedback: There is no variable named people.. + hint: Mind the quotation marks and the names of the variables + correct_answer: B + question_score: '10' + 9: + question_text: What is the first question Hedy will ask you when you run the program? + code: |- + courses = appetizer, main course, dessert + names = Timon, Onno + {for} name {in} names + {for} course {in} courses + food = {ask} name ', what would you like to eat as your ' course '?' + {print} name ' orders ' food ' as their ' course mp_choice_options: - - option: Line 2 needs to say question instead of answers - feedback: No that's not right - - option: Line 2 needs the `{is}` command + - option: Timon, what would you like to eat as your appetizer? + feedback: Perfect! + - option: Onno, what would you like to eat as your appetizer? + feedback: Timon is first on the list! + - option: Timon, what would you like to eat as your dessert? + feedback: Appetizers are first in the list + - option: You don't know that. Hedy will choose `{at} {random}`. + feedback: There is no `{at} {random}` in this code... + hint: The first options from both lists are chosen. + correct_answer: A + question_score: '10' + 10: + question_text: What is true about this code? + code: |- + prizes = 1 million dollars, car, sandwich + names = Bob, Patrick, Sandy, Larry + {for} prize {in} prizes + {print} 'The ' prize 'is won by ' names {at} {random} + mp_choice_options: + - option: Everybody will always win a prize. + feedback: That is not true, you could end up without a prize. + - option: All the prizes always go to one single person. + feedback: That is not true. All the prizes are given away, but to random people + - option: Larry will never win a prize + feedback: That is not true. Larry has the same odds as the others + - option: Someone might win two prizes + feedback: You get it! + hint: Try to imagine the output of this code. + correct_answer: D + question_score: '10' + 11: + 1: + question_text: What word should be at the place of the blank? + code: |- + {for} i {in} _ 1 {to} 10 + {print} i + mp_choice_options: + - option: |- + ``` + counter + ``` + feedback: 'No' + - option: '`{range}`' feedback: Correct - - option: Line 3 needs to say answer instead of answers - feedback: No the variable's called answers - - option: Nothing! This code is great! - feedback: Actually, line 2 has a mistake. + - option: '`{if}`' + feedback: 'No' + - option: '`{for}`' + feedback: 'No' + hint: What did you learn in this level? correct_answer: B - code: "question {is} {ask} What do you want to know?\nanswers yes, no, maybe\n{print} answers {at} {random}" + question_score: '10' + 2: + question_text: What will be the output from this code? + code: |- + {for} i {in} {range} 1 {to} 3 + {print} i + mp_choice_options: + - option: |- + 1 + 2 + 3 + feedback: Correct! + - option: 1 2 3 + feedback: That's not it + - option: 1, 2, 3 + feedback: That's not it + - option: '123' + feedback: That's not it + hint: How do the numbers appear in the screen? + correct_answer: A + question_score: '10' + 3: + question_text: Which code was used to get this output? + output: |- + 1 + 2 + 3 + 4 + 5 + Once I caught a fish alive! + mp_choice_options: + - option: |- + ``` + {for} i {in} {range} 1 {to} 5 + {print} i + {print} 'Once I caught a fish alive!' + ``` + feedback: Perfect + - option: |- + ``` + {for} i {in} {range} 1 {to} 5 + {print} i + {print} 'Once I caught a fish alive!' + ``` + feedback: This code won't work. You need an indent after {for}. + - option: |- + ``` + {for} i {in} {range} 1 {to} 5 + {print} i + {print} 'Once I caught a fish alive!' + ``` + feedback: Now Hedy will count '1 Once I caught a fish alive!, 2 Once I caught a fish alive! etc. + - option: |- + ``` + {for} i {in} {range} 1 {to} 5 + {print} 'i' + {print} 'Once I caught a fish alive!' + ``` + feedback: i is a variable and shouldn't have quotation marks + hint: First all the numbers, then the sentence + correct_answer: A + question_score: '10' + 4: + question_text: Which code was used to get this output? + output: |- + 10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1 + 0 + mp_choice_options: + - option: |- + ``` + {for} i {in} {range} 0 {to} 10 + {print} i + ``` + feedback: Now Hedy prints the numbers from 0 to 10 instead of 10 to 0. + - option: |- + ``` + {for} i {in} {range} 0 {to} 10 + {print} - i + ``` + feedback: Hedy would print negative numbers in this case. + - option: |- + ``` + {for} i {in} {range} 10 to 0 + {print} 10 9 8 7 6 5 4 3 2 1 0 + ``` + feedback: Unfortunately this does not exist. + - option: |- + ``` + {for} i {in} {range} 0 {to} 10 + {print} 10 - i + ``` + feedback: That's right! + hint: It has to be a calculation... + correct_answer: D + question_score: '10' + 5: question_text: What's wrong with this code? - hint: There is something wrong with line 2. + code: |- + {for} i {in} {range} 1 {to} 10 + {print} i + mp_choice_options: + - option: The i in the last line need quotation marks + feedback: No it doesn't. + - option: You can't use `{range}` 1 `{to}` 5 only `{range}` 1 `{to}` 10 + feedback: You could use 1 to 5 just as well! + - option: Line 1 needs to start with an indention. + feedback: Not line 1... + - option: Line 2 needs to start with an indention + feedback: Perfect! + hint: There is something wrong with the indention + correct_answer: D question_score: '10' - 4: + 6: + question_text: How many times does the word Hello appear on your screen when you run the code? + code: |- + {for} i {in} {range} 0 {to} 2 + {print} 'Hello' mp_choice_options: - - option: "```\n{print} price\n```" - feedback: You don't want to `{print}` the word price, but you want to `{print}` one price out of your list `{at} {random}` - - option: "```\n{print} prices {at} {random}\n```" - feedback: Great! You've really paid attention. - - feedback: '`{at} {random}` is placed behind the variable.' - option: "```\n{print} {at} {random} price\n```" - - option: Nothing, this code is alright. - feedback: Look carefully for the mistake you missed! - hint: The variable name is prices - question_text: What should change in line 2 to print a random price? - correct_answer: B + - option: 1 time + feedback: 'No' + - option: 2 times + feedback: 'No' + - option: 3 times + feedback: That's right! + - option: Never + feedback: 'No' + hint: 0 also counts. So 0,1,2 that's 3 times. + correct_answer: C question_score: '10' - code: "prices {is} 1 dollar, 100 dollar, 1 million dollar\n{print} price {at} {random}" - 3: - mp_choice_options: - - option: "```\n{at} {random} {print} options\n```" - feedback: You're almost there. The order of the words isn't right yet. - - option: "```\n{print} rock {at} {random}\n```" - feedback: you don't always want the Hedy to {print} rock, sometimes you want scissors or paper. - - option: "```\n{print} options {at} {random}\n```" - feedback: Very good! - - option: Nothing, the code is correct! - feedback: Look carefully for the mistake + 7: + question_text: What should be on the place of the blank? + code: |- + {print} 'Welcome to Hedys diner' + people = {ask} 'How many people will be eating here tonight?' + _ + food = {ask} 'What would you like to order?' + {print} food + mp_choice_options: + - option: |- + ``` + {for} i {in} {range} 0 {to} 3 + ``` + feedback: There's not always 3 people + - option: |- + ``` + {for} i {in} {range} 1 {to} guests + ``` + feedback: The variable is not named guests + - option: |- + ``` + {for} i {in} {range} 1 {to} people + ``` + feedback: Great! + - option: |- + ``` + {for} i {in} {range} 0 {to} people + ``` + feedback: That's one order too many! + hint: Use the variable 'people' + correct_answer: C question_score: '10' + 8: + question_text: What will be the output from this code? + code: |- + {for} i {in} {range} 23 {to} 25 + {print} 'hi' + mp_choice_options: + - option: |- + 23 + 24 + 25 + feedback: The numbers don't appear. It doesn't say `{print}` i. + - option: 23 hi 24 hi 25 hi + feedback: The numbers don't appear. It doesn't say `{print}` i + - option: |- + hi + hi + hi + feedback: Correct + - option: The word 'hi' will appear 25 times in a row. + feedback: No it will only appear 3 times. + hint: It doesn't say `{print}` i correct_answer: C - hint: The variable (the list) is called options. - code: "options {is} rock, paper, scissors\n{print} rock, paper, scissors {at} {random}" - question_text: How do you fix the mistake in line 2? - 7: - 2: - hint: First the `{repeat}` command, then the `{print}` command + question_score: '10' + 9: + question_text: How many times does Hedy chant Hip Hip Hooray? + code: |- + age = {ask} 'How old are you?' + {for} i {in} {range} 1 {to} age + {print} 'Hip Hip Hoorray!' mp_choice_options: - - feedback: "`{repeat}` 100 `{times}` `{print}` 'hello'" - option: "```\n{print} 100 {times} 'hello'\n```" - - option: "```\n{print} {repeat} 100 {times} 'hello'\n```" - feedback: "{repeat} 100 {times} {print} 'hello'" - - feedback: "{repeat} 100 {times} {print} 'hello'" - option: "```\n{repeat} 'hello' 100 {times}\n```" - - feedback: That's right! - option: "```\n{repeat} 100 {times} {print} 'hello'\n```" + - option: 1 time + feedback: Try again + - option: 2 times + feedback: Try again + - option: Never + feedback: Try again + - option: That depends on how old you are + feedback: That's right! + hint: '`{for}` i `{in}` `{range}` 1 `{to}` age' correct_answer: D - question_text: Which code is right? question_score: '10' 10: - hint: Mind the order of the sentences. - correct_answer: B - code: "if youre happy and you know it clap your hands\nif youre happy and you know it clap your hands\nif youre happy and you know it and you really want to show it\nif youre happy and you know it clap your hands" - mp_choice_options: - - feedback: Almost! the first line needs an extra word - option: "```\n{repeat} 2 {times} 'if youre happy and you know it clap your hands'\n{print} 'if youre happy and you know it and you really want to show it'\n{print} 'if youre happy and you know it clap your hands'\n```" - - option: "```\n{repeat} 2 {times} {print} 'if youre happy and you know it clap your hands'\n{print} 'if youre happy and you know it and you really want to show it'\n{print} 'if youre happy and you know it clap your hands'\n```" - feedback: Great! - - feedback: This is not in the right order. - option: "```\n{repeat} 3 {times} {print} 'if youre happy and you know it clap your hands'\n{print} 'if youre happy and you know it and you really want to show it'\n```" - - option: "```\n{repeat} 4 {times} 'if youre happy and you know it'\n{repeat} 2 {times} 'clap your hands'\n{print} 'and you really want to show it'\n{print} 'clap your hands'\n```" - feedback: This is not in the right order. - question_score: '10' question_text: Which code belongs to this output? - 7: - mp_choice_options: - - option: "We will We will\nROCK YOU!" - feedback: "'We will' won't appear twice in the same line" - - feedback: Great! - option: "We will\nWe will\nROCK YOU!" - - feedback: ROCK YOU! won't be repeated - option: "We will\nROCK YOU!\nWe will\nROCK YOU!" - - feedback: Mind the `{repeat}` command - option: "We will\nROCK YOU!" - hint: Mind the `{repeat}` command. + output: |- + Baby shark tututudutudu + Baby shark tututudutudu + Baby shark tututudutudu + Baby shark + mp_choice_options: + - option: |- + ``` + {for} i {in} {range} 1 {to} 3 + {print} Baby shark tututudutudu + {print} Baby shark + ``` + feedback: Mind the indention + - option: |- + ``` + {for} i {in} {range} 1 {to} 3 + {print} Baby shark tututudutudu + {print} Baby shark + ``` + feedback: That's right! + - option: |- + ``` + {for} i {in} {range} 0 {to} 3 + {print} Baby shark tututudutudu + {print} Baby shark + ``` + feedback: '`{range}` 0 `{to}` 3 is 4 times.' + - option: |- + ``` + {for} i {in} {range} 0 {to} 3 + {print} Baby shark tututudutudu + {print} Baby shark + ``` + feedback: '`{range}` 0 `{to}` 3 is 4 times.' + hint: Mind the indention correct_answer: B - question_text: What will be the output from this code? - code: "{repeat} 2 {times} {print} 'We will'\n{print} 'ROCK YOU!'" question_score: '10' - 3: - mp_choice_options: - - feedback: No, a word is missing - option: Right - - feedback: The word `{repeat}` is there, another word is missing - option: Wrong, the word `{repeat}` is missing - - option: Wrong, the word `{times}` is missing - feedback: The word `{times}` is there, another word is missing. - - option: Wrong, the word `{print}` is missing - feedback: Correct + 12: + 1: + question_text: Which output is correct? + code: |- + {print} 'three and a half plus one and a half is...' + {print} 3.5 + 1.5 + mp_choice_options: + - option: '5' + feedback: Don't forget the first line of code! + - option: 3.5 + 1.5 + feedback: This is not the one! + - option: |- + three and a half plus one and a half is... + five + feedback: Take a close look at the second line... + - option: |- + three and a half plus one and a half is... + 5 + feedback: Great job! + hint: Both lines are printed! correct_answer: D - code: "{repeat} 100 {times} 'Hello!'" question_score: '10' - hint: "It should be: `{repeat}` 100 `{times}` `{print}` 'Hello'" - question_text: Is this code right or wrong? - 1: + 2: + question_text: Which of these codes is correct? mp_choice_options: - - feedback: No you can repeat a line. - option: '0' - - option: '1' - feedback: Correct, one line at a time - - feedback: In this level only one line at a time - option: '3' - - feedback: In this level you can only repeat one line at a time - option: infinite - correct_answer: B + - option: |- + ``` + flavors {is} vanilla, strawberry, chocolate + {print} 'I would like a ' flavors {at} {random} ' cake.' + ``` + feedback: All the different values of flavors should be in quotation marks. + - option: |- + ``` + 'flavors = vanilla, strawberry, chocolate' + {print} 'I would like a ' flavors {at} {random} ' cake.' + ``` + feedback: All the different values of flavors should be in quotation marks. + - option: |- + ``` + flavors = 'vanilla', 'strawberry', 'chocolate' + {print} 'I would like a ' flavors {at} {random} ' cake.' + ``` + feedback: Alright! + - option: |- + ``` + flavors = 'vanilla, strawberry, chocolate' + {print} 'I would like a ' flavors {at} {random} ' cake.' + ``` + feedback: All the different values of flavors should be in quotation marks. + hint: The second line is the same in each code, pay attention to the first line + correct_answer: C question_score: '10' - question_text: How many lines can you repeat at once with the `{repeat}` command at this level? - hint: You can only repeat one line at a time - 8: - code: "Here comes the sun\nDo do do do\nHere comes the sun\nAnd I say\nIts alright" + 3: + question_text: What's wrong with this code? + code: |- + favorite_animal = {ask} 'What is your favorite animal?' + {print} 'I like ' favoriteanimal ' too!' mp_choice_options: - - option: "```\n{print} 'Here comes the sun'\n{print} 'Do do do do'\n{print} 'Here comes the sun'\n{print} 'And I say'\n{print} 'Its alright'\n```" - feedback: Awesome, you can't use the `{repeat}` command here. - - option: "```\n{repeat} 2 {times} {print} 'Here comes the sun'\n{print} 'And I say'\n{print} 'Its alright'\n```" - feedback: Where did you leave 'Do do do do'? - - option: "```\n{repeat} 2 {times} {print} 'Here comes the sun'\n{print} 'Do do do do'\n{print} 'And I say'\n{print} 'Its alright'\n```" - feedback: This is not the correct order. - - option: "```\n{repeat} 2 {times} {print} 'Here comes the sun'\n{repeat} 2 {times} {print} 'Do do'\n{print} 'And I say'\n{print} 'Its alright'\n```" - feedback: This is not the correct order. - question_score: '10' - question_text: What Hedy code belongs to this output? + - option: The name of the variable is different in line 1 than in line 2. + feedback: Correct! + - option: The quotation marks aren't used correctly in line 2 + feedback: That's not true + - option: You can't use the = sign when using an {ask} command + feedback: That's not true + - option: Nothing is wrong. + feedback: That's not true + hint: The quotation marks are used correctly correct_answer: A - hint: '`{repeat}` can only be used if you want to execute the same line multiple times in a row.' - 6: - mp_choice_options: - - option: "the wheels on the bus go\nround and round" - feedback: Only the second line is repeated 3 times - - option: "the wheels on the bus go\nthe wheels on the bus go\nthe wheels on the bus go\nround and round" - feedback: Only the second line is repeated 3 times - - option: "the wheels on the bus go\nround and round\nthe wheels on the bus go\nround and round\nthe wheels on the bus go\nround and round" - feedback: Only the second line is repeated 3 times - - option: "the wheels on the bus go\nround and round\nround and round\nround and round" - feedback: All through the town! Perfect! - correct_answer: D - hint: Only 'round and round' is repeated 3 times. question_score: '10' - question_text: What will be the output from this code? - code: "{print} 'The wheels on the bus go'\n{repeat} 3 {times} {print} ' round and round'" 4: - question_score: '10' - mp_choice_options: - - option: "```\nI'm\n```" - feedback: That's right! - - feedback: '`{print}` is spelled correctly' - option: '`{print}`' - - feedback: '`{repeat}` is spelled correctly' - option: '`{repeat}`' - - feedback: '`{times}` is spelled correctly' - option: '`{times}`' - code: "{print} 'I'm blue'\n{repeat} 7 {times} {print} 'da ba dee, da ba da'" - hint: I'm is wrong, you can't use apostrophes in a sentence - correct_answer: A - question_text: Which word is wrong in the code? - 9: - mp_choice_options: - - feedback: Your repeated line is incorrect. - option: "```\n{print} 'Batman was flying through Gotham. '\n{print} 'When suddenly he heard someone screaming…'\n{print} 'Help!'\n{repeat} 3 {times} {print} 'Please help me!'\n```" - - option: "```\n{print} 'Batman was flying through Gotham.'\n{print} 'When suddenly he heard someone screaming…'\n{repeat} 3 {times} 'Help!'\n{print} 'Please help me!'\n```" - feedback: The `{print}` command is missing on line 3. - - feedback: You're missing the quotation marks - option: "```\n{print} Batman was flying through Gotham.\n{print} When suddenly he heard someone screaming…\n{repeat} 3 {times} {print} Help!\n{print} Please help me!\n```" - - option: "```\n{print} 'Batman was flying through Gotham.'\n{print} 'When suddenly he heard someone screaming…'\n{repeat} 3 {times} {print} 'Help!'\n{print} 'Please help me!'\n```" - feedback: Perfect - code: "Batman was flying through Gotham.\nWhen suddenly he heard someone screaming...\nHelp!\nHelp!\nHelp!\nPlease help me!" + question_text: In which lines are quotation marks needed to get the code to work? + code: |- + {print} Welcome to the online shoe shop + category = {ask} What kind of shoes are you looking for? + {if} category = high heels + {print} High heels are 50% off now! + mp_choice_options: + - option: Line 1 and 2 + feedback: 'No' + - option: Line 1, 2 and 3 + feedback: 'No' + - option: Line 1, 2 and 4 + feedback: 'No' + - option: All of the lines + feedback: Perfect! + hint: Does line 3 need quotation marks too? correct_answer: D question_score: '10' - question_text: What Hedy code belongs to this output? - hint: "'Help!' is repeated 3 times." 5: - mp_choice_options: - - option: Correct - feedback: That's right! - - option: Wrong - feedback: That's not it - hint: The code is correct! - question_score: '10' - question_text: Is this code right or wrong? - code: "{repeat} 100 {times} {print} 'Hedy is awesome!'" - correct_answer: A - 8: - 4: - question_text: Which output is correct? - hint: The block under the `{repeat}` command is repeated twice. - mp_choice_options: - - option: "The children went:\nYay!\nWe are going on vacation!" - feedback: Mind the `{repeat}` command! - - option: "The children went:\nYay!\nWe are going on vacation!\nYay!\nWe are going on vacation!" - feedback: Correct! - - option: "The children went:\nYay!\nYay!\nWe are going on vacation!\nWe are going on vacation!" - feedback: This order is incorrect. - - option: "The children went:\nYay!\nYay!\nWe are going on vacation!" - feedback: The last line is repeated too. - question_score: '10' + question_text: What output does Agent007 get when they put in the correct password? + code: |- + name {is} {ask} 'What is your name?' + {if} name {is} 'Agent007' + a {is} 'Go to the airport ' + else + a {is} 'Go to the train station ' + password {is} {ask} 'What is the password?' + {if} password {is} 'TOPSECRET' + b {is} 'tomorrow at 02.00' + {else} + b {is} 'today at 10.00' + {print} a + b + mp_choice_options: + - option: Go to the train station today at 10.00 + feedback: The agent won't be catching any bad guys here + - option: Go to the airport tomorrow at 02.00 + feedback: You've cracked the code! + - option: Go to the train station tomorrow at 02.00 + feedback: The agent won't be catching any bad guys here + - option: Go to the airport tomorrow at 10.00 + feedback: The agent won't be catching any bad guys here + hint: The correct password is TOPSECRET correct_answer: B - code: "{print} 'The children went:'\n{repeat} 2 {times}\n {print} 'Yay!'\n {print} 'We are going on vacation!'" - 9: - mp_choice_options: - - feedback: The lines after the `{if}` and `{else}` command should start with 4 spaces - option: Line 2 and 4 - - feedback: Not only 3... - option: Only line 3 - - option: Line 3, 4 and 5 - feedback: Line 4 shouldn't - - feedback: Great job! - option: Line 3 and 5 - code: "1 music = {ask} 'What is your favorite music genre?'\n2 {if} music {is} rock\n3 {print} '🤘'\n4 {else}\n5 {print} '👎'" question_score: '10' - hint: The lines after an `{if}` or `{else}` command should start with 4 spaces. - correct_answer: D - question_text: What line(s) in this code should start with 4 spaces? 6: - mp_choice_options: - - feedback: There is no repetition in this answer. - option: "Welcome to restaurant Hedy\nPancakes" - - option: "Welcome to restaurant Hedy\nWelcome to restaurant Hedy\nPancakes\nPancakes" - feedback: This answer also repeats the welcome message - - option: "Welcome to restaurant Hedy\nWhat do you want to eat?\nWhat do you want to eat?\nPancakes\nPancakes" - feedback: Almost! But look at the question, it is not repeated. - - option: "Welcome to restaurant Hedy\nPancakes\nPancakes" - feedback: Well done! + question_text: Which line should be filled in at the ??? + code: |- + {print} 'Welcome to McHedy!' + order = {ask} 'Would you like a hamburger or fries?' + {if} order = 'hamburger' + price = 12 + {if} order = 'fries' + price = 4 + drinks = {ask} 'Would you like a drink with that for 2 dollars?' + {if} drinks = 'yes' + ??? + {print} 'That will be ' price ' dollar please' + mp_choice_options: + - option: |- + ``` + price = 14 + ``` + feedback: What if you only order fries and a drink? + - option: |- + ``` + price = '14' + ``` + feedback: What if you only order fries and a drink? + - option: |- + ``` + price = price + 2 + ``` + feedback: Excellent! + - option: |- + ``` + price = + 2 + ``` + feedback: Almost there! + hint: What if you only order fries and a drink? + correct_answer: C + question_score: '10' + 7: + question_text: Which output does a vegan get? + code: |- + menu = 'cookies', 'cheese', 'grapes' + {print} "It's my birthday! I`ve brought some snacks!" + diet = {ask} 'Do you have any dietary restrictions?' + {if} diet = 'gluten free' + {remove} 'cookies' {from} menu + {if} diet = 'vegan' + {remove} 'cheese' {from} menu + {print} 'For you I have brought: ' + {for} snack {in} menu + {print} snack + mp_choice_options: + - option: |- + It's my birthday! I've brought some snacks! + For you I have brought: + cookies + grapes + feedback: Terrific! + - option: |- + It's my birthday! I've brought some snacks! + For you I have brought: + grapes + feedback: There's more options than just one + - option: |- + It's my birthday! I've brought some snacks! + For you I have brought: + cheese + grapes + feedback: A vegan person can't have cheese + - option: |- + It's my birthday! I've brought some snacks! + For you I have brought: + grapes + cookies + feedback: Almost there, but look at the order of snacks in the list + hint: What item is removed from the list when you answer 'vegan'? + correct_answer: A question_score: '10' - hint: The first sentence and question will not be repeated - question_text: What will be the output of this code when we enter pancakes? - correct_answer: D - code: "{print} 'Welcome to restaurant Hedy'\n{repeat} 2 {times}\n food {is} {ask} 'What do you want to eat?'\n {print} food" 8: + question_text: Which code was used to create this output? + code: '3.5' mp_choice_options: - - feedback: You are wrong! - option: "```\n{if} answer {is} 32\n {print} 'You are...'\n {sleep}\n {print} 'right!'\n {else}\n {print} 'You are wrong!'\n```" - - feedback: You are wrong! - option: "```\n{if} answer {is} 32\n{print} 'You are...'\n{sleep}\n{print} 'right!'\n{else}\n{print} 'You are wrong!'\n```" - - option: "```\n{if} answer {is} 32\n {print} 'You are...'\n {sleep}\n {print} 'right!'\n{else}\n {print} 'You are wrong!'\n```" - feedback: You are... right! - - feedback: You are wrong! - option: "```\n{if} answer {is} 32\n {print} 'You are...'\n {sleep}\n{print} 'right!'\n{else}\n {print} 'You are wrong!'\n```" + - option: |- + ``` + {print} '7 / 2' + ``` + feedback: 'No' + - option: |- + ``` + {print} 7 / 2 + ``` + feedback: That is right! + - option: |- + ``` + {print} 7 : 2 + ``` + feedback: 'No' + - option: |- + ``` + {print} 7 * 2 + ``` + feedback: 'No' + hint: 7 devided by 2 is 3.5 + correct_answer: B question_score: '10' - hint: What should happen if the person is right? And what else? - question_text: In which of the codes is the indentation done right? + 9: + question_text: Which code should be filled in in line 1 at the ??? + code: |- + ??? + {print} 'You won ' prizes {at} {random} '!' + mp_choice_options: + - option: |- + ``` + prizes = 'one' 'million' 'dollars', 'nothing' + ``` + feedback: You won nothing + - option: |- + ``` + prizes = 'one million dollars, nothing' + ``` + feedback: You won nothing + - option: |- + ``` + prizes = 'one million dollars', 'nothing' + ``` + feedback: Winner! + - option: |- + ``` + 'prizes' = 'one million dollars', 'nothing' + ``` + feedback: You won nothing + hint: The items on the list should be in quotation marks correct_answer: C - 7: - correct_answer: D - mp_choice_options: - - option: Nothing. This code is correct! - feedback: Something is wrong! - - feedback: You are! - option: You're not allowed to use an `{if}` command after an `{ask}` command. - - option: You don't have to use indentation twice. Only in the first `{if}` command. - feedback: You always have to use indentation. - - feedback: That's right. - option: The indentation is wrong in the first `{if}` command. - code: "food = {ask} 'What would you like to eat?'\n{if} food {is} fries\nsauce = {ask} 'What sauce would you like?'\n {print} 'One fries with ' sauce\n{if} food {is} pizza\n topping = {ask} 'What topping would you like?'\n {print} 'One pizza with ' topping\n{print} 'Thank you for your order'" - hint: Take a careful look at the indentation. question_score: '10' - question_text: What is wrong with this code? + 10: + question_text: Which line of code should be filled in at the ??? to complete the song ? + code: |- + actions = 'clap your hands', 'stomp your feet', 'shout Hurray!' + ??? + {for} i {in} {range} 0 {to} 1 + {print} 'if youre happy and you know it' + {print} action + {print} 'if youre happy and you know it and you really want to show it' + {print} 'if youre happy and you know it' + {print} action + mp_choice_options: + - option: |- + ``` + {for} i {in} {range} 1 {to} 3 + ``` + feedback: This is a hard one! All the actions on the list must be in the song. + - option: |- + ``` + {for} action {in} actions + ``` + feedback: You are amazing! + - option: |- + ``` + {repeat} 3 {times} + ``` + feedback: This is a hard one! All the actions on the list must be in the song. + - option: |- + ``` + {print} actions {at} {random} + ``` + feedback: This is a hard one! All the actions on the list must be in the song. + hint: This is a hard one! All the actions on the list must be in the song. + correct_answer: B + question_score: '10' + 13: 1: - mp_choice_options: - - option: "Hello\nIm Hedy!" - feedback: Everything is printed twice. - - option: "Hello\nHello\nIm Hedy" - feedback: The second line is repeated twice as well. - - option: "Hello\nIm Hedy!\nHello\nIm Hedy!" + question_text: Which code should be filled in at the ??? ? + code: |- + name = {ask} 'What is your name?' + song = {ask} 'Whould you like to hear a song?' + birthday = {ask} 'Is today your birthday?' + ??? + {print} 'Happy Birthday to you!' + {print} 'Happy Birthday to you!' + {print} 'Happy Birthday dear ' name + {print} 'Happy Birthday to you!' + mp_choice_options: + - option: |- + ``` + {if} birthday {and} song = 'yes' + ``` + feedback: Almost there + - option: |- + ``` + {if} birthday = 'yes' {and} name = 'Hedy' + ``` + feedback: Hedy only sings for you if you like to hear a song + - option: |- + ``` + {if} song = 'yes' {and} birthday = 'yes' + ``` feedback: Super! - - option: "Hello\nHello\nIm Hedy!\nIm Hedy!" - feedback: Everything is printed twice + - option: |- + ``` + {if} song = 'yes' {or} birthday = 'yes' + ``` + feedback: Hedy only sings if both answers are yes + hint: Hedy sings if you want to hear a song and it's you birthday correct_answer: C - question_text: Which output will be produced by this code? - hint: Both lines are repeated twice. question_score: '10' - code: "{repeat} 2 {times}\n {print} 'Hello'\n {print} 'Im Hedy!'" - 3: - mp_choice_options: - - option: "Baby shark tututudutudu\nBaby shark" - feedback: Mind the `{repeat}` command! - - feedback: The last line has no indentation, so it's not repeated. - option: "Baby shark tututudutudu\nBaby shark\nBaby shark tututudutudu\nBaby shark\nBaby shark tututudutudu\nBaby shark" - - feedback: Right! - option: "Baby shark tututudutudu\nBaby shark tututudutudu\nBaby shark tututudutudu\nBaby shark" - - feedback: What is being repeated and what isn't. - option: "Baby shark tututudutudu\nBaby shark\nBaby shark\nBaby shark" - question_score: '10' - code: "{repeat} 3 {times}\n {print} 'Baby shark tututudutudu'\n{print} 'Baby shark'" - hint: What is being repeated and what is not? - question_text: What output will be produced when you run this program? - correct_answer: C 2: - correct_answer: D - mp_choice_options: - - feedback: No it should be 2 lines. - option: This should be only one line, not 2. - - option: This `{print}` command has to be removed. - feedback: No, you need it. - - feedback: No, `{repeat}` is the correct spelling - option: There is a spelling mistake in the `{repeat}` command. - - option: The second line needs to start with 4 spaces as indentation. - feedback: Correct! - code: "{repeat} 5 {times}\n{print} 'Hedy is cool!'" - question_score: '10' - hint: Something is missing in the second line? - question_text: What is wrong with this code? - 10: - correct_answer: D - mp_choice_options: - - feedback: That's not true - option: All lines should start with 4 spaces - - option: Line 2 and 3 should start with 4 spaces - feedback: That's not true - - feedback: That's not true - option: Line 2 should start with 4 spaces - - option: Line 3 should start with 4 spaces - feedback: You are correct! - code: "1 level = {ask} 'What level are you on?'\n2 {if} level {is} 8\n3 {print} 'Great job!'" - question_text: Which statement is true? - hint: Only one line starts with 4 spaces, but which one...? + question_text: Which command is missing in the code at the place of the ??? ? + code: |- + menu = 'cheese', 'sausage rolls', 'cookies' + diet = {ask} 'Do you have any dietary restrictions?' + {if} diet = 'vegan' ??? diet = 'halal' + {remove} 'sausage rolls' {from} menu + mp_choice_options: + - option: '`{and}`' + feedback: You don't have to be vegan and muslim + - option: '`{or}`' + feedback: Great thinking! + - option: '`+`' + feedback: 'No' + - option: '`{print}`' + feedback: 'No' + hint: Neither vegans nor muslims can eat sausage rolls. + correct_answer: B question_score: '10' - 5: + 3: + question_text: Which output is given to a member without a discount code? + code: |- + member = {ask} 'Do you have a membership card?' + discount = {ask} 'Do you have a discount code?' + {if} member = 'yes' {or} discount = 'yes' + {print} 'You get a free apple pie!' + {else} + {print} 'That will be 5 dollars please' + mp_choice_options: + - option: You get a free apple pie! + feedback: Great job! + - option: That will be 5 dollars please + feedback: That is not true + - option: This code won't work, so there is no output + feedback: There is nothing wrong with the code + - option: There is no way of knowing + feedback: There is! Read the question carefully + hint: Mind the command `{or}` in line 3 + correct_answer: A question_score: '10' + 4: + question_text: Which line of code should follow this line in rock-paper-scissors game? + code: '{if} computer_choice {is} ''rock'' {and} your_choice {is} ''paper''' mp_choice_options: - - option: The `{print}` commands on the last two lines should start on new lines and start with 4 spaces. - feedback: That's right! - - option: '`{else}` is not a command!' - feedback: It is! - - feedback: That's not true - option: Lines that start with `{if}` should start with 4 spaces - - feedback: That's not true - option: '`{ask}` is no longer a command' + - option: |- + ``` + {print} 'you win' + ``` + feedback: You win! + - option: |- + ``` + {print} 'you lose' + ``` + feedback: You lose! + - option: |- + ``` + {print} 'tie' + ``` + feedback: It's only a tie if both choices are the same + - option: |- + ``` + {print} 'try again' + ``` + feedback: Try again! + hint: Paper beats rock correct_answer: A - code: "end = {ask} 'Do you want a happy or a sad ending?'\n{if} end {is} happy {print} 'They lived happily ever after'\n{else} {print} 'The world exploded. The end.'" - question_text: What is wrong with this code? - hint: Something is wrong with indentation - 6: - 8: + question_score: '10' + 5: + question_text: Which statement is true about this code? + code: |- + {if} name = 'Cinderella' {and} shoe_size = 38 + {print} 'You are my one true love!' mp_choice_options: - - feedback: No, there should be! - option: There shouldn't be quotation marks in line 2 - - feedback: Correct! - option: The variable is called correct answer, but a variable's name can only be 1 word. So it should be correct_answer - - option: The `{if}` and `{else}` commands should be in the same line. - feedback: No, that's not true. - - feedback: Variable names can be similar, but they can't be 2 words... - option: The variable in line 2 can't be called answer, because it is too similar to the variable correct answer. + - option: Every person with shoe size 38 is this prince's one true love + feedback: The prince is a little more picky than that! + - option: Every person named Cinderella is this prince's one true love + feedback: The prince is a little more picky than that! + - option: Every person that is named Cinderella and has shoe size 38 is this prince's one true love + feedback: Fantastic! + - option: Every person that's not named Cinderella and does not have shoe size 38 is this prince's one true love + feedback: The prince is a little more picky than that! + hint: Both statements have to be true + correct_answer: C question_score: '10' - code: "correct answer = 3*12\nanswer = {ask} 'What is 3 times 12?'\n{if} answer {is} correct answer {print} 'Good job!'\n{else} {print} 'No... It was ' correct answer" - correct_answer: B - question_text: Why is this code incorrect? - hint: Inspect what the variables are called. - 1: + 6: + question_text: Which statement about this code is true? + code: |- + {print} 'Let me guess which family member you are!' + glasses = {ask} 'Do you wear glasses?' + female = {ask} 'Are you female?' + {if} glasses = 'yes' {and} female = 'yes' + {print} 'You must be Sophie!' + {if} glasses = 'no' {and} female = 'yes' + {print} 'You must be Marleen!' + {if} glasses = 'yes' {and} female = 'no' + {print} 'You must be Wouter!' + {if} glasses = 'no' {and} female = 'no' + {print} 'You must be Michael!' mp_choice_options: - - option: '20' - feedback: Correct! - - feedback: No, the plus sign is used in addition - option: '12' - - feedback: No, Hedy will calculate the answer - option: 2*10 - - feedback: Mind it's a calculation. - option: '210' - question_text: What's Hedy's output when you run this code? - code: '{print} 2*10' + - option: Michael is a boy with glasses + feedback: Try again + - option: Marleen is a girl with glasses + feedback: Try again + - option: Wouter is a boy without glasses + feedback: Try again + - option: Sophie is a girl with glasses + feedback: Great job! + hint: Take a good look! Or do you need glasses? + correct_answer: D question_score: '10' - correct_answer: A - hint: The `*` is used as a multiplication sign 7: + question_text: Which statement is false? + code: |- + {print} 'Thank you for helping me take care of my pets' + {print} 'Here is a program to help feed them' + animal = {ask} 'What kind of animal are they?' + color = {ask} 'What colour are they?' + {if} animal = 'cat' {and} color = 'grey' + {print} 'That is Abby. She eats 3 scoops of cat nibbles' + {if} animal = 'cat' {and} color = 'orange' + {print} 'That is Milo. He eats 4 scoops of cat nibbles' + {if} animal = 'bird' {or} color = 'black' + {print} 'I fed them this moring! They do not need more food today' + {if} animal = 'hamster' {and} color = 'brown' + {print} 'You can feed them a piece of carrot' mp_choice_options: - - option: It could have been `price = 3` just as well. - feedback: No, that's not true. Hedy needs to add 3 dollars to the total. - - feedback: Hedy would understand, but it wouldn't be right. - option: Because Hedy doesn't understand `price = 3`. - - option: Because Hedy would otherwise forget about the previous order. The price would be 3 dollars in total. - feedback: That's right! - - option: Because the price is 0 dollars to begin with. - feedback: That's true, but not the reason - question_text: Why does line 7 say 'price is price + 3' instead of 'price is 3'? + - option: The grey cat is called Abby + feedback: This is true! + - option: Milo the orange cat eats 4 scoops of cat nibbles + feedback: This is true + - option: The black hamster needs to be fed a piece of carrot + feedback: Great job! + - option: The yellow bird was fed this morning + feedback: This is true + hint: Read the last 4 lines carefully correct_answer: C - hint: The price shouldn't be 3, but 3 dollars more than it already was - code: "{print} 'Welcome at Hedys diner'\nfood = {ask} 'What would you like to eat?'\nprice = 0\n{if} food {is} hamburger price = price + 15\n{if} food {is} fries price = price + 6\ndrinks = {ask} 'What would you like to drink?'\n{if} drinks {is} coke price = price + 3\n{if} drinks {is} water price = price + 1\n{print} price ' dollars please'" question_score: '10' - 4: - mp_choice_options: - - feedback: Mind, Hedy also prints 'Your lucky number is...' - option: '30' - - feedback: Please try again. - option: '10' - - option: Your lucky number is... 30 - feedback: That's right! - - option: Your lucky number is... 10 - feedback: Her lucky number is name times age... - question_text: Kim is 10 years old. What will Hedy print for her? - code: "name = {ask} 'How many letters are in your name?'\nage = {ask} 'How old are you?'\nluckynumber = name*age\n{print} 'Your lucky number is...' luckynumber" - hint: 'Kim has 3 letters, she is 10 years old so: letters times age = 3*10 = 30.' - correct_answer: C + 8: + question_text: What output do you get if you order popcorn but no drink? + code: |- + {print} 'Welcome to the movie theater' + popcorn = {ask} 'Would you like some popcorn?' + drink = {ask} 'Would you like a drink?' + {if} popcorn = 'yes' {and} drink = 'yes' + {print} 'That will be 8 dollars please' + {if} popcorn = 'no' {and} drink = 'yes' + {print} 'That will be 3 dollars please' + {if} popcorn = 'yes' {and} drink = 'no' + {print} 'That will be 5 dollars please' + {if} popcorn = 'no' {and} drink = 'no' + {print} 'Ok' + {print} 'Enjoy the movie' + mp_choice_options: + - option: |- + Welcome to the movie theater + That will be 8 dollars please + Enjoy the movie + feedback: You have paid too much! + - option: |- + Welcome to the movie theater + That will be 5 dollars please + Enjoy the movie + feedback: Amazing! + - option: |- + Welcome to the movie theater + That will be 3 dollars please + Enjoy the movie + feedback: That's not enough money! + - option: |- + Welcome to the movie theater + Ok + Enjoy the movie + feedback: You have to pay for your popcorn! + hint: popcorn = yes and drink = no + correct_answer: B question_score: '10' - 2: - mp_choice_options: - - feedback: That's not it - option: '`-`' - - option: plus - feedback: That's not it - - option: '`*`' - feedback: That's not it - - option: '`+`' + 9: + question_text: What is wrong with this code? + code: |- + 1 chocolate = {ask} 'Would you like chocolate sauce on your ice cream?' + 2 sprinkles = {ask} 'Would you like sprinkles on your ice cream?' + 3 {if} chocolate {and} sprinkles = 'yes' + 4 {print} 'Ice cream with chocolate sauce and sprinkles, coming up!' + 5 {if} chocolate = 'yes' {and} sprinkles = 'no' + 6 {print} 'Ice cream with chocolate sauce, coming up!' + 7 {if} chocolate = 'no' {and} sprinkles = 'yes' + 8 {print} 'Ice cream with sprinkles, coming up' + 9 {if} chocolate = 'no' {and} sprinkles = 'no' + 10 {print} 'Just plain icecream, coming up!' + mp_choice_options: + - option: |- + Line 3 should be: + ``` + {if} chocolate = 'yes' {and} sprinkles = 'yes' + ``` feedback: Correct! - question_text: What do you use when you want to add two numbers? + - option: "Line 3 should be: \n```\n{if} chocolate = 'no' {and} sprinkles = 'no'\n```" + feedback: This is not what I ordered! + - option: "Line 5 should be: \n```\n{if} chocolate = 'yes' {and} sprinkles = 'yes'\n```" + feedback: This is not what I ordered! + - option: |- + Line 7 should be: + ``` + {if} chocolate = 'yes' {and} sprinkles = 'no' + ``` + feedback: This is not what I ordered! + hint: There is a mistake in line 3 + correct_answer: A question_score: '10' - hint: It's the plus sign. - correct_answer: D 10: + question_text: Which command needs to be in line 8 at the place of the ??? ? + code: |- + {print} 'Welcome to the product finder of this supermarkt' + item = {ask} 'What product are you looking for?' + bakery = 'bread', 'buns', 'muffins' + drinks = 'soda', 'water', 'lemonade' + snacks = 'chips', 'nuts', 'dips' + frozen = 'fries', 'icecream', 'pizza' + fruit = 'bananas', 'apples', 'oranges' + {if} item {in} snacks ??? item {in} drinks + {print} 'This item is in aisle 3' + {if} item {in} bakery {or} item {in} bakery + {print} 'This item in in the back of the store' + {if} item {in} fruit + {print} 'The fruit is sold near the register' mp_choice_options: - - feedback: You are allowed to use the `=` sign as well - option: You can only fill in the word is on the `_` - - option: You can fill in either the word is or the `=` sign on the `_` - feedback: Amazing! - - option: You have to fill in =is= on the `_` - feedback: No, one `=` sign is enough - - feedback: You can also use `=` with words. - option: You can only use the `=` sign when working with numbers, not with words. - hint: '`{is}` and `=` are both allowed' + - option: '`{and}`' + feedback: There are no items that are both the list of snacks and the list of drinks + - option: '`{or}`' + feedback: Great job! + - option: '`{in}`' + feedback: 'No' + - option: '`{if}`' + feedback: 'No' + hint: The item is either in the list of snacks, or in the list of drinks correct_answer: B question_score: '10' - question_text: Which statement is true? - code: "name _ Hedy\n{print} name 'is walking trough the forrest'" - 5: + 14: + 1: + question_text: Which symbol should be used on the blank? + code: |- + name _ {ask} 'Who are you?' + {if} name == 'Hedy' + {print} 'Me too!' mp_choice_options: - - option: 5 dollars - feedback: Unfortunately, it's not that cheap. - - feedback: No, it's 10 dollars each. - option: 10 dollars - - feedback: The * means multiplication. - option: 15 dollars - - option: 50 dollars - feedback: Great! - question_text: If 5 people eat at this restaurant, how much do they have to pay in total? + - option: '`=>`' + feedback: This is not a symbol. + - option: '`==`' + feedback: We are not comparing anything, just asking. + - option: '`!=`' + feedback: We are not comparing anything, just asking + - option: '`=`' + feedback: Right! + hint: We are not comparing anything, we are just asking a name. correct_answer: D - hint: '`price` `is` `people` `times` 10' question_score: '10' - code: "{print} 'Welcome to Hedys!'\npeople = {ask} 'How many people are eating with us tonight?'\nprice = people * 10\n{print} 'That will be ' price 'dollar please'" - 3: - hint: Mind the quotation marks!! - correct_answer: C - mp_choice_options: - - feedback: This would be the right answer if there were no quotation marks. - option: '30' - - feedback: Try again… - option: '13' - - feedback: Correct! There are quotation marks, so Hedy will print it literally. - option: 3*10 - - option: Nothing, Hedy will give an error message. - feedback: No, Hedy will print it literally. - question_text: What's Hedy's output when you run this code? - code: "{print} '3*10'" - question_score: '10' - 9: + 2: + question_text: Which of these codes has used the correct = or == symbol? mp_choice_options: - - feedback: (2 bananas + 3 hygiene) * 10 football = 5*10 =? - option: 10% - - feedback: (2 bananas + 3 hygiene) * 10 football = 5*10 =? - option: 32% - - option: 50% - feedback: Super! You are 100 percent smart! - - feedback: (2 bananas + 3 hygiene) * 10 football = 5*10 =? - option: 100% - question_score: '10' + - option: '{if} name = Hedy' + feedback: 'No' + - option: '{if} age = 24' + feedback: 'No' + - option: answer = {ask} 'What is your answer' + feedback: Yes! + - option: answer == {ask} 'How are you doing?' + feedback: 'No' + hint: When you are comparing two answers you should use == correct_answer: C - question_text: Imagine you love football a 10, you've eaten 2 bananas and have washed your hands 3 times today. How smart does the silly fortune teller think you are? - hint: (2 bananas + 3 hygiene) * 10 football = 5*10 =? - code: "{print} 'Im Hedy the silly fortune teller'\n{print} 'I will predict how smart you are!'\nfootball = {ask} 'On a scale of 0 to 10 how much do you love football?'\nbananas = {ask} 'How many bananas have you eaten this week?'\nhygiene = {ask} 'How many times did you wash your hands today??'\nresult = bananas + hygiene\nresult = result * football\n{print} 'You are ' result 'percent smart.'" - 6: - mp_choice_options: - - feedback: Super! - option: 15 dollars - - option: 6 dollars - feedback: The fries are 6 dollars - - feedback: The hamburger isn't free! - option: 0 dollars - - feedback: That's the price for a hamburger and fries! - option: 21 dollars - question_text: How much does a hamburger cost in this virtual restaurant? question_score: '10' - hint: Mind the fourth line. - correct_answer: A - code: "{print} 'Welcome at Hedys diner'\nfood = {ask} 'What would you like to eat?'\nprice = 0\n{if} food {is} hamburger price = 15\n{if} food {is} fries price = 6" - 10: 3: - question_score: '10' + question_text: Which symbols should be filled in on the two blanks? + code: |- + guests = {ask} 'How many people are at the party?' + {if} guests _ 130 + {print} 'You can come in!' + {if} guests _ 130 + {print} 'Im sorry, the club is full. ' + {print} 'You have to wait for a guest to leave' mp_choice_options: - - feedback: Line 2 says {for} each animal in the list of animals. So each animal is {print}ed. - option: dogs are lovely pets - - option: dogs, cats, hamsters, chickens are lovely pets - feedback: Each animal gets their own line in the output. - - option: "dogs are lovely pets\ncats are lovely pets\nhamsters are lovely pets\nchickens are lovely pets" - feedback: Great! - - option: You don't know yet. Because it chooses one of the animals {at} {random}. - feedback: Line 2 says {for} each animal in the list of animals. So each animal is {print}ed. + - option: '`>` and `<`' + feedback: That's not it + - option: '`=` and `>=`' + feedback: That's not it + - option: '`<` and `>=`' + feedback: You are right + - option: '`+` and `==`' + hint: There are 130 people allowed in the club correct_answer: C - question_text: Which output is correct? - code: "animals = dogs, cats, hamsters, chickens\n{for} animal {in} animals\n {print} animal ' are lovely pets'" - hint: Line 2 says {for} each animal in the list of animals. So each animal is printed - 8: + question_score: '10' + feedback: That's not it + 4: + question_text: What's wrong with this code? + code: |- + price = 10 + money = {ask} How much money do you have? + buy = {ask} 'Would you like to buy this teddy bear?' + {if} money >= price {and} buy == 'yes' + {print} 'You can buy the bear!' + {else} + {print} 'You cannot buy this bear!' mp_choice_options: - - feedback: That's not it! - option: "```\n'name gets a color shirt'\n```" - - option: "```\nname 'gets a ' colors {at} {random} ' shirt'\n```" - feedback: Great job! This was a hard one! - - feedback: You want each name printed. So the first word should not be names but... - option: "```\nnames 'gets a ' color {at} {random} ' shirt'\n```" - - feedback: There is no variable named people.. - option: "```\npeople ' gets a colors shirt'\n```" - code: "names = Donna, Tommy, Ben\ncolors = blue, red, purple\n{for} name {in} names\n {print} _" - question_text: What should be on the _ in this code that decides which color shirt you get? + - option: In line 1 == should be used instead of = + feedback: No that's not it + - option: Line 2 misses quotation marks + feedback: You are correct + - option: In line 4 = should have been used instead of == + feedback: No that's not it + - option: In line 4 <= should have been used instead of >= + feedback: No that's not it + hint: The symbols are right correct_answer: B - hint: Mind the quotation marks and the names of the variables question_score: '10' 5: - question_score: '10' - question_text: What word should be on the _ with these digital dice? + question_text: Which symbol should be filled in on the blanks if the movie is suitable for kids for the age of 12 and up? + code: |- + age = {ask} 'How old are you?' + ticket = {ask} 'Do you have a ticket?' + {if} age _ {and} ticket == 'yes' + {print} 'You can enter the movie theater.' + {else} + {print} 'You are not allowed to come in!' + mp_choice_options: + - option: '`> 12`' + feedback: 12 year olds are allowed too + - option: '`>= 12`' + feedback: Great! + - option: '`< 12`' + feedback: These kids are too young! + - option: '`<= 12`' + feedback: These kids are too young + hint: '> means greater than' correct_answer: B - mp_choice_options: - - option: players - feedback: It would say 'Ann throws Jesse', instead of 'Ann throws 6'. - - feedback: That's right! - option: choices - - feedback: You are very close. But you need Hedy to pick from the list called 'choices' not 'choice'... - option: choice - - feedback: Look at the names of the variables. - option: dice - hint: Hedy needs to pick a number `{at} {random}` - code: "{print} 'Welcome to the digital dice!'\nplayers = Ann, John, Jesse\nchoices = 1, 2, 3, 4, 5, 6\n{for} player {in} players\n {print} player ' throws ' _ {at} {random}" + question_score: '10' + 6: + question_text: How many times do you have to say you are annoyed before this annoying game stops? + code: |- + lives = 2 + {repeat} 10 {times} + {if} lives != 0 + answer = {ask} 'Are you annoyed yet?' + {if} answer == 'yes' + lives = lives - 1 + mp_choice_options: + - option: 10 times + feedback: It stops after 2 times + - option: 0 times + feedback: It stops after 2 times + - option: 1 time + feedback: It stops after 2 times + - option: 2 times + feedback: That is correct + hint: '!= means ''is not''' + correct_answer: D + question_score: '10' 7: - mp_choice_options: - - feedback: You are on fire! - option: "```\n{for} name {in} names\n```" - - feedback: No it should be for each name in the list nameS, so the other way around - option: "```\n{for} names {in} name\n```" - - option: "```\n{for} food {in} food\n```" - feedback: Each name should be told what they will have for dinner. - - option: "```\n{for} name {in} food\n```" - feedback: Each name should be told what they will have for dinner. + question_text: What should be filled in on the three blanks? + code: |- + {print} 'Guess which number' + numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + number = numbers {at} {random} + game = 'on' + {for} i {in} {range} 1 {to} 10 + {if} game == 'on' + guess = {ask} 'Which number do you think it is?' + {if} guess < number + {print} _ + {if} guess > number + {print} _ + {if} guess == number + {print} _ + game = 'over' + mp_choice_options: + - option: '`''Lower''` and `''Higher''` and `''You win!''`' + feedback: That's not quite right. + - option: '`''Higher''` and `''Lower''` and `''You win!''`' + feedback: You win! + - option: '`''You win!''` and `''Lower!''` and `''Higher''`' + feedback: That's not quite right. + - option: '`''Lower!''` and `''You win!''` and `''Higher!''`' + feedback: That's not quite right. + hint: The last one should say you win. + correct_answer: B question_score: '10' - question_text: What line should be on the _ in this code that decides what these people will have for dinner? + 8: + question_text: Which statement is true about this roller coaster? + code: |- + length = {ask} 'Please fill in your length in cm' + {if} length < 120 + {print} 'Sorry, you cannot go on this roller coaster.' + {else} + {print} 'Enjoy the ride' + mp_choice_options: + - option: You must be taller than 120 cm to go on the roller coaster + feedback: True! + - option: You must be taller than 119 cm to go on the roller coaster + feedback: If you are 120 cm you won't get in + - option: You must be shorter than 120 cm to go on the roller coaster + feedback: '> means greater than' + - option: There are no length restrictions to go on the roller coaster + feedback: There are. + hint: '> means greater than' correct_answer: A - code: "names = Ron, Leslie, April, Andy\nfood = pasta, fries, salad\n_\n {print} name ' has to eat ' food {at} {random} ' for dinner'" - hint: Each name should be told what they will have for dinner. + question_score: '10' 9: - code: "courses = appetizer, main course, dessert\nnames = Timon, Onno\n{for} name {in} names\n {for} course {in} courses\n food = {ask} name ', what would you like to eat as your ' course '?'\n {print} name ' orders ' food ' as their ' course" + question_text: How many pieces of chocolate will give you a stomach ache according to this fitbit? + code: |- + chocolate = {ask} 'How many pieces of chocolate have you eaten?' + {if} chocolate <= 2 + {print} 'That is a healthy amount' + {if} chocolate > 2 {and} chocolate =< 8 + {print} 'That is a bit much' + {if} chocolate > 8 + {print} 'You will get a stomach ache!' mp_choice_options: - - option: Timon, what would you like to eat as your appetizer? - feedback: Perfect! - - option: Onno, what would you like to eat as your appetizer? - feedback: Timon is first on the list! - - feedback: Appetizers are first in the list - option: Timon, what would you like to eat as your dessert? - - option: You don't know that. Hedy will choose `{at} {random}`. - feedback: There is no `{at} {random}` in this code... + - option: 1 or more + feedback: 'No' + - option: 2 or more + feedback: 'No' + - option: 8 or more + feedback: Almost + - option: 9 or more + feedback: Great! + hint: '> 8 means more than 8' + correct_answer: D question_score: '10' - question_text: What is the first question Hedy will ask you when you run the program? - correct_answer: A - hint: The first options from both lists are chosen. - 2: + 10: + question_text: What should be filled in in the blanks? + code: |- + {print} 'Whoever gets the most points wins!' + {if} points_player_1 < points_player_2 + {print} _ mp_choice_options: - - feedback: Line 2 says `{for}` each meal in the list of meals. So each meal is printed. - option: I love pizza - - option: I love pasta - feedback: Line 2 says `{for}` each meal in the list of meals. So each meal is printed. - - option: I love pancakes - feedback: Line 2 says `{for}` each meal in the list of meals. So each meal is printed. - - feedback: Great! - option: "I love pizza\nI love pasta\nI love pancakes" - correct_answer: D - hint: Line 2 says for each meal in the list of meals. So each meal is printed. - code: "meals = pizza, pasta, pancakes\n{for} meal {in} meals\n {print} 'I love ' meal" + - option: '''player 1 wins''' + feedback: Look at who has the highest score! + - option: '''player 2 wins''' + feedback: Yes! + - option: '''player 2 loses''' + feedback: Look at who has the highest score! + - option: '''It is a tie''' + feedback: No it's not, one player has a higher score + hint: You win the game by having the most points + correct_answer: B question_score: '10' - question_text: Which output is correct? + 15: 1: + question_text: 'Which symbol should be used on the blank? Tip: You must keep guessing until you get it right.' + code: |- + answer = 0 + {while} answer _ 'Amsterdam' + answer = {ask} 'What is the capital city of the Netherlands?' + {print} 'You have given the correct answer' mp_choice_options: - - feedback: That's not it - option: "```\n{for} each compliment\n```" - - feedback: You deserve all those compliments! - option: "```\n{for} compliment {in} compliments\n```" - - feedback: That's not it - option: "```\n{if} compliment {in} compliments\n```" - - feedback: Almost there! - option: "```\n{for} compliments {in} compliment\n```" - question_text: What do we need to fill in on the `_` if we want to print each compliment? - hint: '`{for}` each compliment in the lists of compliments...' + - option: '`=!`' + feedback: That is not right. + - option: '`==`' + feedback: You don't have to keep guessing if you've given the right answer. + - option: '`!=`' + feedback: Correct + - option: '`=`' + feedback: That's not it + hint: Keep guessing until you say Amsterdam + correct_answer: C question_score: '10' - correct_answer: B - code: "compliments = perfect, great job, amazing\n_\n {print} compliment" - 10: + 2: + question_text: Which of these codes has used the correct symbol(s)? mp_choice_options: - - feedback: That is not true, you could end up without a prize. - option: Everybody will always win a prize. - - option: All the prizes always go to one single person. - feedback: That is not true. All the prizes are given away, but to random people - - feedback: That is not true. Larry has the same odds as the others - option: Larry will never win a prize - - feedback: You get it! - option: Someone might win two prizes - question_text: What is true about this code? - correct_answer: D - code: "prizes = 1 million dollars, car, sandwich\nnames = Bob, Patrick, Sandy, Larry\n{for} prize {in} prizes\n {print} 'The ' prize 'is won by ' names {at} {random}" - hint: Try to imagine the output of this code. + - option: |- + ``` + {while} name = Hedy + ``` + feedback: 'No' + - option: |- + ``` + {while} age = 24 + ``` + feedback: 'No' + - option: |- + ``` + {while} time > 0 + ``` + feedback: Yes! + - option: |- + ``` + {while} answer == yes' + ``` + feedback: A quotation mark is missing + hint: When you are comparing two answers you should use == + correct_answer: C question_score: '10' - 6: - question_text: Which of the answers below is a possible outcome when you run the code? + 3: + question_text: Which command should be filled in on the blank? + code: |- + _ age < 18 + {print} 'you are not allowed in this bar' mp_choice_options: - - option: Kelly chooses rock - feedback: Meredith wants to play too! - - option: "Meredith chooses scissors\nKelly chooses rock" - feedback: So close! But Kelly is first in the list, so she goes first - - feedback: Kelly wants to play too! - option: Meredith chooses paper - - option: "Kelly chooses paper\nMeredith chooses scissors" - feedback: Amazing! + - option: '`{in}`' + feedback: That's not it + - option: '`{while}`' + feedback: You are right + - option: '`{for}`' + feedback: That's not it + - option: '`{range}`' + feedback: That's not it + hint: You are not allowed in the bar as long as you are 17 or younger + correct_answer: B question_score: '10' - code: "choices = rock, paper, scissors\nplayers = Kelly, Meredith\n{for} player {in} players\n {print} player ' chooses ' choices {at} {random}" - correct_answer: D - hint: Each player will pick an option. The player that's first on the list will go first. 4: - mp_choice_options: - - option: Line 2 needs to start with 4 spaces as indentation - feedback: No it doesn't. Only line 3 needs indentation, which it has. - - feedback: Line 2 is a `{for}`command so line 3 does need to start with an indent. - option: Line 3 does not need to start with 4 spaces as indentation - - feedback: Good job! - option: Line 3 should say item instead of groceries - - feedback: No it does not. - option: Line 2 should say groceries instead of item - question_score: '10' - hint: Line 2 says `{for}` each item in the list of groceries question_text: What's wrong with this code? - correct_answer: C - code: "groceries = apples, bread, milk\n{for} item {in} groceries\n {print} 'We need ' groceries" - 4: - 2: + code: |- + options = 1, 2, 3, 4, 5, 6 + {print} 'Throw 6 as fast as you can!' + thrown = 0 + tries = 0 + {while} thrown == 6 + thrown = options {at} {random} + {print} 'You threw ' thrown + tries = tries + 1 + {print} 'Yes! You have thrown 6 in ' tries ' tries.' mp_choice_options: - - feedback: This quotation mark is skewed, you need a straight one. - option: "```\n{print} `hello`\n```" - - feedback: Correct - option: "```\n{print} 'hello'\n```" - - option: "```\n{print} hello\n```" - feedback: There are no quotation marks here! - - option: "```\n{print} ,hello,\n```" - feedback: This is a comma, you need quotation marks. - question_text: Which code uses the proper quotation marks? + - option: In line 1 == should be used instead of = + feedback: No that's not it + - option: Line 2 misses quotation marks + feedback: That's not right + - option: In line 5 {if} should have been used instead of {while} + feedback: That's not it + - option: In line 5 != should have been used instead of == + feedback: You are correct + hint: There is something wrong in line 5 + correct_answer: D question_score: '10' - correct_answer: B - hint: Pick the right quotation marks. 5: + question_text: What should be placed on the blank to make this program work correctly? + code: |- + wetness = 10 + {while} wetness != 0 + {print} 'Your hair is still wet, hair dryer on!' + {sleep} 1 + {clear} + wetness _ + + {print} 'All dry!' + mp_choice_options: + - option: = wetness + feedback: That will not change anything + - option: = wetness = 1 + feedback: You can't have two times = in one line + - option: = wetness - 1 + feedback: You are correct! + - option: = wetness + 1 + feedback: The program should count down + hint: wetness should get less each time correct_answer: C + question_score: '10' + 6: + question_text: What is wrong with this code? + code: |- + lives = 100 + {while} lives != 0 + answer = {ask} 'Are you annoyed yet?' + {if} answer == 'yes' + lives = lives - 1 mp_choice_options: - - feedback: Never put the quotation mark in front of the `{print}` command. - option: "```\n'{print} options {at} {random}'\n```" - - option: "```\n{print} 'options' {at} {random}\n```" - feedback: options is a variable. You don't literally want to print 'options {at} {random}'. - - option: "```\n{print} options {at} {random}\n```" - feedback: That's right - - option: Nothing, the game already works! - feedback: Look carefully. There is an error. - question_text: What has to be changed in order for the game to work? + - option: '{while} should be {if}' + feedback: No that is not right + - option: '{if} should be {while}' + feedback: No that is not right + - option: Line 3 should start with more indentation + feedback: No that's not right + - option: Line 2 should start with less indentation + feedback: That is correct + hint: Look closely at the indentation + correct_answer: D question_score: '10' - code: "options {is} rock, paper, scissors\n{print} 'options {at} {random}'" - hint: You don't want Hedy to literally print 'options {at} {random}', you want it to print 'rock' or 'paper' or 'scissors'. - 10: + 7: + question_text: How should this program be changed so that it works? + code: |- + {print} 'Guess which number' + numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + number = numbers {at} {random} + game = 'on' + {if} game == 'on' + guess = {ask} 'Which number do you think it is?' + {if} guess < number + {print} _ + {if} guess > number + {print} _ + {if} guess == number + {print} _ + game = 'over' mp_choice_options: - - feedback: A list doesn't need quotation marks - option: Quotation marks are missing in line 1 - - feedback: Correct - option: Quotation marks are missing in line 2 - - option: Quotation marks are missing in both line 2 and 3 - feedback: Line 3 doesn't need quotation marks because it's not printed literally - - feedback: You missed one! - option: Nothing, this code has no mistakes - question_text: Which statement is true? - code: "people {is} mom, dad, Emma, Sophie\n{print} The dishes are done by...\n{print} people {at} {random}" - correct_answer: B + - option: '... change the first {if} into a {while}' + feedback: Perfect! + - option: '... change the second {if} into a {while}' + feedback: That's not quite right. + - option: '... change the third {if} into a {while}' + feedback: That's not quite right. + - option: '... change the fourth {if} into a {while}' + feedback: That's not quite right. + hint: The last one should say you win. + correct_answer: A question_score: '10' - hint: One line needs quotation marks, because you want it to be printed literally. 8: + question_text: Which statement is true about this automated toilet system? + code: |- + {while} toilet == 'occupied' + lights = 'on' + air_freshener_sprays = 'yes' + {sleep} 60 + lights = 'off' + air_freshener_sprays = 'no' mp_choice_options: - - feedback: We need quotation marks - option: "```\n{print} So you pick door door\n```" - - feedback: If the player chooses door 3, Hedy will say 'So you pick 3 3' - option: "```\n{print} 'So you pick ' door door\n```" - - feedback: Super! - option: "```\n{print} 'So you pick door ' door\n```" - - feedback: Hedy will literally print 'So you pick door door' - option: "```\n{print} 'So you pick door door'\n```" - hint: The second word door should be replaced with the number, the first should still be the word door... + - option: The lights and air freshener will turn off after 1 minute + feedback: False! + - option: The air freshener sprays once every minute and the lights stay on the whole time while you are on the toilet + feedback: Great job + - option: The air freshener sprays once you leave the toilet. + feedback: It only sprays when you're in there. + - option: The lights will always stay on. + feedback: That wouldn't be right. + hint: The block after the {while} command keeps happening while the toilet is occupied. + correct_answer: B question_score: '10' + 9: + question_text: What will the diet app say if you have eaten 1600 calories today? + code: |- + calories = {ask} 'How many calories have you eaten today?' + {while} calories <= 1000 + {print} 'You could eat some more' + {while} calories > 1000 {and} calories =< 2000 + {print} 'That is alright' + {while} calories > 2000 + {print} 'You have had enough for today' + mp_choice_options: + - option: Nothing. 1600 is not programmed into the app. + feedback: 'No' + - option: you could eat some more + feedback: 'No' + - option: That is alright + feedback: Yes! + - option: You have eaten enough for today + feedback: 'No' + hint: 1600 is between 1000 and 2000 correct_answer: C - code: "{print} 'Welcome at the money show!'\n{print} 'In front of you are 3 doors'\ndoor {is} {ask} 'Which door do you choose?'" - question_text: What would be a good next line for this code? - 4: - mp_choice_options: - - option: "You need quotation marks around the word `{print}`, like this: `'{print}'`." - feedback: The quotation marks shouldn't be around the command itself. - - option: You need quotation marks around the words you want to print. - feedback: Super! - - feedback: Both `{print}` and `{ask}` require quotation marks - option: You do not need quotation marks when using the `{ask}` command - - feedback: Unfortunately, Hedy is stricter than that. - option: You can choose yourself whether to use quotation marks or not. - correct_answer: B - hint: From level 4 on you need to use quotation marks. - question_text: Which statement is true? question_score: '10' - 7: + 10: + question_text: 'What should be filled in in the blanks? Tip: the player with the most points is in the lead.' + code: |- + name_player_1 = {ask} 'Name player 1:' + name_player_2 = {ask} 'Name player 2:' + {while} points_player_1 > points_player_2 + {print} _ ' is in the lead right now!' mp_choice_options: - - feedback: Correct! - option: Quotation marks are missing in line 1 - - option: Quotation marks are missing in line 2 - feedback: A variable doesn't need quotes - - feedback: You don't want Hedy to literally print 'answers {at} {random}' so no quotation marks needed here! - option: Quotation marks are missing in line 3 - - option: Nothing, this code is good as is! - feedback: Look carefully. You missed a mistake! - question_text: What's wrong with this code? - code: "question {is} {ask} What do you want to know?\nanswers {is} yes, no, maybe\n{print} answers {at} {random}" - hint: Check each line on whether they'd need quotation marks or not. + - option: name_player_1 + feedback: You are right! + - option: name_player_2 + feedback: No they are losing! + - option: points_player_1 + feedback: You should fill in a name, not a number + - option: points_player_2 + feedback: You should fill in a name, not a number + hint: You win the game by having the most points. Your name should appear on the screen correct_answer: A question_score: '10' + 16: 1: + question_text: Which command should be filled in on the blanks to print a random snack? + code: |- + snacks = nachos, chips, cucumber, sweets + {print} _ mp_choice_options: - - feedback: That's right - option: "```\n{print} 'Im very excited to take this quiz!'\n```" - - option: "```\n{print} Im very excited to take this quiz!\n```" - feedback: '{print} now needs quotation marks!' - - option: "```\n{print} 'I'm very excited to take this quiz!'\n```" - feedback: do not use apostrophe or use backticks instead - - feedback: careful when using quotes and apostrophe - option: "```\n{print} 'I'm very excited to take this quiz!\n```" - hint: In level 4 you need quotation marks for 2 commands. + - option: '`snacks {at} {random}`' + feedback: This is the old way. + - option: '`[{random} snack]`' + feedback: The order is wrong. + - option: '`snacks[{random}]`' + feedback: Correct + - option: '`snacks[{at} {random}]`' + feedback: We do not need `at`anymore + hint: We no longer use {at} + correct_answer: C + question_score: '10' + 2: + question_text: What should be filled in on the blanks if you want a list of what chores are done by whom? + code: |- + friends = ['Wesley', 'Eric', 'Kaylee'] + chores = [the cooking, the cleaning, nothing] + {for} i {in} {range} 1 {to} 3 + {print} _ + mp_choice_options: + - option: |- + ``` + friends[i] has to do chores [i] + ``` + feedback: Mind the spacing. + - option: |- + ``` + friends[1] has to do chores[1] + ``` + feedback: It will print 3 times that Wesley has to do the cooking + - option: |- + ``` + chores[i] ' has to do ' friends[random] + ``` + feedback: The person has to do the chore, not the other way around + - option: |- + ``` + friends[i] ' has to do ' chores[i] + ``` + feedback: Fantastic! + hint: '`i` tells us what item in the list it is. So friend 1 does chore 1 etc.' + correct_answer: D question_score: '10' + 3: + question_text: What is a possible output for this program? + code: |- + friends = ['Wesley', 'Eric', 'Kaylee'] + chore = [the cooking, the cleaning, nothing] + {for} i {in} {range} 1 {to} 3 + {print} friends[i] has to do chores[i] + mp_choice_options: + - option: |- + ``` + Wesley has to do the cooking + Eric has to do the cleaning + Kaylee has to do nothing + ``` + feedback: Super! + - option: |- + ``` + Kaylee has to do the cooking + Wesley has to do the cleaning + Eric has to do nothing + ``` + feedback: No, it is not random. + - option: |- + ``` + Wesley has to do the cooking + Wesley has to do the cleaning + Wesley has to do the nothing + ``` + feedback: Poor Wesley! + - option: |- + ``` + Wesley has to do the cooking + Wesley has to do the cooking + Wesley has to do the cooking + ``` + feedback: That's not it + hint: It's not random... correct_answer: A - question_text: Which of these codes is correct? + question_score: '10' + 4: + question_text: What is wrong with this code? + code: |- + friends = ['Jaylee', 'Erin', 'Fay'] + lucky_numbers = [15, 18, 6] + {for} i {in} {range} 0 {to} 3 + print 'the lucky number of ' friends[i] + print 'is ' lucky_numbers[i] + mp_choice_options: + - option: The variable in line 4 should be 'friend[i]', not 'friends[i]' + feedback: That is not right. + - option: Line 3 should say 'in range 1 to 3' not 'in range 0 to 3' + feedback: Good catch! + - option: Line 4 should say 'lucky_number', not 'lucky number + feedback: It's not a variable, it's just text. + - option: '{in} in line 3 should be removed' + feedback: That's not it + hint: There's nothing wrong with line 4 + correct_answer: B + question_score: '10' + 5: + question_text: Which line should be filled in in the blank? + code: |- + animals = ['dog', 'cow', 'horse'] + _ + {for} i {in} {range} 1 {to} 3 + {print} 'the ' animals[i] ' says ' sounds[i] + mp_choice_options: + - option: noises = ['moo', 'woof', 'neigh'] + feedback: Mind the variable name and the order of the sounds. + - option: sounds = '[woof], [moo], [neigh]'. + feedback: Look at line one to see how brackets are supposed to be used. + - option: sounds = [woof, moo, neigh] + feedback: Don't forget the quotation marks! + - option: sounds = ['woof', 'moo', 'neigh'] + feedback: Great job! + hint: Look at line 1 to see proper use of brackets and quotation marks. + correct_answer: D + question_score: '10' 6: + question_text: Which statement is true? + code: |- + people = ['Chris', 'Jaylino', 'Ryan'] + games = ['fortnite', 'minecraft', 'fifa'] + {for} o {in} {range} 1 {to} 3 + {print} people[o] ' likes ' games[o] mp_choice_options: - - feedback: Great! You get it! - option: "```\n{print} 'You win...' prices {at} {random}\n```" - - option: "```\n{print} You win... 'prices {at} {random}'\n```" - feedback: Hedy will literally print 'prices {at} {random}' - - option: "```\n{print} You win... prices {at} {random}\n```" - feedback: You need some quotation marks! - - option: "```\n{print} 'You win... prices {at} {random}'\n```" - feedback: Hedy will literally print 'prices {at} {random}'' - question_text: What would be a good next line in this code? - code: prices {is} 1 dollar, 100 dollars, 1 million dollars - correct_answer: A + - option: You are not allowed to use the variable o. It should be named i. + feedback: i is the most commonly used variable name in this case, but it's not mandatory to use i. + - option: The output will say that Jaylino likes fortnite. + feedback: No, he likes minecraft. + - option: The output will say that Ryan likes fifa + feedback: Correct + - option: This code will not work. It will give and error. + feedback: No, the code is correct. + hint: There is nothing wrong with this code. + correct_answer: C question_score: '10' - hint: 'Think carefully: what is a variable and should be outside of the quotation marks? And what are normal words that should be inside?' - 3: + 7: + question_text: What's wrong with this code? + code: |- + people = ['Savi', 'Senna', 'Fayenne'] + transportation = ['bike', 'train', 'car'] + {for} i {in} {range} 1 {to} 3 + {print} people[i] goes to school by transportation[i] mp_choice_options: - - option: "```\n{print} Hi Im Hedy\n```" - feedback: Add quotation marks please! - - feedback: Both before and after the words you want to print should be a quotation mark. - option: "```\n{print} 'Hi Im Hedy\n```" - - feedback: The first quotation mark should be behind the word `{print}` - option: "```\n'{print} Hi Im Hedy'\n```" - - feedback: Perfect! - option: "```\n{print} 'Hi Im Hedy'\n```" + - option: Line 1 needs less quotation marks + feedback: That is not right. + - option: Line 3 should start with indentation + feedback: It should not! + - option: Line 4 should start without indentation + feedback: It should not + - option: Line 4 needs more quotation marks. + feedback: Amazing! + hint: There is a mistake made in the usage of quotation marks. correct_answer: D - question_text: Where are the quotation marks used correctly? - hint: Both before and after the words you want to print should be a quotation mark. + question_score: '10' + 8: + question_text: Which of these codes belongs to this output? + code: |- + Macy and Kate get to go first + Lionell and Raj get to go second + Kim and Leroy get to go third + mp_choice_options: + - option: |- + ``` + teams = ['Macy and Kate', 'Lionell and Raj', 'Kim and Leroy'] + position = ['first', 'second', 'third'] + {for} i {in} {range} 0 {to} 3 + {print} teams[random] ' get to go ' position[i] + ``` + feedback: This is not right + - option: |- + ``` + teams = ['Macy and Kate', 'Lionell and Raj', 'Kim and Leroy'] + position = ['first', 'second', 'third'] + {for} i {in} {range} 1 {to} 3 + {print} teams[i] ' get to go ' position[i] + ``` + feedback: Amazing! + - option: |- + ``` + teams = ['Macy', 'Kate', 'Lionell', 'Raj', 'Kim', 'Leroy'] + position = ['first', 'second', 'third'] + {for} i {in} {range} 1 {to} 6 + {print} teams[random] ' get to go ' position[random] + ``` + feedback: This is not it. + - option: |- + ``` + teams = ['Macy and Kate' 'Lionell and Raj' 'Kim and Leroy'] + position = ['first' 'second' 'third'] + {for} teams {in} {range} 0 {to} 3 + {print} teams[i] ' get to go ' position[i] + ``` + feedback: This is not going to work! + hint: If you look carefully at the first line, you'll see that only the first two answers are possibly correct. + correct_answer: B question_score: '10' 9: - code: "clubs {is} Real Madrid, Bayern Munchen, Manchester United, Ajax\n{print} clubs {at} {random} ' is going the win the champions league'" - hint: What are Hedy's options to randomly pick from? - mp_choice_options: - - feedback: Hedy could `{print}` that - option: Ajax is going to win the champions league - - feedback: Hedy could `{print}` that - option: Real Madrid is going to win the champions league - - option: Bayern Munchen is going to win the champions league - feedback: Hedy could `{print}` that - - feedback: That's right. It's not in the list - option: FC Barcelona is going to win the champions league - question_text: What will never appear in your output screen? + question_text: What is a possible output for this code? + code: |- + countries = ['Canada', 'Zimbabwe', 'New Zealand'] + {for} i {in} {range} 0 {to} 1 + {print} 'I will travel to ' countries[random] + mp_choice_options: + - option: |- + ``` + I will travel to Canada + I will travel to Canada + ``` + feedback: Great job! + - option: |- + ``` + I will travel to Canada + ``` + feedback: It will be repeated twice + - option: |- + ``` + I will travel to Canada, Zimbabwe and New Zealand + ``` + feedback: This is not it. + - option: |- + ``` + I will travel to Canada + I will travel to Zimbabwe + I will travel to New Zealand + ``` + feedback: It's only repeated twice + hint: Range 0 to 1 is 2 times + correct_answer: A question_score: '10' + 10: + question_text: Which 3 lines will complete this code correctly? + code: |- + {print} 'The book raffle will start soon' + {print} 'Get your tickets now!' + {books} = ['Narnia', 'The Hobbit', 'Oliver Twist', 'Harry Potter', 'Green eggs and ham'] + people = {ask} 'How many raffle tickets are sold?' + list_of_raffle_numbers = [1, 2] + {for} i {in} {range} 3 {to} people + {add} i {to} list_of_raffle_numbers + {for} i {in} {range} 1 {to} 5 + mp_choice_options: + - option: |- + ``` + chosen_number = list_of_numbers at random + print books[i] ' will go to person number ' chosen_number + {add} chosen_number {to} list_of_numbers + ``` + feedback: Almost there... but adding the winner to the list makes this raffle unfair + - option: |- + ``` + print person[i] ' wins ' book[i] + ``` + feedback: There is no list called 'person' + - option: |- + ``` + chosen_number = list_of_numbers[people] + print books[people] ' will go to person number ' chosen_number + {remove} chosen_number {from} list_of_numbers + ``` + feedback: This is not it. + - option: |- + ``` + chosen_number = list_of_numbers[random] + print books[i] ' will go to person number ' chosen_number + {remove} chosen_number {from} list_of_numbers + ``` + feedback: Fantastic! + hint: You need to use the {remove} command correct_answer: D + question_score: '10' diff --git a/content/quizzes/zh_Hans.yaml b/content/quizzes/zh_Hans.yaml index 64ec7adbadd..edfef746de1 100644 --- a/content/quizzes/zh_Hans.yaml +++ b/content/quizzes/zh_Hans.yaml @@ -2555,7 +2555,7 @@ levels: hi hi feedback: Correct - - option: "'hi'这个词会连续出现 25 次。" + - option: '''hi''这个词会连续出现 25 次。' feedback: 不,它只会出现 3 次。 hint: 它并没说 `{print}` i correct_answer: C @@ -2688,14 +2688,18 @@ levels: question_score: '10' 4: question_text: 哪些行需要引号才能使代码正常工作? - code: "{print} 欢迎来到网上鞋店\ncategory = {ask} 您要找什么类型的鞋子?\n{if} category =高跟鞋\n {print} 高跟鞋现在打5折!" + code: |- + {print} 欢迎来到网上鞋店 + category = {ask} 您要找什么类型的鞋子? + {if} category =高跟鞋 + {print} 高跟鞋现在打5折! mp_choice_options: - option: Line 1 and 2 - feedback: '不' + feedback: 不 - option: Line 1, 2 and 3 - feedback: '不' + feedback: 不 - option: Line 1, 2 and 4 - feedback: '不' + feedback: 不 - option: All of the lines feedback: 完美! hint: 第3行也需要引号吗? @@ -2703,7 +2707,18 @@ levels: question_score: '10' 5: question_text: 当 007 输入正确的密码时,他们会得到什么输出? - code: "name {is} {ask} '你叫什么名字?\n{if} name {is} 'Agent007'\n a {is} '去机场 '\n{else}\n a {is} '{print}{print}去火车站 '\n密码 {is} {ask} '密码是什么?'\n{if} 密码 {is} 'TOPSECRET'\n b {is} '明天 02:00'\n{别的}\n b {is} '今天 10 点'\n{print} a + b" + code: |- + name {is} {ask} '你叫什么名字? + {if} name {is} 'Agent007' + a {is} '去机场 ' + {else} + a {is} '{print}{print}去火车站 ' + 密码 {is} {ask} '密码是什么?' + {if} 密码 {is} 'TOPSECRET' + b {is} '明天 02:00' + {别的} + b {is} '今天 10 点' + {print} a + b mp_choice_options: - option: Go to the train station today at 10.00 feedback: The agent won't be catching any bad guys here diff --git a/content/slides/mi.yaml b/content/slides/mi.yaml index 753f0b63772..32500d53aac 100644 --- a/content/slides/mi.yaml +++ b/content/slides/mi.yaml @@ -1,464 +1,668 @@ levels: - 5: - 4: - editor: - header: else - text: "When using an `{if}` command, you can also add an `{else}` command.\nIf the answer is Hedy, the computer will print 'nice'.\nBut if the answer is something else the computer will print 'boo'" + 0: + 1: + header: Welcome to Hedy! + text: Hedy is a programming language. 2: - editor: - header: if - text: "The `{if}` command allows you to choose between two options.\nIn this example the computer will print 'nice' if the given answer is Hedy.\nIf the answer is not Hedy, the computer will do nothing." - 7: - text: Enjoy the adventures in level 5! - header: Let's go! + header: Programming + text: |- + Programming is giving instructions to a computer, using the language of the computer. + + Such a language is called a "programming language". 3: - editor: - text: When using the `{if}` command, don't forget to use the `{print}` command. - header: Don't forget to print + header: Programming Language + text: |- + Maybe you already know some programming languages? + Some examples are: + * Scratch + * Python + * HTML + 4: + header: Programming + text: |- + If you can program, you can do many cool things: + * Build interactive stories + * Create computer drawings and draw these on paper or fabric + * Build your own apps to use on your phone 5: - header: Long lines - text: "You might have noticed that your lines can get very long when you have both an `{if}` and an `{else}` command.\n\nYou can choose to seperate commands and put them on 2 lines, like this:" - editor: - 1: - header: Welcome to level 5 - text: 'In this level you will learn to use 3 new commands: `{if}`, `{else}` and `{in}`.' + header: Programming in Hedy + text: |- + In Hedy we use special codes, like `{print}`. + 6: - text: "If you have practised with the `{if}` and `{else}` commands, you can also try the `{in}` command.\n\nWith `{in}` you can let the computer check if an item is in a list, for example:\n\nPlease note that Hedy is case sensitive. This means that if you answer \"Green\" instead of \"green\", Hedy will print \"meh\"." - editor: - header: Another new command - 7: - 5: - header: Ready Set Go! - text: Enjoy the adventures in level 7! - 3: - text: When using the repeat command, do not forget the `{print}` command. - header: Don't forget the print command - editor: - 4: - text: You can also repeat an `{ask}`, `{if}` or `{else}` command multiple times. - editor: - header: Repeat an ask command - 2: - editor: - text: "If you want to repeat a line of code, you can use the `{repeat}` 3 `{times}` code.\nIf you want to repeat the line more times, simply change the number.\n\nFor example: If you are programming a story where your character shouts for help for 5 times, it could look like this:" - header: repeat 3 times - 1: - text: In this level you will learn how to repeat a line of code as many times a you'd like. - header: Welcome to level 7 - 13: + header: Programming in Hedy + text: |- + Code words will be shown in pink. + 7: - header: Even more questions! - text: "Now we have combined even more question with the function. Type this code and see what happens.\n\nNote how the variables and the arguments have the same name. This is allowed.\nDoes it confuse you? Just use different names, that is allowed as well.\n```\ndefine song with name, place\n print 'My ' name ' is ' place\n\nname is ask 'Who?'\nplace is ask 'Where are they?'\ncall song with name, place\n```" - editor: - 5: - text: "In this example you see how the argument 'place' is used in the function.\nRun the code and change 'ocean' and 'sea' to something else, and see what happens." - header: Example - editor: - 3: - editor: - text: "The `{or}` works in the same way as the `{and}` command, but only 1 of the two statements has to be true.\n\nLet's see what happens when you change the `{and}` for `{or}`." - header: The or command + header: Programming in Hedy + text: |- + We start the code with the Run code button underneath the code. + + 8: + header: Programming in Hedy + text: |- + Output appears on the right-hand side. + + 9: + header: Programming in Hedy + text: |- + The output can also be a drawing. + + 1: 1: - header: Welcome to level 13 - text: "We are now going to learn `{and}` and `{or}`! If you want to check two statements, you don't have to use two ifs but can use and and or.\nFrom now on you could also use arguments in your functions." + header: Welcome to level 1! + text: |- + We will start level 1 by making stories in Hedy! + + We need three text codes to create interactive stories. 2: - editor: - text: "The `{and}` command is always used in a combination with the {if} command.\nThis way you can check if 2 statements are true. For example:" - header: The and command - 6: - text: "Now you've ssen how arguments work, you could also combine function with a question.\n\nWhat happens if you make these changes:\n```\ndefine song with place\n print 'My Bonnie is ' place\n\nanswer is ask 'Where is my Bonnie?'\ncall song with answer\n```" - header: Example with variable - editor: + header: '{print}' + text: |- + The first code that you can use in level 1 is `{print}`. + + `{print}` is used to show text on the screen. + editor: + 3: + header: The {print} command + text: |- + You can change the text after the print command to whatever you want. + + Or you could print multiple lines by adding another line of code that also starts with `{print}`. + editor: 4: - header: Functions with arguments - text: Now that you've learned how to use functions, you'll learn how to use a function with an **argument**. An argument is a variable that is used within a function. It is not used outside the function. + header: '{ask}' + text: |- + The second code that you can use in level 1 is `{ask}`. + + `{ask}` is used to ask a question that can be answered. + editor: + 5: + header: '{echo}' + text: |- + As you could see in the previous example. If you use the `{ask}` command, you can ask a question. + + The answer, however doesn't show in the output screen. + + If you do want the answer to show, you can use the final command of this level: `{echo}`. + + `{echo}` is used to repeat the answer of an `{ask}`. + editor: + 6: + header: Programming! + text: |- + With `{print}`, `{ask}` and `{echo}` you can already create a little story. + This is a good time to try the Parrot, Story and Rock, Paper Scissors adventures. + 7: + header: Programming! + text: Adventures are shown in tabs. + editor: 8: - header: Let's go! - text: Enjoy the adventures in level 13! + header: Programming! + text: |- + The yellow arrow buttons can be used to copy examples. + + 9: + header: Drawing with the turtle + text: Now that we have seen at text codes, we will now look at drawing codes next. + 10: + header: 'Drawing with the turtle: {forward}' + text: '`{forward}` is used to move the turtle forward.' + editor: + 11: + header: 'Drawing with the turtle: {turn}' + text: '`{turn}` is used to make the turtle turn left or right.' + editor: 2: - 4: - text: Now that we use variables, we can use multiple variables instead of just one `{echo}`command. - editor: - header: Multiple variables + 1: + header: Welcome to level 2 + text: |- + In this level you will learn to use variables. + + A variable is a word that can be used to store informatie. + + For example: a name, age or favorite sports team. 2: + header: Variables text: To make or 'set' a variable we use the `{is}` command editor: - header: Variables - 7: - text: Enjoy the adventures in level 3! - header: Let the programming fun begin! + 3: + header: Interactive + text: |- + We can also set a variable by asking questions. + + The answer to the question is stored in the variable. + + This way we don't need the `{echo}` command. + editor: + 4: + header: Multiple variables + text: Now that we use variables, we can use multiple variables instead of just one `{echo}`command. + editor: 5: - text: You can also use the `{sleep}` command to pause the code for a while. header: Sleep + text: You can also use the `{sleep}` command to pause the code for a while. editor: 6: header: Sleep 5 - text: "You can add a number after the `{sleep}` command if you want the pause to be longer.\n\nIf you want, you could even use a variable instead of a number to decide the duration of the sleep command." + text: |- + You can add a number after the `{sleep}` command if you want the pause to be longer. + + If you want, you could even use a variable instead of a number to decide the duration of the sleep command. editor: - 3: - header: Interactive - editor: - text: "We can also set a variable by asking questions.\n\nThe answer to the question is stored in the variable.\n\nThis way we don't need the `{echo}` command." + 7: + header: Let the programming fun begin! + text: Enjoy the adventures in level 3! + 3: 1: - header: Welcome to level 2 - text: "In this level you will learn to use variables.\n\nA variable is a word that can be used to store informatie.\n\nFor example: a name, age or favorite sports team." + header: Welcome to level 3 + text: In this level you'll learn how to make a list, add and remove items form your lists and pick a random item off that list. + 2: + header: Making a list + text: |- + You make a list with `{is}`. + + Seperate the items on your list with a comma. + editor: + 3: + header: At random + text: |- + You can use the list with the `{at}` `{random}` command. + The computer will randomly pick one item of the list. + Every time you run this code the output will differ. + editor: + 4: + header: At random in a sentence + text: You can use the `{at}` `{random}` command in a sentence as well. + editor: + 5: + header: Add to + text: |- + You can add items to a list with the `{add}` `{to}` command. + + You can choose what to add to the list or you can use the `{add}` `{to}` command in combination with the `{ask}` command. + This way you can let the player decide what to add to the list. + editor: + 6: + header: Remove from + text: |- + The opposite of the `{add}` `{to}` command is the `{remove}` `{from}` command. + This command removes an item from a list. + editor: + 9: + header: Let's get to work! + text: Enjoy the adventures in level 3! 4: + 1: + header: Welcome to level 4 + text: In this level you will learn how to use quotation marks. + editor: 2: - text: 'In the previous levels, you might have come across this problem:' header: Problem + text: 'In the previous levels, you might have come across this problem:' editor: 3: - text: "In this level we will fix this problem by using quotation marks.\n\nThis also makes our code look more like 'real' Python code." header: Fixing it with quotation marks - 10: - header: Ready, Set, Go! - text: Enjoy the adventures in level 4! - 6: - editor: - text: "You do not want variable names to be printed on the screen.\nThis is why variables should be left out of the quotation marks, like this:" - header: Quotation marks and variables + text: |- + In this level we will fix this problem by using quotation marks. + + This also makes our code look more like 'real' Python code. 4: - editor: - text: Each time you use the `{print}` command you need to put the text that you want to appear on the screen in quotation marks. header: Quotation marks with print - 1: + text: Each time you use the `{print}` command you need to put the text that you want to appear on the screen in quotation marks. editor: - header: Welcome to level 4 - text: In this level you will learn how to use quotation marks. 5: header: Quotation marks with ask - editor: text: This also goes for the `{ask}` command. - 9: - header: Clear - text: "In this level you'll also learn the {clear} command.\nWith this command you can wipe all the text from your output screen.\n\nBe careful that you always use a sleep command too. If you don't the computer will wipe all the text before you can read it!" - editor: + editor: + 6: + header: Quotation marks and variables + text: |- + You do not want variable names to be printed on the screen. + This is why variables should be left out of the quotation marks, like this: + editor: 7: header: Quotation marks and variables - text: "When variable names are used in the middle of a sentence, you have to leave the variables out of the quotation marks.\nThe rest of the sentence however, does need quotation marks. That looks like this:" + text: |- + When variable names are used in the middle of a sentence, you have to leave the variables out of the quotation marks. + The rest of the sentence however, does need quotation marks. That looks like this: editor: 8: header: Quotation marks and contractions - text: "Be careful! Now that you are using quotation marks, you can't use apostrophes in contractions.\n\nPlease try to print a contraction like \"you're\" or \"I'm\" in the screen below and see what happens...." + text: |- + Be careful! Now that you are using quotation marks, you can't use apostrophes in contractions. + + Please try to print a contraction like "you're" or "I'm" in the screen below and see what happens.... editor: - 1: - 3: - header: The {print} command - editor: - text: "You can change the text after the print command to whatever you want.\n\nOr you could print multiple lines by adding another line of code that also starts with `{print}`." - 2: - editor: - text: "The first code that you can use in level 1 is `{print}`.\n\n`{print}` is used to show text on the screen." - header: '{print}' - 11: - text: '`{turn}` is used to make the turtle turn left or right.' - header: 'Drawing with the turtle: {turn}' - editor: - 1: - header: Welcome to level 1! - text: "We will start level 1 by making stories in Hedy!\n\nWe need three text codes to create interactive stories." - 8: - header: Programming! - text: "The yellow arrow buttons can be used to copy examples.\n" - 7: - editor: - header: Programming! - text: Adventures are shown in tabs. - 5: - text: "As you could see in the previous example. If you use the `{ask}` command, you can ask a question.\n\nThe answer, however doesn't show in the output screen.\n\nIf you do want the answer to show, you can use the final command of this level: `{echo}`.\n\n`{echo}` is used to repeat the answer of an `{ask}`." - editor: - header: '{echo}' - 10: - editor: - text: '`{forward}` is used to move the turtle forward.' - header: 'Drawing with the turtle: {forward}' - 9: - header: Drawing with the turtle - text: Now that we have seen at text codes, we will now look at drawing codes next. - 4: - editor: - header: '{ask}' - text: "The second code that you can use in level 1 is `{ask}`.\n\n`{ask}` is used to ask a question that can be answered." - 6: - text: "With `{print}`, `{ask}` and `{echo}` you can already create a little story.\nThis is a good time to try the Parrot, Story and Rock, Paper Scissors adventures." - header: Programming! - 8: - 7: - text: Just like with the `{repeat}` command, you can stop using indentation and the lines will always be shown. Not just if the statement is true. - header: stopping the indentation - editor: - 3: - editor: - text: "In this level you can repeat multiple lines of code. To do this you must tell the computer which lines belong together and should be repeated.\nYou do this by using indentation.\n\nUse 4 spaces (or one tab) at the beginning of each line that you want to repeat, like this:" - header: '{repeat} commands now' - 6: - editor: - header: if and else now - text: "These are the `{if}` and `{else}` commands now.\nEach line after the `{if}` and `{else}` commands start with indentation." - 5: - editor: - text: "The same goes for the `{if}` and `{else}` commands.\nThese were the commands before:" - header: if and else before - 8: - text: "You might have thought of trying to put an if command inside a repeat command, or inside another if command.\nFor now, this is not possible yet. In the higher levels, it will be allowed, but for now let's focus on practising the `{if}` `{else}` and `{repeat}` commands with proper indentation first." - header: if statements inside if statements - 1: - header: Welcome to level 8 - text: In this level you will learn to use indentation to make the `{repeat}`, `{if}` and `{else}` commands work for multiple lines of code. - 2: - header: '{repeat} commands before' - text: "In the previous levels, the `{repeat}` command looked like this:\n\nYou could only repeat one line of code." - editor: 9: - header: Let's check out the adventures! - text: Enjoy the adventures in level 8! - 4: - header: '{repeat} commands now' - text: "If you want to, you can continue after the `{repeat}` command without indentation.\nThe lines that do not start with indentation will not be repeated." - editor: - 15: - 3: - text: Enjoy the adventures in level 15! - header: Let's try it out! - 2: - header: '{while}' - text: "We are going to learn a new loop, the while loop! The loop continues as long as the statement is true. So don't forget to change the value in the loop.\n\nIn the example code, we continue until a correct answer has been given. If the correct answer is never given, the loop will never end!" - editor: - 1: - text: In this level you will learn about the `{while}` loop. - header: Welcome to level 15 - 12: - 5: - header: Twinkle Twinkle little star! - editor: - text: "In this program you see an example of a function.\nLet's see what happens if you fill in the rest of the song!" - 3: - text: "From this level on you are also allowed to use decimal numbers. This can make programs like your restaurant even better!\n\nNumbers do not quotation marks." - editor: - header: Decimal numbers - 4: - text: "In this level you'll learn how to use functions. A function is a block of code you can easily use multiple times. Using functions helps us organize pieces of code that we can use again and again. To create a function, use define and give the function a name. Then put all the lines you want in the function in a indented block under the define line. Leave one empty line in your code to make it look nice and neat. Great job! You have created a function!\n\nNow, whenever we need that block of code, we just use call with the function's name to call it up! We don't have to type that block of code again." - header: Functions! - 2: - editor: - text: "This level makes some changes to the usage of quotation marks.\nFrom now on, **all texts** need to be in quotation marks. This includes values of variables, items on lists and text after {if} commands." - header: Quotation marks - 7: - text: Enjoy the adventures in level 12! - header: Ready to try it out? - 6: - text: As you could see in the example a function is a block of code that can be called anytime. You use `{define}` to set the function and `{call}` to use it. - header: Functions - 1: - header: Welcome to level 12 - text: "From this level on you are allowed to use decimal numbers and there are some changes to the quotation marks.\nYou can also use functions from this level on!" - 17: - 4: - text: Enjoy the adventures in level 17! - header: Let's try it out! + header: Clear + text: |- + In this level you'll also learn the {clear} command. + With this command you can wipe all the text from your output screen. + + Be careful that you always use a sleep command too. If you don't the computer will wipe all the text before you can read it! + editor: + 10: + header: Ready, Set, Go! + text: Enjoy the adventures in level 4! + 5: 1: - header: Welcome to level 17 - text: in this level you will learn how to use a colon and you will learn the elif command. + header: Welcome to level 5 + text: 'In this level you will learn to use 3 new commands: `{if}`, `{else}` and `{in}`.' 2: - editor: - header: Colon - text: 'Now we are going to change indentation a little bit. Every time that we need an indentation, we need : at the line before the indentation.' + header: if + text: |- + The `{if}` command allows you to choose between two options. + In this example the computer will print 'nice' if the given answer is Hedy. + If the answer is not Hedy, the computer will do nothing. + editor: 3: - editor: - header: Elif - text: 'In this level you can also use a new command: elif. elif is short for else if and you need it when you want to make 3 (or more!) options. Check it out!' - 14: - 2: - text: "These are the new symbols you can use:\n\n The > means bigger than...\n\n The >= means bigger than or the same as...\n\n The < means smaller than...\n\n The <= means smaller than or the same as...\n\nYou can use them like this:" - editor: - header: Symbols + header: Don't forget to print + text: When using the `{if}` command, don't forget to use the `{print}` command. + editor: 4: - header: Return value - text: In the previous levels you have learned to create functions and use arguments with them. Another great use of a function is to let it calculate something for you. You can give the function a calculation and it will give you the answer of the calculation. This answer is called a **return value**. + header: else + text: |- + When using an `{if}` command, you can also add an `{else}` command. + If the answer is Hedy, the computer will print 'nice'. + But if the answer is something else the computer will print 'boo' + editor: 5: - header: Return value - text: For example, in this code the function calculate_new_price will calculate the new price of any item. It will give you the new price as a return value. - editor: - 1: - text: In this level you'll learn some new symbols that can help you improve your programs, like >. You will also learn to work with return values of a function. - header: Welcome to level 14 - 3: - editor: - text: "You can also use:\n\n== is the same as.\n\n!= is not\n\n== is used in `{if}` statements." - header: Symbols + header: Long lines + text: |- + You might have noticed that your lines can get very long when you have both an `{if}` and an `{else}` command. + + You can choose to seperate commands and put them on 2 lines, like this: + editor: 6: - text: Enjoy the adventures in level 14! - header: Let's get to work! - 0: - 9: - text: "The output can also be a drawing.\n" - header: Programming in Hedy - 4: - text: "If you can program, you can do many cool things:\n* Build interactive stories\n* Create computer drawings and draw these on paper or fabric\n* Build your own apps to use on your phone" - header: Programming + header: Another new command + text: |- + If you have practised with the `{if}` and `{else}` commands, you can also try the `{in}` command. + + With `{in}` you can let the computer check if an item is in a list, for example: + + Please note that Hedy is case sensitive. This means that if you answer "Green" instead of "green", Hedy will print "meh". + editor: 7: - header: Programming in Hedy - text: "We start the code with the Run code button underneath the code.\n" - 6: - header: Programming in Hedy - text: "Code words will be shown in pink.\n" - 8: - header: Programming in Hedy - text: "Output appears on the right-hand side.\n" - 3: - header: Programming Language - text: "Maybe you already know some programming languages?\nSome examples are:\n* Scratch\n* Python\n* HTML" - 5: - header: Programming in Hedy - text: "In Hedy we use special codes, like `{print}`.\n" - 2: - header: Programming - text: "Programming is giving instructions to a computer, using the language of the computer.\n\nSuch a language is called a \"programming language\"." + header: Let's go! + text: Enjoy the adventures in level 5! + 6: 1: - header: Welcome to Hedy! - text: Hedy is a programming language. - 10: - 4: - header: Time to program! - text: Enjoy the adventures in level 10! + header: Welcome to level 6 + text: In this level we are adding maths to our codes. 2: - header: The for command - editor: - text: With for you can make a list and use all items on that list. `{for}` creates a block, like repeat and if so all lines in the block need to start with indentation (4 spaces). - 3: - editor: - header: The for command - text: 'Here you see another example of the `{for}` command:' - 1: - header: Welcome to level 10 - text: 'In this level you will learn a new command: `{for}`.' - 6: - 8: - text: 'You can use calculations with numbers, but you can also use variables to do calculations, like this:' - header: Calculations with variables - editor: - 6: - header: Summary + header: Addition + text: If you want to calculate an addition, simply use the plus sign. + editor: + 3: + header: Subtraction + text: If you want to subtract, you can use the minus sign. editor: - text: In summary, you can use +, -, * and / to do maths. 4: header: Multiplication - editor: text: If you want to do multiplications, you can use the asterisk. + editor: 5: header: Division - editor: text: You can use the slash for division. + editor: + 6: + header: Summary + text: In summary, you can use +, -, * and / to do maths. + editor: 7: header: The = symbol + text: |- + From now on you can also use the = symbol instead of the `{is}` command. + This goes for both numbers and words, and it also goes after the `{if}` or `{else}` commands. editor: - text: "From now on you can also use the = symbol instead of the `{is}` command.\nThis goes for both numbers and words, and it also goes after the `{if}` or `{else}` commands." - 1: - header: Welcome to level 6 - text: In this level we are adding maths to our codes. - 3: - editor: - text: If you want to subtract, you can use the minus sign. - header: Subtraction - 2: - editor: - header: Addition - text: If you want to calculate an addition, simply use the plus sign. + 8: + header: Calculations with variables + text: 'You can use calculations with numbers, but you can also use variables to do calculations, like this:' + editor: 9: - text: Enjoy the adventures in level 6! header: Let's get to work! - 18: + text: Enjoy the adventures in level 6! + 7: 1: - text: Congratulations! You have reached the last level of Hedy! The code you have created here can be copied to real Python environments like replit or PyCharm, and you can continue learning there! Note however that Python can only read English commands, so if you have been using other languages, you will need to switch to English now. - header: Welcome to level 18 + header: Welcome to level 7 + text: In this level you will learn how to repeat a line of code as many times a you'd like. 2: - editor: - text: "We arrived at real Python code! That means we need to use parentheses with print and range from now on.\n\nAlso, if you want to print more than one item, you need to separate them by commas.\n\nThe final change we will need to make to get Python code is changing ask into input.\n\nClick on the 'print' tab for all the examples." - header: The Python way + header: repeat 3 times + text: |- + If you want to repeat a line of code, you can use the `{repeat}` 3 `{times}` code. + If you want to repeat the line more times, simply change the number. + + For example: If you are programming a story where your character shouts for help for 5 times, it could look like this: + editor: 3: - header: The very last adventures! - text: Enjoy the very last adventures in level 18! - 9: + header: Don't forget the print command + text: When using the repeat command, do not forget the `{print}` command. + editor: + 4: + header: Repeat an ask command + text: You can also repeat an `{ask}`, `{if}` or `{else}` command multiple times. + editor: + 5: + header: Ready Set Go! + text: Enjoy the adventures in level 7! + 8: + 1: + header: Welcome to level 8 + text: In this level you will learn to use indentation to make the `{repeat}`, `{if}` and `{else}` commands work for multiple lines of code. + 2: + header: '{repeat} commands before' + text: |- + In the previous levels, the `{repeat}` command looked like this: + + You could only repeat one line of code. + editor: + 3: + header: '{repeat} commands now' + text: |- + In this level you can repeat multiple lines of code. To do this you must tell the computer which lines belong together and should be repeated. + You do this by using indentation. + + Use 4 spaces (or one tab) at the beginning of each line that you want to repeat, like this: + editor: + 4: + header: '{repeat} commands now' + text: |- + If you want to, you can continue after the `{repeat}` command without indentation. + The lines that do not start with indentation will not be repeated. + editor: + 5: + header: if and else before + text: |- + The same goes for the `{if}` and `{else}` commands. + These were the commands before: + editor: + 6: + header: if and else now + text: |- + These are the `{if}` and `{else}` commands now. + Each line after the `{if}` and `{else}` commands start with indentation. + editor: 7: - text: Mind that the fourth and sixth line of this code starts with 8 spaces of indentation. - editor: - header: Mind the indentation + header: stopping the indentation + text: Just like with the `{repeat}` command, you can stop using indentation and the lines will always be shown. Not just if the statement is true. + editor: 8: - text: Enjoy the adventures in level 9! - header: Let's go! + header: if statements inside if statements + text: |- + You might have thought of trying to put an if command inside a repeat command, or inside another if command. + For now, this is not possible yet. In the higher levels, it will be allowed, but for now let's focus on practising the `{if}` `{else}` and `{repeat}` commands with proper indentation first. + 9: + header: Let's check out the adventures! + text: Enjoy the adventures in level 8! + 9: + 1: + header: Welcome to level 9 + text: |- + In this level you can use multiple lines of code after an `{if}` or after a `{repeat}` command. + + You can even put a `{repeat}` command within another `{repeat}` command. + 2: + header: Multiple lines after `{repeat}` + text: You are allowed to use multiple lines after `{repeat}`. + editor: 3: header: Indentation matters! text: Indentation is very important to tell the computer which lines should be repeated and which lines should only be ran once. editor: - 5: + 4: + header: Multipe lines after `{if}` + text: You can also use multiple lines after `{if}` editor: + 5: header: Indentation matters text: Again, indentation is still very important and can make a big difference in the code. - 2: - text: You are allowed to use multiple lines after `{repeat}`. - header: Multiple lines after `{repeat}` - editor: - 1: - header: Welcome to level 9 - text: "In this level you can use multiple lines of code after an `{if}` or after a `{repeat}` command.\n\nYou can even put a `{repeat}` command within another `{repeat}` command." - 4: - text: You can also use multiple lines after `{if}` editor: - header: Multipe lines after `{if}` 6: - text: "Now that you can use multiple lines of code after these command, you can also put them within each other.\nCheck it out:" header: An `{if}` inside a `{repeat}` + text: |- + Now that you can use multiple lines of code after these command, you can also put them within each other. + Check it out: + editor: + 7: + header: Mind the indentation + text: Mind that the fourth and sixth line of this code starts with 8 spaces of indentation. editor: + 8: + header: Let's go! + text: Enjoy the adventures in level 9! + 10: + 1: + header: Welcome to level 10 + text: 'In this level you will learn a new command: `{for}`.' + 2: + header: The for command + text: With for you can make a list and use all items on that list. `{for}` creates a block, like repeat and if so all lines in the block need to start with indentation (4 spaces). + editor: + 3: + header: The for command + text: 'Here you see another example of the `{for}` command:' + editor: + 4: + header: Time to program! + text: Enjoy the adventures in level 10! 11: 1: - text: "In this level, we add a new form of the `{for}` command. In earlier levels, we used for with a list, but we can also use for with numbers.\n\nThis way we don't need the `{repeat}` command anymore." header: Welcome to level 11 + text: |- + In this level, we add a new form of the `{for}` command. In earlier levels, we used for with a list, but we can also use for with numbers. + + This way we don't need the `{repeat}` command anymore. 2: header: The for command - editor: text: 'This is what the new for command looks like:' + editor: + 3: + header: the variable i + text: |- + In the previous slide the variable was named 'counter', because it was counting down. + You can of course use any name for the variable you want. + The standard name for variables in this situation that is used in programming languages like Python is 'i'. + That looks like this: + editor: 4: header: Let's start programming! text: Enjoy the adventures in level 11! + 12: + 1: + header: Welcome to level 12 + text: |- + From this level on you are allowed to use decimal numbers and there are some changes to the quotation marks. + You can also use functions from this level on! + 2: + header: Quotation marks + text: |- + This level makes some changes to the usage of quotation marks. + From now on, **all texts** need to be in quotation marks. This includes values of variables, items on lists and text after {if} commands. + editor: 3: - header: the variable i - editor: - text: "In the previous slide the variable was named 'counter', because it was counting down.\nYou can of course use any name for the variable you want.\nThe standard name for variables in this situation that is used in programming languages like Python is 'i'.\nThat looks like this:" - 16: + header: Decimal numbers + text: |- + From this level on you are also allowed to use decimal numbers. This can make programs like your restaurant even better! + + Numbers do not quotation marks. + editor: + 4: + header: Functions! + text: |- + In this level you'll learn how to use functions. A function is a block of code you can easily use multiple times. Using functions helps us organize pieces of code that we can use again and again. To create a function, use define and give the function a name. Then put all the lines you want in the function in a indented block under the define line. Leave one empty line in your code to make it look nice and neat. Great job! You have created a function! + + Now, whenever we need that block of code, we just use call with the function's name to call it up! We don't have to type that block of code again. + 5: + header: Twinkle Twinkle little star! + text: |- + In this program you see an example of a function. + Let's see what happens if you fill in the rest of the song! + editor: + 6: + header: Functions + text: As you could see in the example a function is a block of code that can be called anytime. You use `{define}` to set the function and `{call}` to use it. + 7: + header: Ready to try it out? + text: Enjoy the adventures in level 12! + 13: 1: - text: In this level you will learn about the [square brackets] and how to use them. - header: Welcome to level 16 + header: Welcome to level 13 + text: |- + We are now going to learn `{and}` and `{or}`! If you want to check two statements, you don't have to use two ifs but can use and and or. + From now on you could also use arguments in your functions. + 2: + header: The and command + text: |- + The `{and}` command is always used in a combination with the {if} command. + This way you can check if 2 statements are true. For example: + editor: + 3: + header: The or command + text: |- + The `{or}` works in the same way as the `{and}` command, but only 1 of the two statements has to be true. + + Let's see what happens when you change the `{and}` for `{or}`. + editor: + 4: + header: Functions with arguments + text: Now that you've learned how to use functions, you'll learn how to use a function with an **argument**. An argument is a variable that is used within a function. It is not used outside the function. + 5: + header: Example + text: |- + In this example you see how the argument 'place' is used in the function. + Run the code and change 'ocean' and 'sea' to something else, and see what happens. + editor: + 6: + header: Example with variable + text: |- + Now you've ssen how arguments work, you could also combine function with a question. + + What happens if you make these changes: + ``` + define song with place + print 'My Bonnie is ' place + + answer is ask 'Where is my Bonnie?' + call song with answer + ``` + editor: + 7: + header: Even more questions! + text: |- + Now we have combined even more question with the function. Type this code and see what happens. + + Note how the variables and the arguments have the same name. This is allowed. + Does it confuse you? Just use different names, that is allowed as well. + ``` + define song with name, place + print 'My ' name ' is ' place + + name is ask 'Who?' + place is ask 'Where are they?' + call song with name, place + ``` + editor: + 8: + header: Let's go! + text: Enjoy the adventures in level 13! + 14: + 1: + header: Welcome to level 14 + text: In this level you'll learn some new symbols that can help you improve your programs, like >. You will also learn to work with return values of a function. + 2: + header: Symbols + text: |- + These are the new symbols you can use: + + The > means bigger than... + + The >= means bigger than or the same as... + + The < means smaller than... + + The <= means smaller than or the same as... + + You can use them like this: + editor: + 3: + header: Symbols + text: |- + You can also use: + + == is the same as. + + != is not + + == is used in `{if}` statements. + editor: + 4: + header: Return value + text: In the previous levels you have learned to create functions and use arguments with them. Another great use of a function is to let it calculate something for you. You can give the function a calculation and it will give you the answer of the calculation. This answer is called a **return + value**. + 5: + header: Return value + text: For example, in this code the function calculate_new_price will calculate the new price of any item. It will give you the new price as a return value. + editor: + 6: + header: Let's get to work! + text: Enjoy the adventures in level 14! + 15: + 1: + header: Welcome to level 15 + text: In this level you will learn about the `{while}` loop. + 2: + header: '{while}' + text: |- + We are going to learn a new loop, the while loop! The loop continues as long as the statement is true. So don't forget to change the value in the loop. + + In the example code, we continue until a correct answer has been given. If the correct answer is never given, the loop will never end! + editor: 3: header: Let's try it out! - text: Enjoy the adventures in level 16! + text: Enjoy the adventures in level 15! + 16: + 1: + header: Welcome to level 16 + text: In this level you will learn about the [square brackets] and how to use them. 2: header: Square brackets - editor: text: We are going to make lists the Python way, with square brackets around the lists! We also keep the quotation marks around each item like we have learned in previous levels. We use square brackets to point out a place in a list. The at random command can not be used anymore. - 3: + editor: + 3: + header: Let's try it out! + text: Enjoy the adventures in level 16! + 17: + 1: + header: Welcome to level 17 + text: in this level you will learn how to use a colon and you will learn the elif command. 2: - editor: - header: Making a list - text: "You make a list with `{is}`.\n\nSeperate the items on your list with a comma." - 6: - editor: - text: "The opposite of the `{add}` `{to}` command is the `{remove}` `{from}` command.\nThis command removes an item from a list." - header: Remove from + header: Colon + text: 'Now we are going to change indentation a little bit. Every time that we need an indentation, we need : at the line before the indentation.' + editor: 3: - header: At random - text: "You can use the list with the `{at}` `{random}` command.\nThe computer will randomly pick one item of the list.\nEvery time you run this code the output will differ." - editor: + header: Elif + text: 'In this level you can also use a new command: elif. elif is short for else if and you need it when you want to make 3 (or more!) options. Check it out!' + editor: 4: - header: At random in a sentence - text: You can use the `{at}` `{random}` command in a sentence as well. - editor: - 5: - header: Add to - editor: - text: "You can add items to a list with the `{add}` `{to}` command.\n\nYou can choose what to add to the list or you can use the `{add}` `{to}` command in combination with the `{ask}` command.\nThis way you can let the player decide what to add to the list." + header: Let's try it out! + text: Enjoy the adventures in level 17! + 18: 1: - header: Welcome to level 3 - text: In this level you'll learn how to make a list, add and remove items form your lists and pick a random item off that list. - 9: - text: Enjoy the adventures in level 3! - header: Let's get to work! + header: Welcome to level 18 + text: Congratulations! You have reached the last level of Hedy! The code you have created here can be copied to real Python environments like replit or PyCharm, and you can continue learning there! Note however that Python can only read English commands, so if you have been using other languages, + you will need to switch to English now. + 2: + header: The Python way + text: |- + We arrived at real Python code! That means we need to use parentheses with print and range from now on. + + Also, if you want to print more than one item, you need to separate them by commas. + + The final change we will need to make to get Python code is changing ask into input. + + Click on the 'print' tab for all the examples. + editor: + 3: + header: The very last adventures! + text: Enjoy the very last adventures in level 18! diff --git a/content/tutorials/mi.yaml b/content/tutorials/mi.yaml index 4e5d49e6b38..055e69a736d 100644 --- a/content/tutorials/mi.yaml +++ b/content/tutorials/mi.yaml @@ -1,70 +1,70 @@ -teacher: +intro: steps: 1: - text: In this tutorial we will explain all the Hedy features step-by-step. title: Welcome to Hedy! - 6: - title: Hedy documentation - text: Here you find a more extensive documentation with tips and tricks on how to use Hedy in the classroom. + text: In this tutorial we will explain all the Hedy features step-by-step. 2: - text: As a teacher you can created classes and invite student or let them join through a link. You can view the programs and statistics of all your students. - title: Class management - 3: - text: You can customize classes by hiding specific levels and/or adventures as well as making them available on a specific date. - title: Customize classes - 4: - text: You can create your own adventures and use them as assignments for your students. Create them here and add them to your classes in the class customization section. - title: Creating adventures - 7: - title: The end! - text: Click on 'next step' to get started as a Hedy teacher! - 5: - title: Creating accounts - text: You can create multiple accounts at once, only needing to provide an username and password. You can also directly add these accounts to one of your classes. -intro: - steps: - 11: - title: Puzzles - text: Do you think you understand the level quite well? Try the puzzles! You get lines of code in the wrong order, fix the order to get the program running. + title: The code editor + text: In this window you write all the code, try typing something on the place of the underscores! 3: title: The output window text: The result of the code you execute will be shown here, you just created this! - 13: - title: Saving & sharing - text: You can save and share all your created programs with other Hedy users. - 10: - text: The other tabs contain adventures, which you can code for each level. They go from easy to hard. - title: Adventures + 4: + title: The run button + text: With this button you can run your program! Shall we give it a try in the next step? + 5: + title: Try it out! + text: Run the program, click 'next step' when you're done. 6: - text: Choose a voice below the run button to let your program be read aloud. title: Read aloud your program + text: Choose a voice below the run button to let your program be read aloud. 7: - text: Select a voice from the dropdown menu and run your program again to hear it being read aloud. title: Run & listen + text: Select a voice from the dropdown menu and run your program again to hear it being read aloud. + 8: + title: To the next level + text: When you think you understand everything and have practiced enough you can continue with the next level. When there is also a previous level there will be a button next to it to go back. 9: title: Level explanation text: The first tab always contains the level explanation. In each level new commands will be explained here. + 10: + title: Adventures + text: The other tabs contain adventures, which you can code for each level. They go from easy to hard. + 11: + title: Puzzles + text: Do you think you understand the level quite well? Try the puzzles! You get lines of code in the wrong order, fix the order to get the program running. 12: title: Quiz text: At the end of each level you can make the quiz. This way you can verify if you understand everything. + 13: + title: Saving & sharing + text: You can save and share all your created programs with other Hedy users. + 14: + title: Cheatsheet + text: If you forgot a command you can always use the cheatsheet. It shows a list of all commands you can use in the current level. You can find the cheatsheet at the 🤔 button 15: - text: Click on 'next step' to really start coding with Hedy! title: The end! + text: Click on 'next step' to really start coding with Hedy! +teacher: + steps: 1: title: Welcome to Hedy! text: In this tutorial we will explain all the Hedy features step-by-step. - 5: - title: Try it out! - text: Run the program, click 'next step' when you're done. - 8: - title: To the next level - text: When you think you understand everything and have practiced enough you can continue with the next level. When there is also a previous level there will be a button next to it to go back. - 4: - title: The run button - text: With this button you can run your program! Shall we give it a try in the next step? - 14: - title: Cheatsheet - text: If you forgot a command you can always use the cheatsheet. It shows a list of all commands you can use in the current level. You can find the cheatsheet at the 🤔 button 2: - title: The code editor - text: In this window you write all the code, try typing something on the place of the underscores! + title: Class management + text: As a teacher you can created classes and invite student or let them join through a link. You can view the programs and statistics of all your students. + 3: + title: Customize classes + text: You can customize classes by hiding specific levels and/or adventures as well as making them available on a specific date. + 4: + title: Creating adventures + text: You can create your own adventures and use them as assignments for your students. Create them here and add them to your classes in the class customization section. + 5: + title: Creating accounts + text: You can create multiple accounts at once, only needing to provide an username and password. You can also directly add these accounts to one of your classes. + 6: + title: Hedy documentation + text: Here you find a more extensive documentation with tips and tricks on how to use Hedy in the classroom. + 7: + title: The end! + text: Click on 'next step' to get started as a Hedy teacher!