diff --git a/content/adventures/adventures.schema.json b/content/adventures/adventures.schema.json index c80f22111ca..07f4326eda3 100644 --- a/content/adventures/adventures.schema.json +++ b/content/adventures/adventures.schema.json @@ -50,7 +50,6 @@ "story_text_6": { "type": "string" }, "example_code_6": { "type": "string" } }, - "required": ["start_code"], "additionalProperties": false } } diff --git a/content/adventures/ar.yaml b/content/adventures/ar.yaml index 5daa135ec1e..a80db6c06c0 100644 --- a/content/adventures/ar.yaml +++ b/content/adventures/ar.yaml @@ -15,7 +15,6 @@ adventures: example_code: "```\n{ask} الشخصية الرئيسية في القصة هو\n{print} يتجول الان الشخصية الرئيسية في الغابة\n{echo} إنه خائف قليلاً، \n{print} لقد سمع ضوضاء رهيبة في المكان من حوله\n{print} إنه خائف من أن تكون هذه الغابة مسكونة\n```\n" story_text_2: | هل يمكنك الان سرد قصة من تأليفك انت في هيدي بإستخدام `{print}` ، `{ask}`، `{echo}`؟ - start_code: '{print} تبدأ قصتك هنا' 2: story_text: | في المستوى 2 يمكنك أن تجعل القصة الخاصة بك ممتعة أكثر.ستكون قادراً على استخدام اسم الشخصية الرئيسية في أي مكانٍ تريده في قصتك. @@ -41,7 +40,6 @@ adventures: 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} قصتك' 3: story_text: | في المستوى الثالث يمكنك جعل القصة أكثر متعة. يمكنك إستخدام الإختيار بطريقة عشوائية لأي وحش أو حيوان أو حتى عائق، مثل: @@ -72,14 +70,12 @@ adventures: الزائد {is} {ask} ما الذي عليه التخلص منه؟ {remove} الزائد {from} المحتويات ``` - start_code: '{print} قصتك' 4: story_text: | ربما لاحظت أنه لا زال هناك مشكلة في المستويات السابقة عند محاولة طباعة جملة تحتوي على كلمة -الاسم-؟ مثل: `{print}` الاسم هو الاسم. ستتمكن من حل هذه المشكلة في هذا المستوى. يجب أن تضع علامات الاقتباس حول أي نص تريد طباعته. example_code: "```\nالاسم {is} حسن \n{print} _الاسم الأول للشخصية الرئيسية في القصة هو_ الاسم\n{print} الاسم _ذاهبٌ الآن للسير في الغابة_\n{print} الاسم _خائفٌ قليلًا_\nالحيوانات {is} \U0001F994, \U0001F43F, \U0001F989, \U0001F987\n{print} _لقد سمع صوت_ الحيوانات {at} {random}\n{print}\ \ الاسم _خائفٌ أن تكون هذه الغابة مسكونة_\n```\n" - start_code: '{print} ''Your story will be printed here!''' 5: story_text: | في هذا المستوى تستطيع برمجة نهايات مختلفة، والتي ستجعل قصتك اكثر متعة @@ -102,7 +98,6 @@ adventures: {if} نهاية {is} جيدة {print} اسمك 'يأخذ السيف ويهرب الوحش بسرعة' {else} {print} 'الوحش يأكل' اسمك ``` - start_code: '{print} ''هنا قصتك سوف تبدأ!''' 7: story_text: | In a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -113,7 +108,6 @@ adventures: {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! @@ -131,7 +125,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -150,7 +143,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -167,7 +159,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -176,7 +167,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -206,7 +196,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -228,7 +217,6 @@ adventures: {else} {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -249,7 +237,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -289,13 +276,6 @@ adventures: _ {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 @@ -313,11 +293,6 @@ adventures: {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 @@ -350,10 +325,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -381,11 +352,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -497,7 +463,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: آلة حاسبة default_save_name: آلة حاسبة @@ -553,7 +518,6 @@ adventures: 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! @@ -570,7 +534,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -586,7 +549,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -596,7 +558,6 @@ adventures: number2 = {ask} 'What is the second number?' answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -613,7 +574,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -638,11 +598,7 @@ adventures: 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 @@ -674,7 +630,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -723,17 +678,6 @@ adventures: 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 @@ -756,12 +700,6 @@ adventures: {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. @@ -781,14 +719,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -810,16 +740,6 @@ adventures: 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 @@ -834,13 +754,6 @@ adventures: {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 @@ -863,17 +776,7 @@ adventures: {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' @@ -900,19 +803,7 @@ adventures: 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: @@ -928,11 +819,6 @@ adventures: 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 @@ -957,10 +843,7 @@ adventures: {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} @@ -997,19 +880,7 @@ adventures: 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: @@ -1024,11 +895,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1068,26 +934,6 @@ adventures: 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 @@ -1116,27 +962,6 @@ adventures: 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 @@ -1169,31 +994,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1223,9 +1023,7 @@ adventures: 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?' @@ -1282,36 +1080,6 @@ adventures: 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 @@ -1461,7 +1229,6 @@ adventures: جرب الكود بنفسك من خلال الضغط على الزر الأخضر "تنفيذ البرنامج" الموجود تحت المساحة البرمجية. بامكانك اظهار/طباعة الكلام على الشاشة من خلال استعمال الأمر `{print}` . - start_code: '{print} مرحبا أيها العالم!' 2: story_text: "في المستوى 2 نتعلم الأوامر الجديدة `{is}` و `{sleep}`.\nيمكنك أن تعطي اسما لشيء ما باستخدام `{is}`. هذا ما يسمى ب \"متغير\". في المثال الموجود قمنا بانشاء متغير يسمى الاسم ومتغير آخر يسمى العمر. يمكنك أن تستخدم كلمة الاسم في أي مكان في البرنامج الخاص بك وسيتم استبدالها ب هيدي،\ \ كما في المثال التوضيحي: \n\nبهذا الشكل لم تعد الان بحاجة للأمر `{echo}`.\n" @@ -1473,11 +1240,9 @@ adventures: ``` story_text_2: | الأمر `{print}` لا زال يعمل بنفس الطريقة، ولكن الأمر `{ask}` قد تغير ،عليك الان ان تحتفظ بالاجابة على `{ask}` في متغير من خلال اعطاء الاجابة اسما معينا كما في المثال التوضيحي: - start_code: '{print} مرحبا أيها العالم!' 3: story_text: | في المستوى 3 يمكنك أن تنشأ قائمة. يمكنك بعدها أن تجعل الحاسوب يختار لك شيئا من القائمة بشكل عشوائي - يمكنك القيام بذك من خلال الأمر `{at} {random}`. - start_code: '{print} مرحبا أيها العالم!' 4: story_text: | هناك تغيير على `{print}` و `{ask}` في المستوى الرابع. @@ -1737,7 +1502,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1749,7 +1513,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1774,7 +1537,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: غسل الأطباق؟ default_save_name: Dishes @@ -1875,7 +1637,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1923,10 +1684,6 @@ adventures: {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: |- 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. @@ -1938,10 +1695,6 @@ adventures: {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: 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. @@ -1970,7 +1723,6 @@ adventures: كما في المثال التوضيحي: example_code: "```\n{print} مرحبًا، انا العرافه هيدي!\n{ask} من انت؟\n{print} دعني اري في كرتي السحرية\n{print} اجل.. اجل.. لقد عرفت من انت!\n{echo} اسمك هو \n```\n" story_text_2: "الان العرافة هيدي تستطيع التنبؤ باسمك فقط. هل تستطيع تكملة الكود لجعلها تتنبأ بأشياء اخرى عنك؟ \nمن الواضح ان هيدي ليست جيدة كفاية لتتنبأ المستقبل، تستطيع فقط تكرار الإجابة التي اعطاها لها اللاعبين\nلذلك، يمكنك النظر في المستوى٢ لتحسين العراف الالكتروني الخاص بك.\n" - start_code: '# اكتب الكود الخاص بك هنا' 3: story_text: | في المستويات السابقة استطعت أن تصنع أول عراف آلي لك، ولكن لم تستطع هيدي التنبؤ بأي شيء، لقد رددت فقط بعض الإجابات من خلال الأمر {echo}. @@ -1988,7 +1740,6 @@ adventures: ``` story_text_2: | الان هيدي العرافة تستطيع الإجابة بنعم، لا او ربما فقط. هل يمكنك أن تعطيها خيارات لإجابات أخرى مثل "بالتأكيد" او "{ask} مرة أخرى". - start_code: '# اكتب الكود الخاص بك هنا' 4: story_text: "في هذا المستوى لن تتعلم أوامر جديدة، لكنك ستتدرب على استخدام علامات الاقتباس. \nتستطيع إعادة كتابة الكود الخاص بك في المستوى الثالث، ولا تنسَ أن تضع علامات الاقتباس في الأماكن الصحيحة.\n\nفي المستوى الثالث, لم نستطع استخدام كلمة ’السؤال‘ اسمًا للمتغير وإعادة استخدامها في النص\ \ مرة أخرى ككلمة عادية.\nلا تقلق! علامات الاقتباس ستجعل هذا الأمر ممكنًا!\n" @@ -2001,7 +1752,6 @@ adventures: {sleep} 2 {print} الاجابات {at} {random} ``` - start_code: '# اكتب الكود الخاص بك هنا' 5: story_text: | في هذا المستوى ستتعلم (سرًا) ترجيح الاحتمالات لصالحك ، عند استخدام العراف! @@ -2014,7 +1764,6 @@ adventures: شخص {is} {ask} 'من انت ؟' {if} شخص {is} هيدي {print} 'أنت بتأكيد ستفوز!🤩' {else} {print} 'حظ سيء! شخص آخر سيفوز !😭' ``` - start_code: '# place your code here' 6: story_text: | في هذا المستوى يمكنك إستخدام الحساب في تنبؤاتك كـ عراف. سيمكنك هذا من حساب بعض المعادلات (الخيالية) لتحسب شئ فالمستقبل. @@ -2047,7 +1796,6 @@ adventures: النتيجة = النتيجة * كرةقدم {print} 'أنت ' النتيجة ' بالمائة ذكي.' ``` - start_code: '# أكتب الكود الخاص بك هنا' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2070,7 +1818,6 @@ adventures: Can you do it? In the upcoming levels the layout of {repeat} command will change, which enables you to repeat multiple lines at once. - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2087,7 +1834,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2103,7 +1849,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2115,7 +1860,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2155,21 +1899,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2198,13 +1927,6 @@ adventures: {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. @@ -2228,17 +1950,6 @@ adventures: 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 @@ -2267,7 +1978,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2289,7 +1999,6 @@ adventures: _ {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: بيت الأشباح default_save_name: بيت الأشباح @@ -2351,7 +2060,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# اكتب الكود الخاص بك هنا' 4: story_text: | في هذا المستوى ستتعلم كيف تستخدم علامات الاقتباس في الألعاب الخاصة بك. @@ -2367,7 +2075,6 @@ adventures: {sleep} {print} الأشباح {at} {random} ``` - start_code: '#اكتب الكود الخاص بك هنا' 5: story_text: | حتى هذا المستوى ، طلبت لعبة المنزل المسكون دائمًا من اللاعب اختيار باب، ولكن كما لاحظت، لم يكن عليهم حقًا الإجابة بشكل صحيح. @@ -2377,7 +2084,6 @@ adventures: هل يمكنك العثور على الكلمات الأربع المفقودة لإكمال الكود؟ example_code: "```\n{print} 'اهرب من بيت الأشباح !'\n{print} 'أمامك 3 أبواب ...'\nالأبواب {is} ۱ ، ۲، ۳ \nالوحوش {is} مستذئب، مومياء، مصاص دماء، زومبي\n الباب_الذي_إخترته {is} {ask} 'أي باب تختار؟'\n{print} 'انت إخترت باب ..' الباب_الذي_إخترته\n{sleep}\nالباب_الصحيح {is} الأبواب {at}\ \ {random}\n____ {print} 'رائعة! لقد نجوت!'\n{else} {print} 'أوه لا! لقد تم أكلك من قبل ... \"الوحوش {at} {random}\n```\n" - 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! @@ -2405,7 +2111,6 @@ adventures: ### Exercise Now it's very hard to win this game, can you make it easier to win? For example by only having 1 wrong door and 2 correct doors instead of 1 correct door en 2 wrong ones? - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2431,7 +2136,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2460,7 +2164,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2494,7 +2197,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2525,18 +2227,7 @@ adventures: {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?' @@ -2575,10 +2266,6 @@ adventures: _ _ _ 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... @@ -2595,11 +2282,6 @@ adventures: {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. @@ -2615,16 +2297,6 @@ adventures: {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 @@ -2653,11 +2325,6 @@ adventures: _ 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 @@ -2683,10 +2350,6 @@ adventures: 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: @@ -2695,8 +2358,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2728,8 +2390,7 @@ adventures: {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} @@ -2752,7 +2413,6 @@ adventures: {if} ضفدع {is} غرينويل {print} 'ممتاز!' {else} {print} 'لا, الضفدع هو غرينويل' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2773,7 +2433,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2813,8 +2472,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: الببغاء @@ -2839,7 +2497,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} انا الببغاء هيدي' 2: story_text: | اصنع ببغاء إلكتروني خاص بك، سيقوم بنسخ كل ما تقول! @@ -2855,7 +2512,6 @@ adventures: ``` story_text_2: | بإمكانك استخدام المتغيرات لتجعل الببغاء يقول أي شيء تريده, هل تستطيع إكمال هذا الكود؟ - start_code: '{print} أنا الببغاء هيدي' 3: story_text: | علّم الببغاء كلمة جديدة من خلال الأمر `{add}`. @@ -2868,7 +2524,6 @@ adventures: {print} 🧒 تكلم كلمة_جديدة أيها الببغاء هيدي! {print} 🦜 كلمات {at} {random} ``` - start_code: '# اكتب الكود الخاص بك هنا' 4: story_text: | في هذا المستوى يجب علينا استخدام علامات الاقتباس مع الأوامر `{ask}` و `{print}`. @@ -2882,7 +2537,6 @@ adventures: {print} _ 🧒 قل _ كلمة_جديدة _, هيدي!_ {print} _ 🦜 _ الكلمات {at} {random} ``` - start_code: '# اكتب الكود الخاص بك هنا' 5: story_text: | كافئ الببغاء {if} قال الكلمةالصحيحة! @@ -2898,7 +2552,6 @@ adventures: _ الكلمة_التي_قالها{is} الكلمة_الجديدة {print} '🧒 هيدي، عمل رائع! 🍪' __ {print} '🧒 لا, هيدي! قل ' الكلمة_الجديدة ``` - start_code: '# place your code here' piggybank: name: البنك الإلكتروني default_save_name: البنك الإلكتروني @@ -2917,7 +2570,6 @@ adventures: to_save = price - saved weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -2941,7 +2593,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -2970,7 +2621,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -2983,7 +2633,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3003,7 +2652,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3029,8 +2677,6 @@ adventures: ``` _ 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. @@ -3047,8 +2693,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: عريف المسابقات @@ -3080,7 +2725,6 @@ adventures: {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 @@ -3110,10 +2754,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3148,10 +2788,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3185,9 +2821,6 @@ adventures: 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. @@ -3236,11 +2869,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3254,10 +2882,6 @@ adventures: {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! @@ -3272,13 +2896,6 @@ adventures: {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 @@ -3304,10 +2921,6 @@ adventures: 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? @@ -3325,11 +2938,6 @@ adventures: _ {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: المطعم default_save_name: المطعم @@ -3341,7 +2949,6 @@ adventures: example_code: "```{print} \U0001F35F اهلاً بكم في مطعم هيدي \n{ask} ماذا تود ان تطلب؟\n{echo} اذاً، طلبك هو \n{print} شكرًا لطلبكم من مطعمنا!\n{print} طلبك في طريقه إليك!\n ```\n" story_text_2: | هل يمكنك التفكير في عدة سطور اخرى تضيفها لتطور كود مطعمك؟ على سبيل المثال، هل يمكنك استخدام `{ask}` لسؤال الضيوف ماذا يفضلون كشراب بجانب وجبتهم، وبعد ذلك اخبارهم بسعر طلبهم، و ان تتمنى لهم وجبة هنيئة؟ - start_code: '# اكتب الكود الخاص بك هنا' 2: story_text: | في المستوى 2 ستتمكن من تطوير مطعمك باستخدام المتغيرات، في المستوى الأول، كانت هيدي تستطيع فقط أن تردد طلبك باستخدام الأمر `{echo} ` وكان باستطاعتها أخذ طلب واحد فقط. @@ -3360,7 +2967,6 @@ adventures: ``` story_text_2: | هل بإمكانك أن تجعل الكود مفصّلًا أكثر؟ بإضافة مشروبات إلى الطلب مثلًا؟ - start_code: '#ضع الكود الخاص بك هنا' 3: story_text: | هل تواجهة صعوبة في تحديد ماذا تريد أن تأكل على العشاء؟ دع هيدي تساعدك في الإختيار. @@ -3393,7 +2999,6 @@ adventures: _ {print} ستحصل على النكهات {at} {random} ``` - start_code: '# اكتب الكود الخاص بك هنا' 4: story_text: | في هذا المستوى عليك استخدام علامات الاقتباس مع الأمر `{print}` . @@ -3411,7 +3016,6 @@ adventures: {print} شكرًا لطلبك من مطعمنا. {print} الوجبة الخاصة بك بالإضافة إلى المشروب ستصلك قريبًا، بالهناء والشفاء. ``` - start_code: '#ضع الكود الخاص بك هنا' 5: story_text: | في هذا المستوى ، يتيح لك الأمر `{if}` `{ask}` أسئلة على عملائك وإعطاء ردود مختلفة على الإجابات. @@ -3432,7 +3036,6 @@ adventures: {if} شيء_آخر {is} لا {print} 'لك هذا !' {else} {print} 'واحد شيء_آخر' {print} 'شكرًا لك على زيارتك وتنمنى أن ينال الطعام على اعجابك !' ``` - start_code: '# place your code here' 6: story_text: | في هذا المستوى يمكنك إستخدام الحساب الرياضي لتحسب المبلغ الكُلي لطلب زبونك، مما سيجعل مطعمك الإلكتروني أكثر واقعية. @@ -3451,7 +3054,6 @@ adventures: {print} 'سيكون ثمنه ' المبلغ ' دولارات، من فضلك' {print} 'شكراً لك، إستمتع بوجبتك!' ``` - start_code: '# أكتب الكود الخاص بك هنا' 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. @@ -3470,7 +3072,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3490,7 +3091,6 @@ adventures: Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add as many options as you like! story_text_2: | Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3518,7 +3118,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3560,7 +3159,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3579,7 +3177,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3594,7 +3191,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3611,7 +3207,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: حجر، ورقة، مقص default_save_name: حجر ورقة مقص @@ -3646,7 +3241,6 @@ adventures: _ {is} {ask} حجر, ورقة, مقص؟ {print} أنا أختار _ ``` - start_code: '#اكتب الكود الخاص بك هنا' 3: story_text: | في هذا المستوى يمكننا إستخدام القوائم و الإختار منها. @@ -3711,7 +3305,6 @@ adventures: {if} your_choice {is} 'scissors' {print} 'You lose!' ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3722,7 +3315,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3740,7 +3332,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3761,7 +3352,6 @@ adventures: {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 @@ -3778,7 +3368,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: العميل السري default_save_name: العميل السري @@ -3802,7 +3391,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3815,7 +3403,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3831,10 +3418,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: غنّ أغنية! default_save_name: أغنية @@ -3871,7 +3454,6 @@ adventures: print 'لا مزيد من قفز القرود على السرير!' sleep ``` - start_code: '{print} ''هيا نغني!''' 7: story_text: | عادة ما تحتوي الأغاني على الكثير من التكرار. على سبيل المثال... بيبي شارك! اذا غنيتها فأنت فعلياً تقوم بتكرار غناء نفس المقطع: @@ -3889,7 +3471,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3903,7 +3484,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -3954,7 +3534,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -3969,7 +3548,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -3984,7 +3562,6 @@ adventures: {print} '{if} youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4001,16 +3578,6 @@ adventures: {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. @@ -4074,7 +3641,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4096,7 +3662,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4118,15 +3683,6 @@ adventures: {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: لعبة إكس-أو default_save_name: Tic @@ -4195,7 +3751,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4258,7 +3813,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4320,7 +3874,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4407,7 +3960,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: الرسام default_save_name: الرسام @@ -4452,8 +4004,7 @@ adventures: {turn} الزاوية {forward} ٢٥ ``` - start_code: |- - {print} سباق الرسم + الزاوية هي ٩٠ {turn} الزاوية {forward} ٢٥ @@ -4599,7 +4150,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4617,7 +4167,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4642,16 +4191,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4667,7 +4206,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4678,7 +4216,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4689,7 +4226,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4707,7 +4243,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4726,7 +4261,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4746,7 +4280,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4757,7 +4290,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4770,7 +4302,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4801,7 +4332,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4842,7 +4372,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4865,7 +4394,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4894,7 +4422,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4918,7 +4445,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -4946,7 +4472,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -4980,7 +4505,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5000,11 +4524,6 @@ adventures: 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 @@ -5022,4 +4541,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/bg.yaml b/content/adventures/bg.yaml index 87dc7c72838..51b4f9e2b5a 100644 --- a/content/adventures/bg.yaml +++ b/content/adventures/bg.yaml @@ -24,7 +24,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: print Твоята история започва тук 2: story_text: | Във второ ниво можеш да направиш историята си по-внушителна и интересна. @@ -49,7 +48,6 @@ adventures: 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 Твоята история 3: story_text: | Към историята, която пишеш можеш да добавиш нещо произволно и неочаквано, примерно чудовище, животно или някаква пречка. @@ -78,7 +76,6 @@ adventures: dump {is} {ask} Which item should he dump? {remove} dump {from} bag ``` - start_code: print Твоята история 4: story_text: | Може би забелязваш, че във второ ниво имаме едно малко неудобство. Пробва ли да принтираш изречение, в @@ -95,7 +92,6 @@ adventures: print име ' се опасява, че гората е омагьосана.' ``` - start_code: print 'Твоята история ще се появи тук!' 5: story_text: | В четвърто ниво ще направиш историята си дори по-цветиста и забавна! @@ -122,7 +118,6 @@ adventures: if край is щастлив print име ' изважда острата си сабя и чудовището се оттегля от пътя й.' else print 'Чудовището отваря голямата си паст и поглъща ' име ' цяла.' ``` - start_code: print 'Историята' 7: story_text: | Представи си следната история - някой повтаря едни и същи думи няколко пъти или, примерно, зове за помощ. @@ -151,7 +146,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -170,7 +164,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -187,7 +180,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -196,7 +188,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -226,7 +217,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -248,7 +238,6 @@ adventures: {else} {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -269,7 +258,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -309,13 +297,6 @@ adventures: _ {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 @@ -333,11 +314,6 @@ adventures: {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 @@ -370,10 +346,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -401,11 +373,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -517,7 +484,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -556,7 +522,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -575,7 +540,6 @@ adventures: 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! @@ -592,7 +556,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -608,7 +571,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -618,7 +580,6 @@ adventures: number2 = {ask} 'What is the second number?' answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -635,7 +596,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -660,11 +620,7 @@ adventures: 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 @@ -696,7 +652,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -745,17 +700,6 @@ adventures: 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 @@ -778,12 +722,6 @@ adventures: {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. @@ -803,14 +741,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -832,16 +762,6 @@ adventures: 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 @@ -856,13 +776,6 @@ adventures: {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 @@ -885,17 +798,7 @@ adventures: {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' @@ -922,19 +825,7 @@ adventures: 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: @@ -950,11 +841,6 @@ adventures: 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 @@ -979,10 +865,7 @@ adventures: {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} @@ -1019,19 +902,7 @@ adventures: 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: @@ -1046,11 +917,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1090,26 +956,6 @@ adventures: 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 @@ -1138,27 +984,6 @@ adventures: 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 @@ -1191,31 +1016,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1245,9 +1045,7 @@ adventures: 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?' @@ -1304,36 +1102,6 @@ adventures: 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 @@ -1490,7 +1258,6 @@ adventures: В същото поле можеш смело да променяш някои от думите на кода. Обаче не променяй командите засега. Добре. Имаш ли вече идея какво да програмираш? Ако още не, то в табовете отгоре ще откриеш някои готови идеи. - start_code: print Ето те и теб, очаквах те! 2: story_text: | Във второ ниво ще научим нещо ново заедно. Можеш да назовеш име и да го запишеш с командата `is`. @@ -1504,7 +1271,6 @@ adventures: {print} name is age years old ``` story_text_2: '**Внимание!** Запитването с командата `ask` се променя в това ниво, така че отговорът се записва в име, например.' - start_code: print здравей свят! 3: story_text: | Във второ ниво ще можеш да съставиш списък с думи и програмата сама ще може да изпечата произволна дума от твоя списък. @@ -1512,7 +1278,6 @@ adventures: Всички програмни кодове от ниво 3 са изписани в лявата колона със сините бутони, а с табовете горе се задействат новите задачи. Хайде, успех! - start_code: print здравей свят! 4: story_text: | Ето ни вече в трето ниво! Командите `ask` и `print` сега ще се поизменят малко. @@ -1532,7 +1297,6 @@ adventures: answer is ask 'What do we need to use from now on?' print 'We need to use ' answer ``` - start_code: print 'Ура! Вече си в трето ниво!' 5: story_text: | Ниво 4! Тук командите `ask` and `print` работят по същия начин. @@ -1550,9 +1314,6 @@ adventures: име is ask 'Как се казва този език за програмиране?' if име is Хеди print 'позна' else print 'не позна' ``` - start_code: |- - name is ask 'what is your name?' - if name is Hedy print 'cool!' else print 'meh' 6: story_text: | Пето ниво! Командите `ask`, `print` и `if`...`else` засега остават непроменени. @@ -1576,7 +1337,6 @@ adventures: ``` repeat 3 times print 'Да пишеш код на Хеди е забавно!' ``` - start_code: repeat 3 times print 'Да пишеш код на Хеди е забавно!' 8: story_text: |- `{ask}` {and} `{print}` still work as you know them. But `{if}` {and} `{repeat}` have changed! @@ -1588,10 +1348,6 @@ adventures: {print} 'Hello everyone' {print} 'This is all repeated 5 times' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1606,13 +1362,6 @@ adventures: 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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1623,17 +1372,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1643,8 +1385,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1656,11 +1397,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1675,8 +1411,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1699,11 +1434,6 @@ adventures: {if} answer == 'yes' {print} 'Ok we will continue' ``` - start_code: |- - answer = 0 - {while} answer != 25 - answer = {ask} 'What is 5 times 5?' - {print} 'A correct answer has been given' 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. @@ -1738,9 +1468,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dice @@ -1768,12 +1497,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1787,7 +1514,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1805,7 +1531,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1817,7 +1542,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1829,7 +1553,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1854,7 +1577,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Кой мие чиниите? default_save_name: Dishes @@ -1878,7 +1600,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: print Кой мие чиниите? 4: story_text: | Сега ползвай кавички, за да подобриш графика на миячите на чинии. @@ -1893,7 +1614,6 @@ adventures: print _ Чиниите ще измие... _ print семейство at _ ``` - start_code: print 'Кой мие чиниите?' 5: story_text: | С командата `if` ще създадем възможност за повече избор в програмата ни. @@ -1908,7 +1628,6 @@ adventures: if мияч is Сашо print _ Какъв лош късмет да ми се падне да мия чиниите _ else print 'Ах, супер, не трабва да мия аз чиниите, защото ' _ ' вече ги мие!' ``` - start_code: print 'Кой мие чиниите?' 6: story_text: | Кой член от семейството мие най-често чиниите вкъщи? И справедливо ли е това? @@ -1942,7 +1661,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: print 'Кой мие чиниите?' 7: story_text: | С `repeat` повтори част от кода в цикъл. Довърши примерния код (като замениш '_' с команда или символ) така, че @@ -1952,7 +1670,6 @@ adventures: семейство is мама, тате, Лили, Сашо repeat _ _ print 'Миячът на чинии е ' семейство _ _ '.' ``` - start_code: print 'Кой мие чиниите?' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1963,7 +1680,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -2011,10 +1727,6 @@ adventures: {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: |- 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. @@ -2026,10 +1738,6 @@ adventures: {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: 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. @@ -2075,7 +1783,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2097,7 +1804,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2118,7 +1824,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2131,7 +1836,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2162,7 +1866,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2185,7 +1888,6 @@ adventures: Can you do it? In the upcoming levels the layout of {repeat} command will change, which enables you to repeat multiple lines at once. - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2202,7 +1904,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2218,7 +1919,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2230,7 +1930,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2270,21 +1969,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2313,13 +1997,6 @@ adventures: {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. @@ -2343,17 +2020,6 @@ adventures: 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 @@ -2382,7 +2048,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2404,7 +2069,6 @@ adventures: _ {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 @@ -2433,7 +2097,6 @@ adventures: ``` story_text_2: | Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2481,7 +2144,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2497,7 +2159,6 @@ adventures: {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. @@ -2516,7 +2177,6 @@ adventures: _ _ _ _ {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! @@ -2544,7 +2204,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2556,7 +2215,6 @@ adventures: {print} 'Room ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2585,7 +2243,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2619,7 +2276,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2650,18 +2306,7 @@ adventures: {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?' @@ -2700,10 +2345,6 @@ adventures: _ _ _ 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... @@ -2720,11 +2361,6 @@ adventures: {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. @@ -2740,16 +2376,6 @@ adventures: {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 @@ -2778,11 +2404,6 @@ adventures: _ 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 @@ -2808,10 +2429,6 @@ adventures: 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: @@ -2820,8 +2437,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2853,8 +2469,7 @@ adventures: {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} @@ -2877,7 +2492,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2898,7 +2512,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2938,8 +2551,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2965,7 +2577,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2982,7 +2593,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2995,7 +2605,6 @@ adventures: {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}`. @@ -3009,7 +2618,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -3025,7 +2633,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3044,7 +2651,6 @@ adventures: to_save = price - saved weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3068,7 +2674,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3097,7 +2702,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3110,7 +2714,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3130,7 +2733,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3156,8 +2758,6 @@ adventures: ``` _ 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. @@ -3174,8 +2774,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3207,7 +2806,6 @@ adventures: {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 @@ -3237,10 +2835,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3275,10 +2869,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3312,9 +2902,6 @@ adventures: 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. @@ -3363,11 +2950,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3381,10 +2963,6 @@ adventures: {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! @@ -3399,13 +2977,6 @@ adventures: {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 @@ -3431,10 +3002,6 @@ adventures: 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? @@ -3452,11 +3019,6 @@ adventures: _ {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 @@ -3475,7 +3037,6 @@ adventures: ``` story_text_2: | Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3495,7 +3056,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3527,7 +3087,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3547,7 +3106,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3568,7 +3126,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3588,7 +3145,6 @@ adventures: {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. @@ -3600,7 +3156,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3617,7 +3172,6 @@ adventures: ``` story_text_2: | Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3645,7 +3199,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3675,7 +3228,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3694,7 +3246,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3711,7 +3262,6 @@ adventures: {print} 'That is a healthy choice' {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3728,7 +3278,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3755,7 +3304,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3764,7 +3312,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3786,12 +3333,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3811,7 +3356,6 @@ 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. Can you finish the code? @@ -3830,7 +3374,6 @@ adventures: {if} your_choice {is} 'scissors' {print} 'You lose!' ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3841,7 +3384,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3859,7 +3401,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3880,7 +3421,6 @@ adventures: {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 @@ -3897,7 +3437,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3921,7 +3460,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3934,7 +3472,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3950,10 +3487,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Изпей песен! default_save_name: Song @@ -3986,7 +3519,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -4002,7 +3534,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -4016,7 +3547,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4068,7 +3598,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4083,7 +3612,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4098,7 +3626,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4115,16 +3642,6 @@ adventures: {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. @@ -4160,7 +3677,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4182,7 +3698,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4204,15 +3719,6 @@ adventures: {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 @@ -4281,7 +3787,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4344,7 +3849,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4406,7 +3910,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4493,7 +3996,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Костенурка default_save_name: turtle @@ -4518,12 +4020,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - forward 50 - turn right - forward 25 - turn left - forward 30 2: story_text: | В първо ниво нашата костенурка можеше да се движи само само в посока ляво или дясно. Това бързо доскучава, нали? @@ -4551,11 +4047,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: | - print Състезание с костенурки! - ъгъл is 90 - turn ъгъл - forward 25 3: story_text: | Докато рисуваш костенурката можеш да добавиш и командата `random`. С нея костенурката ще поеме в произволна посока всеки път. @@ -4567,11 +4058,6 @@ adventures: turn ъгли at random forward 25 ``` - start_code: | - print Състезание с костенурки! - ъгъл is 90 - turn ъгъл - forward 25 4: story_text: | В трето ниво е нужно да ползваш кавички с командите `print` and `ask`. Същото важи при рисуването! @@ -4598,11 +4084,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: | - print 'Рисуване на фигури' - angle is 90 - turn angle - forward 25 5: story_text: | В четвърто ниво можеш да програмираш правене на избор с командата `if`. @@ -4634,8 +4115,7 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: | - print 'Рисуване на фигури' + фигура is ask 'Какво да нарисуваме: четриъгълник или триъгълник?' if фигура is триъгълник angle is 120 else angle is 90 turn angle @@ -4663,8 +4143,6 @@ adventures: forward 50 turn angle ``` - start_code: | - print 'Рисуване на фигури' 8: story_text: | Now that we can repeat several lines, we can make figures more easily. @@ -4687,8 +4165,6 @@ adventures: {turn} _ {forward} _ ``` - start_code: | - hoeken = {ask} 'How many angles should I draw?' 9: story_text: | Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures. @@ -4708,7 +4184,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4726,7 +4201,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4751,16 +4225,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4776,7 +4240,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4787,7 +4250,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4798,7 +4260,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4816,7 +4277,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4835,7 +4295,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4855,7 +4314,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4866,7 +4324,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4879,7 +4336,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4910,7 +4366,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4951,7 +4406,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4974,7 +4428,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5003,7 +4456,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5027,7 +4479,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5055,7 +4506,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5089,7 +4539,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5109,11 +4558,6 @@ adventures: 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 @@ -5131,4 +4575,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/bn.yaml b/content/adventures/bn.yaml index db0c6894378..45b1b8a9551 100644 --- a/content/adventures/bn.yaml +++ b/content/adventures/bn.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -49,7 +48,6 @@ adventures: 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: @@ -78,7 +76,6 @@ adventures: 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? @@ -93,7 +90,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -116,7 +112,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -127,7 +122,6 @@ adventures: {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! @@ -145,7 +139,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -181,7 +173,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,10 +366,7 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. @@ -511,7 +479,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +517,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -569,7 +535,6 @@ adventures: 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! @@ -586,7 +551,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -602,7 +566,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -613,7 +576,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -630,7 +592,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -655,11 +616,7 @@ adventures: 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 @@ -691,7 +648,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -740,17 +696,6 @@ adventures: 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 @@ -773,12 +718,6 @@ adventures: {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. @@ -798,14 +737,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -827,16 +758,6 @@ adventures: 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 @@ -851,13 +772,6 @@ adventures: {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 @@ -880,17 +794,7 @@ adventures: {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' @@ -917,19 +821,7 @@ adventures: 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: @@ -945,11 +837,6 @@ adventures: 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 @@ -974,10 +861,7 @@ adventures: {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} @@ -1014,19 +898,7 @@ adventures: 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: @@ -1041,11 +913,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1085,26 +952,6 @@ adventures: 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 @@ -1133,27 +980,6 @@ adventures: 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 @@ -1186,31 +1012,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1240,9 +1041,7 @@ adventures: 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?' @@ -1299,36 +1098,6 @@ adventures: 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 @@ -1534,8 +1303,7 @@ adventures: {print} 'Hello everyone' {print} 'This is all repeated 5 times' ``` - start_code: | - repeat 5 times + print 'ওহে বন্ধুরা' print 'এটি পাঁচ বার মুদ্রণ করা হবে' 9: @@ -1552,13 +1320,6 @@ adventures: 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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1569,17 +1330,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1589,8 +1343,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1602,11 +1355,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1621,8 +1369,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1641,11 +1388,6 @@ adventures: 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' 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. @@ -1675,9 +1417,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dice @@ -1705,12 +1446,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1724,7 +1463,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1742,7 +1480,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1754,7 +1491,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1766,7 +1502,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1791,7 +1526,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1809,7 +1543,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1825,7 +1558,6 @@ adventures: {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. @@ -1838,7 +1570,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1871,7 +1602,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1880,7 +1610,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1891,7 +1620,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1939,10 +1667,6 @@ adventures: {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: |- 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. @@ -1954,10 +1678,6 @@ adventures: {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: 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. @@ -1996,7 +1716,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2013,7 +1732,6 @@ adventures: ``` story_text_2: | 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. @@ -2034,7 +1752,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2047,7 +1764,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2078,7 +1794,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2090,7 +1805,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2107,7 +1821,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2123,7 +1836,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2135,7 +1847,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2175,21 +1886,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2218,13 +1914,6 @@ adventures: {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. @@ -2248,17 +1937,6 @@ adventures: 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 @@ -2287,7 +1965,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2309,7 +1986,6 @@ adventures: _ {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 @@ -2338,7 +2014,6 @@ adventures: ``` story_text_2: | Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2385,7 +2060,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2401,7 +2075,6 @@ adventures: {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. @@ -2420,7 +2093,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2448,7 +2120,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2474,7 +2145,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2503,7 +2173,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2537,7 +2206,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2568,18 +2236,7 @@ adventures: {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?' @@ -2618,10 +2275,6 @@ adventures: _ _ _ 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... @@ -2638,11 +2291,6 @@ adventures: {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. @@ -2658,16 +2306,6 @@ adventures: {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 @@ -2696,11 +2334,6 @@ adventures: _ 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 @@ -2726,10 +2359,6 @@ adventures: 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: @@ -2738,8 +2367,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2771,8 +2399,7 @@ adventures: {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} @@ -2795,7 +2422,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2816,7 +2442,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2856,8 +2481,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2883,7 +2507,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2900,7 +2523,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2913,7 +2535,6 @@ adventures: {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}`. @@ -2927,7 +2548,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -2943,7 +2563,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -2963,7 +2582,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -2987,7 +2605,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3016,7 +2633,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3029,7 +2645,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3049,7 +2664,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3075,8 +2689,6 @@ adventures: ``` _ 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. @@ -3093,8 +2705,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3126,7 +2737,6 @@ adventures: {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 @@ -3156,10 +2766,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3194,10 +2800,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3231,9 +2833,6 @@ adventures: 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. @@ -3282,11 +2881,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3300,10 +2894,6 @@ adventures: {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! @@ -3318,13 +2908,6 @@ adventures: {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 @@ -3350,10 +2933,6 @@ adventures: 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? @@ -3371,11 +2950,6 @@ adventures: _ {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 @@ -3394,7 +2968,6 @@ adventures: ``` story_text_2: | Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3414,7 +2987,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3446,7 +3018,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3466,7 +3037,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3487,7 +3057,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3506,7 +3075,6 @@ adventures: {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. @@ -3518,7 +3086,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3535,7 +3102,6 @@ adventures: ``` story_text_2: | Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3563,7 +3129,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3608,7 +3173,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3627,7 +3191,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3642,7 +3205,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3659,7 +3221,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3687,7 +3248,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3696,7 +3256,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3718,12 +3277,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3743,7 +3300,6 @@ 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. Can you finish the code? @@ -3763,7 +3319,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3774,7 +3329,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3792,7 +3346,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3814,7 +3367,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3831,7 +3383,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3855,7 +3406,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3868,7 +3418,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3884,10 +3433,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3921,7 +3466,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3939,7 +3483,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3953,7 +3496,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4005,7 +3547,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4020,7 +3561,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4035,7 +3575,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4052,16 +3591,6 @@ adventures: {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. @@ -4097,7 +3626,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4119,7 +3647,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4141,15 +3668,6 @@ adventures: {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 @@ -4217,7 +3735,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4280,7 +3797,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4342,7 +3858,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4429,7 +3944,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4449,9 +3963,6 @@ adventures: {turn} {left} {forward} 50 ``` - 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. @@ -4475,11 +3986,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4490,10 +3996,6 @@ adventures: {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! @@ -4520,11 +4022,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4557,12 +4054,6 @@ adventures: 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. @@ -4586,7 +4077,6 @@ adventures: {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. @@ -4629,7 +4119,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4647,7 +4136,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4672,16 +4160,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4697,7 +4175,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4708,7 +4185,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4719,7 +4195,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4737,7 +4212,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4756,7 +4230,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4776,7 +4249,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4787,7 +4259,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4800,7 +4271,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4831,7 +4301,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4872,7 +4341,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4895,7 +4363,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4924,7 +4391,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4948,7 +4414,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -4976,7 +4441,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5010,7 +4474,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5030,11 +4493,6 @@ adventures: 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 @@ -5052,4 +4510,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/ca.yaml b/content/adventures/ca.yaml index 2e41443e89f..fcde15d2f5e 100644 --- a/content/adventures/ca.yaml +++ b/content/adventures/ca.yaml @@ -27,7 +27,6 @@ adventures: Utilitzeu almenys una ordre `{ask}` i una `{echo}`. Podeu fer-ho sobre qualsevol tema que us agradi. Si no se t'acut un tema, pots fes servir una de les nostres opcions: anar al cinema, un partit esportiu o un dia al zoo. - start_code: '{print} La teva història comença aquí' 2: story_text: | Al nivell 2 pots fer que la teva història sigui més divertida. El nom del teu protagonista ara pot estar en qualsevol part de la frase. @@ -53,7 +52,6 @@ adventures: Canvia les ordres `{ask}` i les ordres `{echo}` del teu codi a la forma correcta que heu après en aquest nivell. **Extra** Afegeix una ordre `{sleep}` al teu codi per afegir tensió a la teva història. - start_code: '{print} La teva història' 3: story_text: | Al nivell 3 pots fer que la teva història sigui més divertida. Podeu utilitzar l'aleatorietat per a qualsevol monstre, animal o altre obstacle, com aquí: @@ -87,7 +85,6 @@ adventures: tirar {is} {ask} Quin element hauria de tirar? {remove} tirar {from} bossa ``` - start_code: '{print} La teva història' 4: story_text: | Potser has notat que hi ha un problema als nivells anteriors. Has intentat imprimir una frase que contingui la paraula nom? Per exemple, `{print}` el meu nom és nom. @@ -110,7 +107,6 @@ adventures: animals {is} 🦔, 🐿, 🦉, 🦇 {print} _ Sent el so de _ animals {at} {random} {print} name _ li fa por que estigui en un bosc encantat _ - start_code: '{print} ''La teva història es mostrarà aquí!''' 5: story_text: | En aquest nivell, pots programar diferents finals, cosa que farà que la teva història sigui encara més divertida. @@ -136,7 +132,6 @@ adventures: {if} final {is} bo {print} nom " agafa l'espasa i el monstre fuig ràpidament" {else} {print} 'El monstre menja ' nom ' per sopar' ``` - start_code: '{print} ''Aquí comença la teva història! ''' 7: story_text: | En una història, sovint es repeteixen paraules diverses vegades. Per exemple, quan algú demana ajuda o canta una cançó. @@ -151,7 +146,6 @@ adventures: {repeat} 5 {times} {print} "Ajuda!" {print} "Per què ningú m'ajuda?" ``` - start_code: '{repeat} 5 {times} {print} ''Ajuda!''' 8: story_text: | En aquest nivell podeu utilitzar diverses línies en les comandes `{if}`, d'aquesta manera podeu actualitzar el vostre final feliç o trist. @@ -174,7 +168,6 @@ adventures: {print} "Oh no! En Ricard és massa lent..." {print} _ ``` - start_code: '# situa el teu codi aquí' 9: story_text: | In this level you can use nesting to put `{if}`, `{repeat}` or `{for}` commands inside other `{if}`, `{repeat}` or `{for}` commands. This gives you many options and really helps you to make your story interactive. @@ -193,7 +186,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -210,7 +202,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -218,7 +209,6 @@ adventures: nom = "La Reina d'Englaterra" {print} nom ' menjava un tall de pastís, quan de sopte...' ``` - start_code: '# situa el teu codi aquí' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -234,7 +224,6 @@ adventures: {if} camí {is} 'esquerre' {and} arma {is} 'espasa' _' ``` - start_code: '# situa el teu codi aquí' 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. @@ -257,7 +246,6 @@ adventures: {print} ' No, no són a ' lloc {print} 'Ja pots entrar a casa!' ``` - start_code: '# situa el teu codi aquí' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -278,7 +266,6 @@ adventures: nom = {input}("Com et dius?") {print}('Benvingut a aquesta història!') ``` - start_code: '# situa el teu codi aquí' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: comanda_afegir_borrar @@ -318,13 +305,6 @@ adventures: _ {print} T'ha tocat gustos {at} {random} milkshake ``` - start_code: |- - animals {is} gos, gat, cangur - prefe {is} {ask} Quin és el teu animal preferit? - {add} prefe {to_list} animals - noagrada {is} {ask} Quin animal no t'agrada? - {remove} noagrada {from} animals - {print} Escullo animals {at} {random} and_or_command: name: '{and} & {or}' default_save_name: i o @@ -342,11 +322,6 @@ adventures: {if} nom {is} 'Hedy' {and} edat {is} 2 {print} 'Ets el veritable Hedy!' ``` - start_code: |- - nom = {ask} 'Com et dius?' - edat = {ask} 'Quants anys tens?' - {if} nom {is} 'Hedy' {and} edat {is} 2 - {print} 'Ets el veritable Hedy!' ask_command: name: '{ask}' default_save_name: comanda_pregunta @@ -379,10 +354,6 @@ adventures: _ Com vas? _ ``` - start_code: | - {print} Hola! - {ask} Com et dius? - {echo} Hola 2: story_text: | ## La comanda pregunta @@ -410,11 +381,6 @@ adventures: animals_preferits {is} {ask} Quin són els teus animals preferits? {print} M'agrada els/les animals_preferits ``` - start_code: |- - nom {is} {ask} Com et dius? - {print} Hola nom - edat {is} {ask} Quants anys tens? - {print} nom té edat anys. 18: story_text: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -526,7 +492,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -563,7 +528,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. @@ -584,7 +548,6 @@ adventures: 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! @@ -602,7 +565,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -618,7 +580,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -629,7 +590,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -646,7 +606,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -671,11 +630,7 @@ adventures: 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 @@ -707,7 +662,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -756,17 +710,6 @@ adventures: 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 @@ -789,12 +732,6 @@ adventures: {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. @@ -814,14 +751,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -843,16 +772,6 @@ adventures: 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 @@ -867,13 +786,6 @@ adventures: {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 @@ -896,17 +808,7 @@ adventures: {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' @@ -933,19 +835,7 @@ adventures: 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: @@ -961,11 +851,6 @@ adventures: 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 @@ -990,10 +875,7 @@ adventures: {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} @@ -1030,19 +912,7 @@ adventures: 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: @@ -1057,11 +927,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1101,26 +966,6 @@ adventures: 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 @@ -1149,27 +994,6 @@ adventures: 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 @@ -1202,31 +1026,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1256,9 +1055,7 @@ adventures: 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?' @@ -1315,36 +1112,6 @@ adventures: 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 @@ -1494,7 +1261,6 @@ adventures: Per provar el codi tan sols has de fer clic al botó 'Executa' sota el bloc de programació. Estàs llest?, ves a la següent pestanya per aprendre la teva primera comanda. - start_code: '{print} hola món!' 2: story_text: | Enhorabona! Has arribat al nivell 2. Segurament ja has fet codis genials! @@ -1517,14 +1283,12 @@ adventures: Això canvia al nivell 2. Al nivell 2 aprendràs a treballar amb variable que et permetran guardar múltiples peces d'informació i imprimir-les a qualsevol lloc que vulguis. Som-hi!, anem a la següent pestanya! - start_code: '{print} hola món!' 3: story_text: | Al nivell anterior has après què és una variable i com la pots utilitzar per fer les teves aventures de forma més interactiva. Però... Hi ha moltes més coses a fer amb les variables! També pots utilitzar les variables per fer llistes. Fins i tot pots deixar que Hedy esculli una paraula aleatòria d'una llista, permetent-nos fer jocs reals! Fes-hi una ullada a la següent pestanya! - start_code: '{print} hola món!' 4: story_text: | Als nivells anteriors has estat practicant amb les variables, i segurament t'has trobat amb el següent problema. @@ -1544,9 +1308,6 @@ adventures: nom {is} Sofia {print} El meu nom és nom ``` - start_code: | - nom {is} Sofia - {print} El meu nom és nom 5: story_text: | Als nivells anteriors has après a fer servir `{at} {random}` que feia que els jocs fossin diferents a cada execució. @@ -1558,9 +1319,6 @@ adventures: ``` contrasenya {is} {ask} 'Quina és la contrassenya correcta?' ``` - start_code: |- - nom {is} {ask} 'Quin és el teu nom?' - {if} nom {is} Hedy {print}'súper!' {else} {print} 'meh' 6: story_text: | Al nivell anterior has practicat amb `{ask}` i `{if}`. Ara per exemple pots preguntar als convidats què volen per menjar. @@ -1585,7 +1343,6 @@ adventures: preu_total {is} preu_menjar + preu_beguda {print} 'Seran ' preu_total ' euros, siusplau' ``` - start_code: '# situa el teu codi aquí' 7: story_text: | Bona feina! Has superat el nivell. Significa que has practicat amb les comandes `{if}` i `{else}`. Probablement, hauràs notat que el teu codi és cada vegada més llarg. @@ -1599,11 +1356,6 @@ adventures: {print} 'et desitjem tots Hedy' {print} 'moltes felicitats' ``` - start_code: | - {print} 'moltes felicitats' - {print} 'moltes felicitats' - {print} 'et desitgem tots Hedy' - {print} 'moltes felicitats' 8: story_text: | Ja has après com repetir una sola línia de codi. Això pot ser molt útil, però no sempre suficient. A vegades pots voler repetir múltiples línies de cop. @@ -1627,7 +1379,6 @@ adventures: {print} 'Hurra!' {else} {print} 'Potser hauràs de repassar el nivell anterior...' - start_code: '{print} Anem a la següent pestanya!' 10: story_text: | Ho estàs fent molt bé! Als nivells anteriors ens hem trobat amb un petit problema. Has après a repetir línies, però què passa si vols fer petits canvis a la línia. @@ -1661,7 +1412,6 @@ adventures: print 'Has demanat una hamburguesa i una beguda ' print 'Costa ' total ' euros, siusplau' ``` - start_code: '{print} ''Endavant!, cap a la següent pestanya!''' 13: story_text: | Als nivells anteriors has après a posar dues comandes `{if}`, una dins d'una altra. Això funciona bé, però fa que els codis siguin llargs i poc pràctics com aquest: @@ -1698,12 +1448,6 @@ adventures: {else} {print} 'Perfecte! Has aprovat!' ``` - start_code: | - resposta = {ask} 'Vols aprendre més?' - {if} resposta == 'sí' - {print} 'Continua amb la següent aventura!' - {if} resposta != 'sí' - {print} 'Oh.. quina pena!' 15: story_text: | Pel joc de baix s'ha preparat el codi per assegurar-se que el jugador pot jugar tanta estona com vulgui ... @@ -1750,7 +1494,6 @@ adventures: En aquest nivell també pots utilitzar una comanda nova: `{elif}`. `{elif}` és una abreviatura de {else} {if} i és molt útil per a quan vols fer 3 (o més!) opcions. Comprova-ho! - start_code: '{print} ''Endavant!, cap a la següent pestanya!''' 18: story_text: | L'enhorabona! Has assolit l'últim nivell de Hedy! El codi has creat aquí pot ser copiat a entorns reals de Python com replit o PyCharm, i pots continuar aprenent allà! @@ -1782,12 +1525,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1801,7 +1542,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1821,7 +1561,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1833,7 +1572,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1846,7 +1584,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1871,7 +1608,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1889,7 +1625,6 @@ adventures: ``` story_text_2: | 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: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1905,7 +1640,6 @@ adventures: {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. @@ -1913,7 +1647,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1946,7 +1679,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1955,7 +1687,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1966,7 +1697,6 @@ adventures: _ day _ days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -2014,10 +1744,6 @@ adventures: {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: |- 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. @@ -2029,10 +1755,6 @@ adventures: {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: 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. @@ -2072,7 +1794,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2090,7 +1811,6 @@ adventures: 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. @@ -2115,7 +1835,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2128,7 +1847,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2163,7 +1881,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2175,7 +1892,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2195,7 +1911,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2211,7 +1926,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2223,7 +1937,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2263,21 +1976,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2306,13 +2004,6 @@ adventures: {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. @@ -2336,17 +2027,6 @@ adventures: 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 @@ -2375,7 +2055,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2397,7 +2076,6 @@ adventures: _ {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 @@ -2427,7 +2105,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2474,7 +2151,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2490,7 +2166,6 @@ adventures: {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. @@ -2512,7 +2187,6 @@ adventures: _ _ _ _ {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! @@ -2541,7 +2215,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2570,7 +2243,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2599,7 +2271,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2633,7 +2304,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2664,18 +2334,7 @@ adventures: {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?' @@ -2714,10 +2373,6 @@ adventures: _ _ _ 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... @@ -2734,11 +2389,6 @@ adventures: {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. @@ -2754,16 +2404,6 @@ adventures: {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 @@ -2792,11 +2432,6 @@ adventures: _ 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: comanda_es @@ -2818,10 +2453,6 @@ adventures: En el codi d'exemple hem fet un exemple de la variable `animals_preferits`. A la línia 1 es defineix la variable, i a la línia 2 hem utilitzat la variable dins una comanda d'impressió. En primer lloc, acabeu el nostre exemple omplint el vostre animal preferit als espais en blanc. A continuació, feu vosaltres mateixos almenys 3 d'aquests codis. Trieu una variable i configureu-la amb la comanda {is}. A continuació, utilitzeu-lo amb una comanda {print}, tal com hem fet abans. example_code_2: "```\nanimals_preferits {is} _\n{print} M'agraden els/les animals_preferits \n```\n" - start_code: |- - nom {is} Hedy - edat {is} 15 - {print} nom té edat anys 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: @@ -2830,8 +2461,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2863,8 +2493,7 @@ adventures: {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} @@ -2890,7 +2519,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2911,7 +2539,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2951,8 +2578,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Lloro @@ -2978,11 +2604,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Im Hedy the parrot - {ask} What is your name? - {echo} - {echo} 2: story_text: | Create your own online pet parrot that will copy you! @@ -2999,7 +2620,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3014,7 +2634,6 @@ adventures: {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}`. @@ -3028,7 +2647,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3045,7 +2663,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3066,7 +2683,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3090,7 +2706,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3119,7 +2734,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3132,7 +2746,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3152,7 +2765,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3178,8 +2790,6 @@ adventures: ``` _ Hola! ``` - start_code: | - {print} Benvingut a Hedy! 18: story_text: |- Hem arribat al codi Python real! Això vol dir que hem d'utilitzar parèntesis amb `{print}` i `{range}` d'ara endavant. @@ -3196,8 +2806,7 @@ adventures: temperatura = 25 {print}('Fa ', temperatura , " graus a l'exterior") ``` - start_code: |- - nom = 'Hedy' + {print}('Em dic ', nom) quizmaster: name: Quizmaster @@ -3229,7 +2838,6 @@ adventures: {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 @@ -3259,10 +2867,6 @@ adventures: {print} 'Amb l'Anna hem d'anar a fer de cangur als meus nebots' {print} 'M'encanta! la meva germana n'estarà orgullosa' ``` - 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 12: story_text: | **All texts need to be in quotation marks** @@ -3297,10 +2901,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3334,9 +2934,6 @@ adventures: 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. @@ -3385,11 +2982,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3403,10 +2995,6 @@ adventures: {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! @@ -3421,13 +3009,6 @@ adventures: {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 @@ -3453,10 +3034,6 @@ adventures: 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? @@ -3474,11 +3051,6 @@ adventures: _ {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 @@ -3498,7 +3070,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3515,7 +3086,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3549,7 +3119,6 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - 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. @@ -3569,7 +3138,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3590,7 +3158,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3609,7 +3176,6 @@ adventures: {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. @@ -3624,7 +3190,6 @@ adventures: {repeat} _ {times} food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3642,7 +3207,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3675,7 +3239,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3723,7 +3286,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3745,7 +3307,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3760,7 +3321,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3777,7 +3337,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3804,9 +3363,6 @@ adventures: {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! @@ -3815,7 +3371,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3837,12 +3392,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3862,7 +3415,6 @@ 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. Can you finish the code? @@ -3882,7 +3434,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3894,7 +3445,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3913,7 +3463,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3936,7 +3485,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3953,7 +3501,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3980,7 +3527,6 @@ adventures: b = 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3993,7 +3539,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -4009,10 +3554,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4050,7 +3591,6 @@ adventures: {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: @@ -4068,7 +3608,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In this level you can repeat the song 99 times, just by adding one simple line! @@ -4083,7 +3622,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4144,7 +3682,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting, like the 5 little monkeys. @@ -4162,7 +3699,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4181,7 +3717,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4198,16 +3733,6 @@ adventures: {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. @@ -4243,7 +3768,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4265,7 +3789,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4287,15 +3810,6 @@ adventures: {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 @@ -4363,7 +3877,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4426,7 +3939,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4488,7 +4000,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4575,7 +4086,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4599,9 +4109,6 @@ adventures: {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. @@ -4627,11 +4134,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4644,10 +4146,6 @@ adventures: {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! @@ -4674,11 +4172,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4711,12 +4204,6 @@ adventures: 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. @@ -4740,7 +4227,6 @@ adventures: {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. @@ -4783,7 +4269,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4801,7 +4286,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4826,16 +4310,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4851,7 +4325,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4862,7 +4335,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4873,7 +4345,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4891,7 +4362,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4910,7 +4380,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4930,7 +4399,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4941,7 +4409,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4954,7 +4421,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4985,7 +4451,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5026,7 +4491,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5049,7 +4513,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5078,7 +4541,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5102,7 +4564,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5130,7 +4591,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5164,7 +4624,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5184,11 +4643,6 @@ adventures: 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 @@ -5206,4 +4660,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/cs.yaml b/content/adventures/cs.yaml index 3cabef4e061..a24552b7f95 100644 --- a/content/adventures/cs.yaml +++ b/content/adventures/cs.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Můžete nyní vytvořit svůj vlastní příběh v Hedy pomocí `{print}` , `{ask}` a `{echo}`? - start_code: '{print} Váš příběh začíná zde' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -49,7 +48,6 @@ adventures: 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: @@ -78,7 +76,6 @@ adventures: 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? @@ -93,7 +90,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -116,7 +112,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -127,7 +122,6 @@ adventures: {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! @@ -145,7 +139,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -181,7 +173,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -190,7 +181,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -220,7 +210,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {else} {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +515,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -569,7 +533,6 @@ adventures: 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! @@ -586,7 +549,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -602,7 +564,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -612,7 +573,6 @@ adventures: number2 = {ask} 'What is the second number?' answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -629,7 +589,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -654,11 +613,7 @@ adventures: 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 @@ -690,7 +645,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -739,17 +693,6 @@ adventures: 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 @@ -772,12 +715,6 @@ adventures: {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. @@ -797,14 +734,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -826,16 +755,6 @@ adventures: 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 @@ -850,13 +769,6 @@ adventures: {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 @@ -879,17 +791,7 @@ adventures: {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' @@ -916,19 +818,7 @@ adventures: 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: @@ -944,11 +834,6 @@ adventures: 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 @@ -973,10 +858,7 @@ adventures: {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} @@ -1013,19 +895,7 @@ adventures: 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: @@ -1040,11 +910,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1084,26 +949,6 @@ adventures: 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 @@ -1132,27 +977,6 @@ adventures: 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 @@ -1185,31 +1009,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1239,9 +1038,7 @@ adventures: 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?' @@ -1298,36 +1095,6 @@ adventures: 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 @@ -1473,7 +1240,6 @@ adventures: 1: story_text: "V první úrovni můžeš používat příkazy `{print}`, `{ask}` a `{echo}`.\n Zapiš svůj kód do levého okna. Nebo stiskni žluté tlačítko v ukázce kódu, které kód zapíše za tebe.\nKód si vždy vyzkoušej pomocí zeleného tlačítka 'Spustit kód' pod levým programovým polem.\n\nMůžeš vypsat\ \ text na obrazovku užitím příkazu `{print}`. \n" - start_code: '{print} Ahoj světe!' 2: story_text: |- Ve 2. úrovni se naučíme něco nového. Odteď můžeš pojmenovat slovo za pomoci `is`. @@ -1495,7 +1261,6 @@ adventures: ``` story_text_2: | `{print}` funguje stále stejně, ale příkaz `{ask}` se změnil. I u příkazu `{ask}` musíš použít proměnnou. Bude to vypadat takhle: - start_code: '{print} Ahoj světe!' 3: story_text: |- V úrovni 3 můžeš také vytvořit seznam. Počítač umí z tohoto seznamu vybrat náhodného člena, konkrétně pomocí příkazu `at random`. @@ -1505,7 +1270,6 @@ adventures: ``` Všechny kódy úrovně 3 najdeš v levém panelu. Opět tady jsou i záložky s dalšími zadáními. - start_code: '{print} Ahoj světe!' 4: story_text: | V úrovni 4 se mění `{ask}` a `{print}`. @@ -1514,7 +1278,6 @@ adventures: Většina programovacích jazyků také používá při vypisování uvozovky, takže se dostáváme zase o krok blíže ke skutečnému programování! example_code: | ```{print} 'Odteď musíte používat uvozovky!'\nodpověď {is} {ask} 'Co musíme od teď používat?'\n{print} 'Musíme používat ' odpověď\n```\n" - start_code: '{print} ''Ahoj světe!''' 5: story_text: | V úrovni 5 je něco nového, `{if}`! S `{if}` si můžete vybrat ze dvou různých možností. @@ -1526,9 +1289,6 @@ adventures: jméno {is} {ask} 'jak se jmenuješ?' {if} jméno {is} Hedy {print} 'Pěkně!' {else} {print} 'Fůj!' ``` - start_code: |- - jméno {is} {ask} 'Jak se jmenuješ?' - {if} jméno {is} Hedy {print} 'Super!' {else} {print} 'Hm.' 6: story_text: |- `ask`,` print` a `if` stále fungují jako na úrovních 5. @@ -1558,7 +1318,6 @@ adventures: ``` repeat 3 times print 'Hedy je zábavná!' ``` - start_code: repeat 3 times print 'Hedy je zábavná!' 8: story_text: | `ask` a `print` stále fungují tak, jak je znáš. Ale `if` a `repeat` se změnily! @@ -1577,10 +1336,6 @@ adventures: {print} 'Hello everyone' {print} 'This is all repeated 5 times' ``` - start_code: |- - repeat 5 times - print 'Ahojte, kamarádi' - print 'Toto se vypíše 5krát' 9: story_text: | In this level you can not only use multiple lines with `if` and `repeat`, but you can also put them together! @@ -1604,13 +1359,6 @@ adventures: else {print} 'pizza is better' ``` - start_code: |- - {repeat} 3 {times} - jídlo = {ask} 'Co budeš chtít?' - {if} jídlo {is} pizza - {print} 'dobré!' - {else} - {print} 'pizza je lepší' 10: story_text: | In this level we learn a new code called `for`. With `for` you can make a list and use all elements. @@ -1627,17 +1375,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals is 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. 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: |- - for pocitadlo in range 1 to 5 - print pocitadlo 12: story_text: Hedy doteď neumožňovala používat čísla s desetinami jako je 1.5, ale odteď už ano. Pozor, Hedy používá desetinnou tečku `.` namísto desetinné čárky. example_code: | @@ -1645,8 +1386,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - print 'decimal numbers now need to use a dot' + print 2.5 + 2.5 13: story_text: Teď se naučíme `and` (česky a) a `or` (nebo)! Když chceš ověřit dvě podmínky, nemusíš k tomu použít dva `if`y, ale stačí ti k tomu `and` a `or`. Pokud použiješ `and`, musí být obě podmínky, napravo i nalevo, pravdivé. S `or` stačí, aby byla pravdivá alespoň jedna z nich. @@ -1657,11 +1397,6 @@ adventures: 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!' 14: story_text: |- Pojďme se naučit pár nových věcí! Možná už je znáš z matematiky, jde o `<` a `>`. @@ -1673,8 +1408,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - vek = ask 'Kolik je ti let?' + if vek < 13 print 'Jsi mladší než já!' else @@ -1688,9 +1422,7 @@ adventures: answer = ask 'What is 5 times 5?' print 'A correct answer has been given' ``` - start_code: |- - odpoved = 0 - while odpoved != 25 + odpoved = ask 'Kolik je 5 * 5?' print 'Dostala jsem správnou odpověď!' 16: @@ -1715,9 +1447,8 @@ adventures: print i print 'Už jdu!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dice @@ -1745,12 +1476,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1764,7 +1493,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1782,7 +1510,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1794,7 +1521,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1806,7 +1532,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1831,7 +1556,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1857,7 +1581,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1873,7 +1596,6 @@ adventures: {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. @@ -1886,7 +1608,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1919,7 +1640,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1928,7 +1648,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1939,7 +1658,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1987,10 +1705,6 @@ adventures: {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: |- 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. @@ -2002,10 +1716,6 @@ adventures: {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: 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. @@ -2051,7 +1761,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2073,7 +1782,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2094,7 +1802,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2107,7 +1814,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2138,7 +1844,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2161,7 +1866,6 @@ adventures: Can you do it? In the upcoming levels the layout of {repeat} command will change, which enables you to repeat multiple lines at once. - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2178,7 +1882,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2194,7 +1897,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2206,7 +1908,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2246,21 +1947,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2289,13 +1975,6 @@ adventures: {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. @@ -2319,17 +1998,6 @@ adventures: 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 @@ -2358,7 +2026,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2380,7 +2047,6 @@ adventures: _ {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 @@ -2410,7 +2076,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2468,7 +2133,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2484,7 +2148,6 @@ adventures: {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. @@ -2503,7 +2166,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2531,7 +2193,6 @@ adventures: ### Exercise Now it's very hard to win this game, can you make it easier to win? For example by only having 1 wrong door and 2 correct doors instead of 1 correct door en 2 wrong ones? - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2557,7 +2218,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2586,7 +2246,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2620,7 +2279,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2651,18 +2309,7 @@ adventures: {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?' @@ -2701,10 +2348,6 @@ adventures: _ _ _ 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... @@ -2721,11 +2364,6 @@ adventures: {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. @@ -2741,16 +2379,6 @@ adventures: {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 @@ -2779,11 +2407,6 @@ adventures: _ 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 @@ -2809,10 +2432,6 @@ adventures: 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: @@ -2821,8 +2440,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2854,8 +2472,7 @@ adventures: {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} @@ -2888,7 +2505,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2909,7 +2525,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2949,8 +2564,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Papoušek @@ -2975,7 +2589,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Jsem papoušek Hedy' 2: story_text: | Vytvořte si svého vlastního online mazlíčka papouška, který vás bude kopírovat! @@ -2992,7 +2605,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3005,7 +2617,6 @@ adventures: {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}`. @@ -3019,7 +2630,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -3035,7 +2645,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3054,7 +2663,6 @@ adventures: to_save = price - saved weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3078,7 +2686,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3107,7 +2714,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3120,7 +2726,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3140,7 +2745,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3166,8 +2770,6 @@ adventures: ``` _ 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. @@ -3184,8 +2786,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3217,7 +2818,6 @@ adventures: {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 @@ -3247,10 +2847,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3285,10 +2881,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3322,9 +2914,6 @@ adventures: 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. @@ -3373,11 +2962,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3391,10 +2975,6 @@ adventures: {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! @@ -3409,13 +2989,6 @@ adventures: {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 @@ -3441,10 +3014,6 @@ adventures: 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? @@ -3462,11 +3031,6 @@ adventures: _ {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: Restaurace default_save_name: Restaurace @@ -3485,7 +3049,6 @@ adventures: ``` story_text_2: | Napadá vás více řádků, které můžete přidat do kódu restaurace? Můžete se například hostů {ask}, co by si přáli k pití, říct jim cenu nebo jim popřát dobrou chuť? - start_code: '# Vložte svůj kód zde' 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. @@ -3505,7 +3068,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3537,7 +3099,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: |- In this level you have to use quotation marks when using the `{print}` command. @@ -3557,7 +3118,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3581,7 +3141,6 @@ adventures: ### Exercise Can you think of more questions to {ask} the customers when they are ordering, and make up different responses to their answers by using the {if} command? - start_code: '# place your code here' 6: 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. @@ -3600,7 +3159,6 @@ adventures: {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. @@ -3619,7 +3177,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3640,7 +3197,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3668,7 +3224,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3710,7 +3265,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3729,7 +3283,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3744,7 +3297,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3761,7 +3313,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Kámen, nůžky, papír default_save_name: Kámen @@ -3788,7 +3339,6 @@ adventures: {ask} Tvá volba from _ {echo} Tak tvá volba byla: ``` - start_code: '{print} Vítejte ve svém vlastním kámen, nůžky, papír!' 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! @@ -3797,7 +3347,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3819,12 +3368,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3844,7 +3391,6 @@ 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. Can you finish the code? @@ -3863,7 +3409,6 @@ adventures: {if} your_choice {is} 'scissors' {print} 'You lose!' ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3874,7 +3419,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3892,7 +3436,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3913,7 +3456,6 @@ adventures: {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 @@ -3930,7 +3472,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3954,7 +3495,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3967,7 +3507,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3983,10 +3522,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4020,7 +3555,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -4038,7 +3572,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -4052,7 +3585,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4104,7 +3636,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4119,7 +3650,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4134,7 +3664,6 @@ adventures: {print} '{if} youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4151,16 +3680,6 @@ adventures: {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. @@ -4224,7 +3743,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4246,7 +3764,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4268,15 +3785,6 @@ adventures: {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 @@ -4345,7 +3853,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4408,7 +3915,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4470,7 +3976,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4557,7 +4062,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Želva default_save_name: Želva @@ -4578,9 +4082,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} left 2: story_text: | V této úrovni můžete použít proměnné, aby byla želva interaktivní. Například se můžete zeptat hráče, kolik kroků má želva udělat. @@ -4604,11 +4105,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Želví závod! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | V této úrovni můžete použít příkaz `{at} {random}` s kreslící želvou. Náhodná hodnota způsobí, že želva půjde pokaždé jinou cestou. @@ -4619,10 +4115,6 @@ adventures: {turn} angles {at} {random} {forward} 25 ``` - start_code: |- - angles {is} 10, 50, 90, 150, 250 - {turn} angles {at} {random} - {forward} 25 4: story_text: | Ve čtvrté úrovni musíte i při kreslení používat uvozovky s příkazy `{print}` a `{ask}`! @@ -4649,11 +4141,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Kreslení obrazce' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | V páté úrovni můžete provést volbu pomocí příkazu `{if}`. Například mezi různými typy obrazců. @@ -4686,12 +4173,6 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: |- - {print} 'Kreslení obrazce' - figure {is} {ask} 'Chcete nakreslit čtverec nebo trojúhelník?' - {if} figure {is} triangle angle {is} 120 {else} angle {is} 90 - {turn} angle - {forward} 25 6: story_text: | V této úrovni můžete pomocí výpočtů kreslit různé obrazce. @@ -4715,7 +4196,6 @@ adventures: {forward} 50 {turn} angle ``` - start_code: '{print} ''Kreslení obrazce''' 8: story_text: | Nyní, když můžeme opakovat několik řádků, můžeme snadněji vytvářet obrazce. @@ -4738,8 +4218,6 @@ adventures: {turn} _ {forward} _ ``` - start_code: | - hoeken = {ask} 'How many angles should I draw?' 9: story_text: | Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures. @@ -4759,7 +4237,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4777,7 +4254,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4802,16 +4278,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4827,7 +4293,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4838,7 +4303,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4849,7 +4313,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4867,7 +4330,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4886,7 +4348,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4906,7 +4367,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4917,7 +4377,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4930,7 +4389,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4961,7 +4419,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5002,7 +4459,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5025,7 +4481,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5054,7 +4509,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5078,7 +4532,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5106,7 +4559,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5140,7 +4592,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5160,11 +4611,6 @@ adventures: 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 @@ -5182,4 +4628,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/cy.yaml b/content/adventures/cy.yaml index 847a570f7a9..063f99373a3 100644 --- a/content/adventures/cy.yaml +++ b/content/adventures/cy.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -52,7 +51,6 @@ adventures: 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: @@ -84,7 +82,6 @@ adventures: 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. @@ -99,7 +96,6 @@ adventures: {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. @@ -123,7 +119,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -137,7 +132,6 @@ adventures: {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! @@ -158,7 +152,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put `{if}`, `{repeat}` or `{for}` commands inside other `{if}`, `{repeat}` or `{for}` commands. This gives you many options and really helps you to make your story interactive. @@ -177,7 +170,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -194,7 +186,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -202,7 +193,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -235,7 +225,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -258,7 +247,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -279,7 +267,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -319,13 +306,6 @@ adventures: _ {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 @@ -343,11 +323,6 @@ adventures: {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 @@ -380,10 +355,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -411,11 +382,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -527,7 +493,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -564,7 +529,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In level 6 you created a calculator, in this level you can expand that code so it asks multiple questions. @@ -589,7 +553,6 @@ adventures: 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! @@ -607,7 +570,6 @@ adventures: {else} {print} 'That is wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -623,7 +585,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | In this level, you can make a calculator that works for decimal numbers. @@ -642,7 +603,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' _ ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -659,7 +619,6 @@ adventures: {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. @@ -684,11 +643,7 @@ adventures: 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 @@ -720,7 +675,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -769,17 +723,6 @@ adventures: 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 @@ -802,12 +745,6 @@ adventures: {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. @@ -827,14 +764,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -856,16 +785,6 @@ adventures: 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 @@ -880,13 +799,6 @@ adventures: {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 @@ -909,17 +821,7 @@ adventures: {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' @@ -946,19 +848,7 @@ adventures: 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: @@ -974,11 +864,6 @@ adventures: 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 @@ -1003,10 +888,7 @@ adventures: {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} @@ -1043,19 +925,7 @@ adventures: 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: @@ -1070,11 +940,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1114,26 +979,6 @@ adventures: 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 @@ -1162,27 +1007,6 @@ adventures: 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 @@ -1215,31 +1039,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1269,9 +1068,7 @@ adventures: 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?' @@ -1328,36 +1125,6 @@ adventures: 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 @@ -1503,7 +1270,6 @@ adventures: 1: story_text: "In Level 1 you can use the commands `{print}`, `{ask}` and `{echo}`.\n Type your code in the programming field. Or press the green button in the example code block, and the code will be typed for you!\nTry the code yourself with the green 'Run code' button under the programming\ \ field.\n\nYou can print text to the screen using the `{print}` command. \n" - start_code: '{print} helo byd!' 2: story_text: | In level 2 we learn two new commands: `{is}` and `{sleep}`. @@ -1518,11 +1284,9 @@ adventures: ``` story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: '{print} hello world!' 3: story_text: | In level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`. - start_code: '{print} hello world!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1538,7 +1302,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Hello world''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1549,9 +1312,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - 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. @@ -1574,7 +1334,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}`, `{else}`, {pressed} and `{repeat}` have changed! @@ -1598,10 +1357,6 @@ adventures: {print} 'INTRUDER!' {print} 'You cannot use this computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1616,13 +1371,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1633,17 +1381,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1653,8 +1394,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1666,11 +1406,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1685,8 +1420,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1705,11 +1439,6 @@ adventures: 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' 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. @@ -1739,9 +1468,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1769,7 +1497,6 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level you can also create dice. But this time you can try it yourself, without an example code! @@ -1777,7 +1504,6 @@ adventures: ### 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! @@ -1793,7 +1519,6 @@ adventures: _ 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. @@ -1813,7 +1538,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a dice again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1825,7 +1549,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the dice indicate this time?''' 10: story_text: "Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once!\n\n### Exercise \nChange the names into names of your friends or family, and finish the code so they each roll.\n" example_code: | @@ -1836,7 +1559,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1861,7 +1583,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1879,7 +1600,6 @@ adventures: ``` story_text_2: | 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: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1895,7 +1615,6 @@ adventures: {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. @@ -1903,7 +1622,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1936,7 +1654,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1945,7 +1662,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1956,7 +1672,6 @@ adventures: _ day _ days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -2004,10 +1719,6 @@ adventures: {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: |- 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. @@ -2019,10 +1730,6 @@ adventures: {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: 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. @@ -2061,7 +1768,6 @@ adventures: ### Exercise Copy the example code into your inputscreen 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: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only `{echo}`. @@ -2079,7 +1785,6 @@ adventures: 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. @@ -2104,7 +1809,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2117,7 +1821,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2152,7 +1855,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2164,7 +1866,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2184,7 +1885,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 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. @@ -2203,7 +1903,6 @@ adventures: {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. @@ -2218,7 +1917,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2258,21 +1956,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2301,13 +1984,6 @@ adventures: {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. @@ -2331,17 +2007,6 @@ adventures: 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 @@ -2370,7 +2035,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2392,7 +2056,6 @@ adventures: _ {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 @@ -2424,7 +2087,6 @@ adventures: 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. @@ -2471,7 +2133,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2493,7 +2154,6 @@ adventures: {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. @@ -2515,7 +2175,6 @@ adventures: _ _ _ _ {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" @@ -2540,7 +2199,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - 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\ @@ -2553,7 +2211,6 @@ adventures: {print} 'Room ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2582,7 +2239,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2616,7 +2272,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2647,18 +2302,7 @@ adventures: {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?' @@ -2697,10 +2341,6 @@ adventures: _ _ _ 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... @@ -2717,11 +2357,6 @@ adventures: {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. @@ -2737,16 +2372,6 @@ adventures: {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 @@ -2775,11 +2400,6 @@ adventures: _ 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 @@ -2805,10 +2425,6 @@ adventures: 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: @@ -2817,8 +2433,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2850,8 +2465,7 @@ adventures: {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} @@ -2877,7 +2491,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2898,7 +2511,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2938,8 +2550,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2965,7 +2576,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2982,7 +2592,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2997,7 +2606,6 @@ adventures: {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}`. @@ -3011,7 +2619,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3028,7 +2635,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3052,7 +2658,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3076,7 +2681,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3105,7 +2709,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3118,7 +2721,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3138,7 +2740,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3164,8 +2765,6 @@ adventures: ``` _ 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. @@ -3182,8 +2781,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3215,7 +2813,6 @@ adventures: {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 @@ -3245,10 +2842,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3283,10 +2876,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3320,9 +2909,6 @@ adventures: 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. @@ -3371,11 +2957,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3389,10 +2970,6 @@ adventures: {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! @@ -3407,13 +2984,6 @@ adventures: {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 @@ -3439,10 +3009,6 @@ adventures: 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? @@ -3460,11 +3026,6 @@ adventures: _ {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 @@ -3488,7 +3049,6 @@ adventures: 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. @@ -3513,7 +3073,6 @@ adventures: 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: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3541,7 +3100,6 @@ adventures: 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. @@ -3564,7 +3122,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3585,7 +3142,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3604,7 +3160,6 @@ adventures: {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. @@ -3618,7 +3173,6 @@ adventures: {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: @@ -3637,7 +3191,6 @@ adventures: ### 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 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)**\ @@ -3664,7 +3217,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily ask orders for different courses. @@ -3703,7 +3255,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3725,7 +3276,6 @@ adventures: 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. @@ -3749,7 +3299,6 @@ adventures: {print} 'That is a healthy choice' {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3766,7 +3315,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3793,7 +3341,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3802,7 +3349,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3824,12 +3370,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3849,7 +3393,6 @@ 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. Can you finish the code? @@ -3869,7 +3412,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3881,7 +3423,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3900,7 +3441,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3923,7 +3463,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3940,7 +3479,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3967,7 +3505,6 @@ adventures: b = 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3980,7 +3517,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3996,10 +3532,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4037,7 +3569,6 @@ adventures: 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: @@ -4055,7 +3586,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In this level you can repeat the song 99 times, just by adding one simple line! @@ -4070,7 +3600,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4131,7 +3660,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting, like the 5 little monkeys. @@ -4149,7 +3677,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4168,7 +3695,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4185,16 +3711,6 @@ adventures: {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. @@ -4230,7 +3746,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4252,7 +3767,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4274,15 +3788,6 @@ adventures: {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 @@ -4318,7 +3823,6 @@ adventures: {else} player = 'x' ``` - start_code: '# Write your code here' 14: 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. @@ -4381,7 +3885,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4443,7 +3946,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4530,7 +4032,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4554,9 +4055,6 @@ adventures: {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. @@ -4582,11 +4080,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4599,10 +4092,6 @@ adventures: {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! @@ -4629,11 +4118,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4666,12 +4150,6 @@ adventures: 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. @@ -4695,7 +4173,6 @@ adventures: {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. @@ -4738,7 +4215,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4756,7 +4232,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4781,16 +4256,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4806,7 +4271,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4817,7 +4281,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4828,7 +4291,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4846,7 +4308,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4865,7 +4326,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4885,7 +4345,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4896,7 +4355,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4909,7 +4367,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4940,7 +4397,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4981,7 +4437,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5004,7 +4459,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5033,7 +4487,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5057,7 +4510,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5085,7 +4537,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5119,7 +4570,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5139,11 +4589,6 @@ adventures: 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 @@ -5161,4 +4606,3 @@ adventures: {print} number {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/da.yaml b/content/adventures/da.yaml index a3132a6e4b5..a3e68f74834 100644 --- a/content/adventures/da.yaml +++ b/content/adventures/da.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Opgave Kan du lave din egen historie i Hedy nu og ved at bruge `{print}` , `{ask}` og `{echo}`? - start_code: '{print} Din historie starter her' 2: story_text: | På niveau 2 kan du gøre din historie sjovere. Din hovedperson kan nu være hvor som helst i sætningen. @@ -52,7 +51,6 @@ adventures: 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} Din historie' 3: story_text: | På niveau 3 kan du gøre din historie endnu sjovere. Du kan bruge tilfældighed til et monster, dyr eller anden forhindring, sådan her: @@ -84,7 +82,6 @@ adventures: efterlad {is} {ask} Hvilken ting skal han efterlade? {remove} efterlad {from} taske ``` - start_code: '{print} Din historie' 4: story_text: | Du har måske lagt mærke til at der stadig er et problem i de tidligere niveauer. Prøvede du at printe en sætning med ordet navn? i.e. `{print}` mit navn er navn. @@ -99,7 +96,6 @@ adventures: {print} _ Han hører lyden af _ dyr {at} {random} {print} navn _ er bange for at det er en hjemsøgt skov _ ``` - start_code: '{print} ''Din historie vil blive printet her!''' 5: story_text: | På dette niveau kan du programmere forskellige slutninger, hvilket vil gøre din historie endnu sjovere. @@ -123,7 +119,6 @@ adventures: {if} slutning {is} lykkelig {print} navn ' griber sit sværd og monstret løber hurtigt sin vej' {else} {print} 'Monstret æder ' navn ``` - start_code: '{print} ''Her begynder din historie!''' 7: story_text: | I en historie, gentages nogle ord flere gange. For eksempel, når nogen råber på hjælp eller synger en sang. @@ -138,7 +133,6 @@ adventures: {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! @@ -159,7 +153,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put `{if}`, `{repeat}` or `{for}` commands inside other `{if}`, `{repeat}` or `{for}` commands. This gives you many options and really helps you to make your story interactive. @@ -178,7 +171,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -195,7 +187,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -203,7 +194,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -236,7 +226,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -259,7 +248,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -280,7 +268,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -320,13 +307,6 @@ adventures: _ {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 @@ -344,11 +324,6 @@ adventures: {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 @@ -381,10 +356,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -412,11 +383,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -528,7 +494,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -565,7 +530,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. @@ -586,7 +550,6 @@ adventures: 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! @@ -604,7 +567,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -620,7 +582,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -631,7 +592,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -648,7 +608,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -673,11 +632,7 @@ adventures: 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 @@ -709,7 +664,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -758,17 +712,6 @@ adventures: 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 @@ -791,12 +734,6 @@ adventures: {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. @@ -816,14 +753,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -845,16 +774,6 @@ adventures: 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 @@ -869,13 +788,6 @@ adventures: {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 @@ -898,17 +810,7 @@ adventures: {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' @@ -935,19 +837,7 @@ adventures: 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: @@ -963,11 +853,6 @@ adventures: 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 @@ -992,10 +877,7 @@ adventures: {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} @@ -1032,19 +914,7 @@ adventures: 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: @@ -1059,11 +929,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1103,26 +968,6 @@ adventures: 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 @@ -1151,27 +996,6 @@ adventures: 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 @@ -1204,31 +1028,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1258,9 +1057,7 @@ adventures: 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?' @@ -1317,36 +1114,6 @@ adventures: 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 @@ -1492,7 +1259,6 @@ adventures: 1: story_text: "På niveau 1 kan do bruge kommandoerne `{print}`, `{ask}` og `{echo}`.\n Skriv din programkode i programmeringsfeltet. Eller tryk på den grønne knap i kodeeksemplet, og koden vil blive skrevet for dig!\nPrøv selv koden med den grønne 'Kør koden' knappen under programmeringsfeltet.\n\ \nDu kan printe tekst på skærmen ved at bruge `{print}` kommandoen. \n" - start_code: '{print} hej verden!' 2: story_text: | På niveau 2 lærer vi to nye kommandoer: `{is}` og `{sleep}`. @@ -1507,11 +1273,9 @@ adventures: ``` story_text_2: | `{print}` virker stadig på samme måde, men `{ask}` kommandoen har ændret sig. Du skal bruge en variabel sammen med `{ask}` kommandoen. Det ser sådan ud: - start_code: '{print} hej verden!' 3: story_text: | På niveau 3 kan du lave en liste. Du kan lade computeren vælge noget tilfældigt fra listen. Det kan du gøre med `{at} {random}`. - start_code: '{print} hej verden!' 4: story_text: | På niveau 4 har `{ask}` og `{print}` ændret sig. @@ -1527,7 +1291,6 @@ adventures: svar {is} {ask} 'Hvad er det du skal bruge fra nu af?' {print} 'Vi har brug for at bruge ' svar ``` - start_code: '{print} ''Hej verden''' 5: story_text: | På niveau 5 er der noget nyt, `{if}`! Med `{if}` kan du vælge mellem 2 forskellige muligheder. @@ -1538,9 +1301,6 @@ adventures: navn {is} {ask} 'hvad er dit navn?' {if} navn {is} Hedy {print} 'lækkert' {else} {print} 'buh!' ``` - start_code: |- - navn {is} {ask} 'hvad er dit navn?' - {if} navn {is} Hedy {print} 'fedt!' {else} {print} 'kedeligt' 6: story_text: | På dette niveau lærer du noget nyt: du kan nu også regne. @@ -1563,7 +1323,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy er sjovt!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy er sjovt!''' 8: story_text: | `{ask}` og`{print}` virker stadig som du kender dem. Men `{if}`, `{else}`, {pressed} og `{repeat}` har ændret sig! @@ -1587,10 +1346,6 @@ adventures: {print} 'ADVARSEL!' {print} 'Du må ikke bruge denne computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hej folkens' - {print} 'Dette vil blive printet 5 gange' 9: story_text: | På dette niveau må du kun bruge flere linjer med `{if}` og`{repeat}`, men du kan også sætte dem sammen! @@ -1605,13 +1360,6 @@ adventures: {else} {print} 'pizza er bedre' ``` - start_code: |- - {repeat} 3 {times} - mad = {ask} 'Hvad kunne do tænke dig?' - {if} mad {is} pizza - {print} 'lækkert!' - {else} - {print} 'pizza er bedre' 10: story_text: |- På dette niveau lærer vi en ny kommando der hedder `{for}`. Med `{for}` kan du lave en liste og bruge alle elementerne. @@ -1622,17 +1370,10 @@ adventures: {for} dyr {in} alle_dyr {print} 'Jeg elsker ' dyr ``` - start_code: |- - alle_dyr {is} hunde, katte, fisk - {for} dyr {in} alle_dyr - {print} 'Jeg elsker ' dyr 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: |- - {for} tæller {in} {range} 1 {to} 5 - {print} tæller 12: story_text: |- **Kommatal** @@ -1642,8 +1383,7 @@ adventures: {print} 'To og en halv plus to og en halv er..' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'kommatal skal nu bruge et punktum' + {print} 2.5 + 2.5 13: story_text: Vi skal nu lære `{and}` og `{or}`! Hvis du vil tjekke to udsagn, behøver du ikke bruge to {if} kommandoer men kan blot bruge `{and}` og `{or}`. Hvis du bruger `{and}`, skal begge udsagn, til højre og venstre for `{and}` være sande. Vi kan også bruge `{or}`. Så behøver kun et @@ -1655,11 +1395,6 @@ adventures: {if} navn {is} 'Hedy' {and} alder {is} 2 {print} 'Du er virkelig Hedy!' ``` - start_code: |- - navn = {ask} 'hvad hedder du?' - alder = {ask} 'hvor gammel er du?' - {if} navn {is} 'Hedy' {and} alder {is} 2 - {print} 'Du er virkelig Hedy!' 14: story_text: | Vi skal lære flere nye ting. Du kender dem måske allerede fra matematik, `<` og `>`. @@ -1674,8 +1409,7 @@ adventures: {if} alder > 12 {print} 'Du er ældre end mig!' ``` - start_code: |- - alder = {ask} 'Hvor gammel er du?' + {if} alder < 13 {print} 'Du er yngre end mig!' {else} @@ -1694,11 +1428,6 @@ adventures: svar = {ask} 'Hvad er 5 gange 5?' {print} 'Det er rigtigt' ``` - start_code: |- - svar = 0 - {while} svar != 25 - svar = {ask} 'Hvad er 5 gange 5?' - {print} 'Det er rigtigt' 16: story_text: |- Vi skal lave lister på som i Python, med firkantede parenteser rundt om! Vi beholder også anførselstegn rund om hvert element som vi har lært på et tidlige niveau. @@ -1725,9 +1454,8 @@ adventures: {print} i {print} 'Klar eller ej, her kommer jeg!' 18: - story_text: Vi er nået til ægte Python kode! Det betyder at vi er nødt til at bruge parenteser til {print} og {range} fra nu af. - start_code: |- - navn = 'Hedy' + story_text: |- + Vi er nået til ægte Python kode! Det betyder at vi er nødt til at bruge parenteser til {print} og {range} fra nu af. {print}('Jeg hedder ', navn) dice: name: Terninger @@ -1755,12 +1483,10 @@ adventures: ``` muligheder {is} _ ``` - start_code: '{print} Hvad vil terningen vise denne gang?' 4: story_text: | På dette niveau kan vi lave sætninger med terningeværdien i en sætning, med anførselstegn selvfølgelig. Denne gang er kodeeksemplet ikke helt færdigt. Kan du færdiggøre den? - start_code: '{print} ''Hvad vil terningen vise denne gang?''' 5: story_text: | Du kan også lave en terning igen på dette niveau ved at bruge `{if}`. @@ -1774,7 +1500,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1794,7 +1519,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a dice again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1806,7 +1530,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the dice indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1819,7 +1542,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1844,7 +1566,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Opvask? default_save_name: Opvask @@ -1862,7 +1583,6 @@ adventures: ``` story_text_2: | Har du ikke lyst til at tage opvasken? Hack programmet ved at fjerne dit navn fra listen med `{remove}` `{from}` kommandoen. - start_code: '{print} Hvem tager opvasken?' 4: story_text: | Med anførselstegn kan du lave din opvaskeplan pænere. @@ -1878,7 +1598,6 @@ adventures: {sleep} {print} personer {at} _ ``` - start_code: '{print} ''Hvem tager opvasken?''' 5: story_text: | Med `{if}` kan du nu have endnu mere sjov med valg i dit program. Du kan få dit program til at reagere på et valg lavet af computeren. @@ -1886,7 +1605,6 @@ adventures: Kan du færdigøre koden så den printer 'ærgerligt' når det er din tur og ellers 'sådan!'? Glem ikke anførselstegn! example_code: "```\npersoner {is} mor, far, Emma, Sophie\nopvasker {is} personer {at} {random}\n{if} opvasker {is} Sophie {print} _ ærgerligt jeg skal tage opvasken _ \n{else} {print} 'heldigvis ingen opvask for ' _ ' er allerede i gang'\n```\n" - start_code: '{print} ''Hvem tager opvasken?''' 6: story_text: | Hvor ofte skal alle tage opvasken? Er det retfærdigt? Du kan tælle det på dette niveau. @@ -1919,7 +1637,6 @@ adventures: {remove} opvasker {from} personer opvasker = personer {at} {random} ``` - start_code: '{print} ''Hvem tager opvasken?''' 7: story_text: | Med `{repeat}` kan du gentage stykker af kode. Du kan bruge dette til at beregne hvem der skal tage opvasken i flere dage! @@ -1931,7 +1648,6 @@ adventures: personer = mor, far, Emma, Sophie {repeat} _ _ {print} 'Opvasken tages af ' _ _ _ ``` - start_code: '{print} ''Hvem tager opvasken?''' 10: story_text: | På dette niveau kan du lave et endnu bedre opvaske skema. @@ -1942,7 +1658,6 @@ adventures: _ dag _ dage {print} navne {at} {random} ' tager opvasken på ' day ``` - start_code: '# placer din kode her' elif_command: name: '{elif}' default_save_name: elif @@ -1990,10 +1705,6 @@ adventures: {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: |- 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. @@ -2005,10 +1716,6 @@ adventures: {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: 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. @@ -2048,7 +1755,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2066,7 +1772,6 @@ adventures: 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. @@ -2091,7 +1796,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2104,7 +1808,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2139,7 +1842,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2151,7 +1853,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2171,7 +1872,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2187,7 +1887,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2199,7 +1898,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2239,21 +1937,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2282,13 +1965,6 @@ adventures: {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. @@ -2312,17 +1988,6 @@ adventures: 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 @@ -2351,7 +2016,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2373,7 +2037,6 @@ adventures: _ {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 @@ -2403,7 +2066,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2450,7 +2112,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2466,7 +2127,6 @@ adventures: {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. @@ -2488,7 +2148,6 @@ adventures: _ _ _ _ {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! @@ -2517,7 +2176,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2546,7 +2204,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2575,7 +2232,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2609,7 +2265,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2640,18 +2295,7 @@ adventures: {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?' @@ -2690,10 +2334,6 @@ adventures: _ _ _ 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... @@ -2710,11 +2350,6 @@ adventures: {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. @@ -2730,16 +2365,6 @@ adventures: {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 @@ -2768,11 +2393,6 @@ adventures: _ 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 @@ -2798,10 +2418,6 @@ adventures: 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: @@ -2810,8 +2426,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2843,8 +2458,7 @@ adventures: {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} @@ -2870,7 +2484,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2891,7 +2504,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2931,8 +2543,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2958,11 +2569,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Im Hedy the parrot - {ask} What is your name? - {echo} - {echo} 2: story_text: | Create your own online pet parrot that will copy you! @@ -2979,7 +2585,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2994,7 +2599,6 @@ adventures: {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}`. @@ -3008,7 +2612,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3025,7 +2628,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3046,7 +2648,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3070,7 +2671,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3099,7 +2699,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3112,7 +2711,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3132,7 +2730,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3158,8 +2755,6 @@ adventures: ``` _ 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. @@ -3176,8 +2771,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3209,7 +2803,6 @@ adventures: {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 @@ -3239,10 +2832,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3277,10 +2866,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3314,9 +2899,6 @@ adventures: 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. @@ -3365,11 +2947,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3383,10 +2960,6 @@ adventures: {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! @@ -3401,13 +2974,6 @@ adventures: {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 @@ -3433,10 +2999,6 @@ adventures: 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? @@ -3454,11 +3016,6 @@ adventures: _ {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 @@ -3478,7 +3035,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3495,7 +3051,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3529,7 +3084,6 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - 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. @@ -3549,7 +3103,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3570,7 +3123,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3589,7 +3141,6 @@ adventures: {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. @@ -3603,7 +3154,6 @@ adventures: {print} 'Welcome to Hedys restaurant!' 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: @@ -3621,7 +3171,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3654,7 +3203,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3702,7 +3250,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3724,7 +3271,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3739,7 +3285,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3756,7 +3301,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3783,9 +3327,6 @@ adventures: {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! @@ -3794,7 +3335,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3816,12 +3356,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3841,7 +3379,6 @@ 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. Can you finish the code? @@ -3861,7 +3398,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3873,7 +3409,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3892,7 +3427,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3915,7 +3449,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3932,7 +3465,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3959,7 +3491,6 @@ adventures: b = 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3972,7 +3503,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3988,10 +3518,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4029,7 +3555,6 @@ adventures: {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: @@ -4048,7 +3573,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In this level you can repeat the song 99 times, just by adding one simple line! @@ -4063,7 +3587,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4124,7 +3647,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting, like the 5 little monkeys. @@ -4142,7 +3664,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4161,7 +3682,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4178,16 +3698,6 @@ adventures: {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. @@ -4198,7 +3708,6 @@ adventures: example_code: "```\nalle_dyr = ['gris', 'hund', 'ko']\nlyde = ['øh', 'vuf', 'muh']\n{for} i {in} {range} 1 {to} 3\n dyr = alle_dyr[i]\n lyd = lyde[i]\n {print} 'Jens Hansen havde en bondegård'\n {print} 'ih ah ih ah oh!'\n {print} 'og på den gård der var en ' dyr\n {print}\ \ 'ih ah ih ah oh!'\n {print} 'Der var ' lyd lyd' her'\n {print} 'og ' lyd lyd' der'\n {print} lyde ' her'\n {print} lyde ' der'\n {print} 'alle steder ' lyde lyde\n```\n\n```\nlinjer = ['Hvad skal vi gøre med den fulde sømand', 'Smid ham i brummen til han vågner', 'Han\ \ skal klynges op i masten']\n{for} linje {in} linjer\n {for} i {in} {range} 1 {to} 3\n {print} linje \n {print} 'Tidligt om morgnen.'\n {for} i {in} {range} 1 {to} 3\n {print} 'Hu hej, se hun sejler'\n {print} 'Tidligt om morgnen.'\n```\n" - start_code: '# placer din kode her' 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. @@ -4220,7 +3729,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4242,15 +3750,6 @@ adventures: {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 @@ -4318,7 +3817,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4381,7 +3879,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4443,7 +3940,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4530,7 +4026,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Skildpadde default_save_name: Skildpadde @@ -4554,9 +4049,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | På dette niveau kan du bruge variabler. For eksempel kan du spørge hvor mange skridt skildpadden skal tage. @@ -4582,11 +4074,6 @@ adventures: {turn} vinkel {forward} 25 ``` - start_code: |- - {print} Skildpaddeløb! - vinkel {is} 90 - {turn} vinkel - {forward} 25 3: story_text: | På dette niveau kan du bruge `{at} {random}` med tegneskildpadden. Et tilfældigt valg får skildpadden til at gå en ny vej hver gang. @@ -4599,10 +4086,6 @@ adventures: {turn} vinkler {at} {random} {forward} 25 ``` - start_code: |- - vinkler {is} 10, 50, 90, 150, 250 - {turn} vinkler {at} {random} - {forward} 25 4: story_text: | På niveau 4 skal du bruge anførselstegn sammen med `{print}` og `{ask}`. Også når du tegner! @@ -4629,11 +4112,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Tegner figurer' - vinkel {is} 90 - {turn} vinkel - {forward} 25 5: story_text: | På niveau 5 kan du lave et valg med `{if}`. For eksempel mellem forskellige typer figurer. @@ -4666,12 +4144,6 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: |- - {print} 'Tegner figurer' - figur {is} {ask} 'Vil du tegne en firkant eller en trekant?' - {if} figur {is} trekant vinkel {is} 120 {else} vinkel {is} 90 - {turn} vinkel - {forward} 25 6: story_text: | På dette niveau kan du bruge beregninger til at tegne forskellige figurer. @@ -4695,7 +4167,6 @@ adventures: {forward} 50 {turn} vinkel ``` - start_code: '{print} ''Tegner figurer''' 8: story_text: "Nu hvor vi kan gentage flere streger, kan vi lave lettere lave figurer.\nVi skal kun sætte vinklen en gang og så bruge den variabel i `{repeat}` kommandoen.\n\n### Opgave 1\nKoden i eksemplet skaber et kvadrat. Ændrer koden så den skaber en anden figur, så som en trekant eller\ \ sekskant. \n Dette kræver at du ændrer to linjer i koden.\nTip: En hel omgang er 360 grader.\n\n### Opgave 2\nLav nu en tegning der består af mindst på polygoner.\n" @@ -4737,7 +4208,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# placer din kode her' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4755,7 +4225,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4780,16 +4249,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4805,7 +4264,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4816,7 +4274,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4827,7 +4284,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4845,7 +4301,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4864,7 +4319,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4884,7 +4338,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4895,7 +4348,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4908,7 +4360,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4939,7 +4390,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4980,7 +4430,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5003,7 +4452,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5032,7 +4480,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5056,7 +4503,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5084,7 +4530,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5118,7 +4563,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5138,11 +4582,6 @@ adventures: 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 @@ -5160,4 +4599,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/de.yaml b/content/adventures/de.yaml index 146e4832fd2..d5795abf3f1 100644 --- a/content/adventures/de.yaml +++ b/content/adventures/de.yaml @@ -27,7 +27,6 @@ adventures: Benutze mindestens einen `{ask}` und einen `{echo}` Befehl. Du kannst das Thema frei wählen. Wenn dir kein Thema einfällt, nimm eines der folgenden: ins Kino gehen, ein Sportwettkampf oder ein Tag im Zoo. - start_code: '{print} Deine Geschichte beginnt hier' 2: story_text: | In Level 2 kannst du deine Geschichte noch etwas spannender machen. Der Name deiner Hauptfigur kann nun an jeder Stelle im Satz auftauchen. @@ -53,7 +52,6 @@ adventures: Bringe den `{ask}` Befehl und den `{echo}` Befehl in deinem Code in die richtige Form, die du in diesem Level gelernt hast. **Extra** Füge deinem Code den `{sleep}`-Befehl hinzu, um Spannung in deiner Geschichte aufzubauen. - start_code: '{print} Deine Geschichte' 3: story_text: | In Level 3 wird es etwas witziger. Du kannst nun etwas ganz zufälliges zu Deiner Geschichte hinzufügen. Ein beliebiges Monster, ein Tier oder ein Hindernis. Das funktioniert so: @@ -87,7 +85,6 @@ adventures: rauswerfen {is} {ask} Welchen Gegenstand soll er rauswerfen? {remove} rauswerfen {from} Rucksack ``` - start_code: '{print} Deine Geschichte' 4: story_text: | Vielleicht ist dir aufgefallen, dass es in den vorigen Leveln noch ein Problem gab. Hast du versucht, einen Satz mit dem Wort Name zu schreiben? Z.B. `{print}` mein Name ist Name. @@ -111,7 +108,6 @@ adventures: {print} _ Da hört er plötzlich ein _ Tiere {at} {random} {print} Name _ erschrickt. Es spukt in diesem Wald _ ``` - start_code: '{print} ''Deine Geschichte wird hier gedruckt!''' 5: story_text: | In diesem Level programmierst Du unterschiedliche Enden, was Deine Geschichte noch spannender werden lässt. @@ -152,7 +148,6 @@ adventures: {repeat} 5 {times} {print} 'Hilfe!' {print} 'Warum hilft mir niemand?' ``` - start_code: '{repeat} 5 {times} {print} ''Hilfe!''' 8: story_text: | In diesem Level kannst du mehrere Zeilen zu einem `{if}`-Befehl hinzufügen. So kannst du deine guten und schlechten Enden etwas erweitern. @@ -175,7 +170,6 @@ adventures: {print} 'Oh nein! Richard ist zu langsam...' {print} _ ``` - start_code: '# setze hier deinen Code hin' 9: story_text: | In diesem Level kannst du `{if}` und `{repeat}` innerhalb anderer `{if}` und `{repeat}` Befehle verwenden. @@ -204,7 +198,6 @@ adventures: {else} {print} 'Robin geht nach Hause.' ``` - start_code: '# setze hier deinen Code hin' 10: story_text: | In diesem Level kannst du den {for} Befehl für deine Geschichte nutzen. Damit kannst du zum Beispiel ganz einfach das Kinderbuch "Brauner Bär, wen siehst denn Du?" programmieren. @@ -213,7 +206,6 @@ adventures: Schau dir die Geschichte an, falls du sie nicht kennst und stelle sicher, dass es wie im Buch ausgegeben wird. example_code: "```\ntiere = _ , _ , _ \n{print} 'Brauner Bär'\n{print} 'Was siehst du?'\n```\n" - start_code: '# setze hier deinen Code hin' 12: story_text: |- In diesem Level werden Anführungszeichen benötigt, um mehrere Wörter in einer Variablen zu speichern. @@ -226,7 +218,6 @@ adventures: Name = 'Die Königin von England' {print} Name ' aß ein Stück Kuchen, als plötzlich...' ``` - start_code: '# setze hier deinen Code hin' 13: story_text: | Durch die Verwendung der Befehle `{and}` und `{or}` kannst du deine Geschichten vielseitiger gestalten. Du kannst zwei Fragen stellen und auf die Kombination der Antworten antworten. @@ -245,7 +236,6 @@ adventures: {if} Pfad {is} 'links' {and} Waffe {is} 'Schwert' _ ``` - start_code: '# setze hier deinen Code hin' 15: story_text: | Mit der `{while}`-Schleife kannst du deine Geschichten noch interessanter gestalten. So kannst du zum Beispiel mit `{while} game == 'on'``{while} sword == 'lost'` dein Spiel so lange laufen lassen, bis es tatsächlich vorbei ist. @@ -268,7 +258,6 @@ adventures: {print} 'Nope, sie sind nicht beim ' Ort '.' {print} 'Jetzt kannst Du ins Haus!' ``` - start_code: '# setze hier deinen Code hin' 18: story_text: | Wir werden eine andere Geschichte ausgeben, aber nun müssen wir Klammern mit `{print}` benutzen. @@ -289,7 +278,6 @@ adventures: name = {input}("Wie ist dein Name?") {print}('Willkommen in dieser Geschichte!') ``` - start_code: '# platziere deinen Code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -329,13 +317,6 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - start_code: |- - tiere {is} Hund, Katze, Känguru - mag_ich {is} {ask} Was ist dein Lieblingstier? - {add} mag_ich {to_list} tiere - mag_ich_nicht {is} {ask} Welches Tier magst du nicht? - {remove} mag_ich_nicht {from} tiere - {print} Gewählt habe ich tiere {at} {random} and_or_command: name: '{and} & {or}' default_save_name: and or @@ -353,11 +334,6 @@ adventures: {if} name {is} 'Hedy' {and} alter {is} 2 {print} 'Du bist die echte Hedy!' ``` - start_code: |- - name = {ask} 'Wie heißt du?' - alter = {ask} 'Wie alt bist du?' - {if} name {is} 'Hedy' {and} alter {is} 2 - {print} 'Du bist die echte Hedy!' ask_command: name: '{ask}' default_save_name: ask_command @@ -390,10 +366,6 @@ adventures: _ Wie geht es dir? _ ``` - start_code: | - {print} Hallo! - {ask} Wie heißt du? - {echo} hello 2: story_text: | ## Der frage Befehl @@ -421,11 +393,6 @@ adventures: lieblings_tier {is} {ask} Was ist dein Lieblingstier? {print} Mein Lieblingstier ist lieblings_tier ``` - 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -537,7 +504,6 @@ adventures: {elif} punkte > geber_punkte {and} punkte < 21: {print} 'Du gewinnst!' ``` - start_code: '# Schreibe deinen Code hier' calculator: name: Taschenrechner default_save_name: Taschenrechner @@ -603,7 +569,6 @@ adventures: Punkte = Punkte + 1 {print} 'Großartig gemacht! Dein Punktestand ist... ' Punkte ' von 10!' ``` - start_code: '{print} ''Welcome to this calculator!''' 10: story_text: | Dieses Taschenrechnerspiel hilft dir deine Multiplikationstabellen zu üben! @@ -621,7 +586,6 @@ adventures: {else} {print} 'Das ist falsch. Die richtige Antwort ist ' richtig ``` - start_code: '# setze hier deinen Code hin' 11: story_text: | Mit einem `{for}` kannst du das Multiplikationsprogramm vereinfachen. @@ -637,10 +601,6 @@ adventures: {for} i {in} {range} 1 {to} 10 {print} i * zahl ``` - start_code: | - zahl = 10 - {for} i {in} {range} 1 {to} 10 - {print} i * zahl 12: story_text: | In diesem Level kannst du einen Taschenrechner bauen, der mit Dezimalzahlen arbeitet. @@ -659,7 +619,6 @@ adventures: Antwort = _ {print} Zahl1 ' plus ' Zahl2 ' macht ' _ ``` - start_code: '# setze hier deinen Code hin' 13: story_text: | ### Übung 1 @@ -676,7 +635,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schreib deinen Code hier' 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. @@ -701,11 +659,7 @@ adventures: 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 @@ -737,7 +691,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# setze hier deinen Code hin' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -786,17 +739,6 @@ adventures: {clear} {print} 'ÜBERRASCHUNG!' ``` - start_code: | - {print} '3' - {sleep} - {clear} - {print} '2' - {sleep} - {clear} - {print} '1' - {sleep} - {clear} - {print} 'ÜBERRASCHUNG!' debugging: name: debugging default_save_name: debugging @@ -819,12 +761,6 @@ adventures: {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. @@ -844,14 +780,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -873,16 +801,6 @@ adventures: 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 @@ -897,13 +815,6 @@ adventures: {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 @@ -926,17 +837,7 @@ adventures: {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' @@ -963,19 +864,7 @@ adventures: 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: @@ -991,11 +880,6 @@ adventures: 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 @@ -1020,10 +904,7 @@ adventures: {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} @@ -1060,19 +941,7 @@ adventures: 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: @@ -1087,11 +956,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1131,26 +995,6 @@ adventures: 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 @@ -1179,27 +1023,6 @@ adventures: 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 @@ -1232,31 +1055,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1286,9 +1084,7 @@ adventures: 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?' @@ -1345,36 +1141,6 @@ adventures: 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 @@ -1524,7 +1290,6 @@ adventures: Probiere den Code selbst mit der grünen Schaltfläche 'Programm ausführen' unter dem Programmierfeld aus. Bereit? Dann gehe zum nächsten Tab um deinen ersten Befehl zu lernen! - start_code: '{print} Hallo Welt!' 2: story_text: | Glückwunsch! Du hast Level 2 erreicht. Hoffentlich hast du bereits einige tolle Programme erstellt! @@ -1546,14 +1311,12 @@ adventures: Das ändert sich in Level 2. In Level 2 lernst du, mit Variablen zu arbeiten. Diese erlauben es, mehrere Informationen zu speichern und an jedem beliebigen Ort auszudrucken. Gehen wir also zum nächsten Tab! - start_code: '{print} Hallo Welt!' 3: story_text: | Im vorherigen Level hast du gelernt, was eine Variable ist und wie du sie verwenden kannst, um deine Abenteuer interaktiver zu gestalten. Aber... das ist nicht das Einzige, was du mit Variablen machen kannst! Du kannst Variablen auch zum Erstellen von Listen verwenden. Und du kannst Hedy sogar ein zufälliges Wort aus einer Liste auswählen lassen, wodurch du echte Spiele erstellen kannst! Wirf einen kurzen Blick auf den nächsten Tab! - start_code: '{print} Hallo Welt!' 4: story_text: | In den vorherigen Levels hast du mit Variablen geübt, bist aber möglicherweise auf dieses Problem gestoßen. @@ -1574,7 +1337,6 @@ adventures: antwort {is} {ask} 'Was müssen wir ab jetzt verwenden?' {print} 'Wir müssen ' antwort ' verwenden.' ``` - start_code: '{print} ''Hallo Welt''' 5: story_text: | In Level 5 gibt es etwas Neues, nämlich das `{if}`! Mit `{if}` kannst du zwischen zwei verschiedenen Möglichkeiten wählen. @@ -1585,9 +1347,6 @@ adventures: name {is} {ask} 'Wie heißt du?' {if} name {is} Hedy {print} 'Schön' {else} {print} 'Buh!' ``` - start_code: |- - name {is} {ask} 'Wie heisst du?' - {if} name {is} Hedy {print} 'Toll!' {else} {print} 'Blöd' 6: story_text: | In diesem Level lernst du etwas Neues: Du kannst jetzt auch rechnen. @@ -1610,7 +1369,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy macht Spaß!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy macht Spaß!''' 8: story_text: | `{ask}` und `{print}` funktionieren immer noch wie du es gewohnt bist. Aber `{if}`, `{else}` und `{repeat}` haben sich verändert! @@ -1634,10 +1392,6 @@ adventures: {print} 'EINDRINGLING!' {print} 'Du darfst diesen Rechner nicht benutzen!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hallo Leute' - {print} 'Das wird 5 mal ausgegeben' 9: story_text: | In diesem Level kannst du nicht nur mehrere Zeilen mit `{if}` und `{repeat}` verwenden, du kannst sie auch kombinieren! @@ -1652,13 +1406,6 @@ adventures: {else} {print} 'Pizza ist leckerer' ``` - start_code: |- - {repeat} 3 {times} - essen = {ask} 'Was möchtest du gern?' - {if} essen {is} 'Pizza' - {print} 'Gut!' - {else} - {print} 'Pizza ist besser' 10: story_text: |- In diesem Level lernen wir den neuen Befehl `{for}`. Mit `{for}` kannst du eine Liste machen und alle ihre Elemente verwenden. @@ -1669,17 +1416,10 @@ adventures: {for} tier {in} tiere {print} 'Ich mag ' tier ``` - start_code: |- - tiere {is} Hund, Katze, Blobfisch - {for} tier {in} tiere - {print} 'Ich mag' tier 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: |- - {for} zähler {in} {range} 1 {to} 5 - {print} zähler 12: story_text: |- **Dezimalzahlen** @@ -1689,8 +1429,7 @@ adventures: {print} 'Zweieinhalb plus zweieinhalb macht...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'Dezimalzahlen benötigen jetzt einen Punkt' + {print} 2.5 + 2.5 13: story_text: |- @@ -1704,11 +1443,6 @@ adventures: {if} name {is} 'Hedy' {and} alter {is} 2 {print} 'Du bist die echte Hedy!' ``` - start_code: |- - name = {ask} 'Wie heißt du?' - alter = {ask} 'Wie alt bist du?' - {if} name {is} 'Hedy' {and} alter {is} 2 - {print} 'Du bist die echte Hedy!' 14: story_text: | Wir lernen weitere neue Elemente kennen! Du kennst sie vielleicht schon aus der Mathematik, das `<` und das `>` Zeichen. @@ -1723,8 +1457,7 @@ adventures: {if} alter > 12 {print} 'Du bist älter als ich!' ``` - start_code: |- - alter = {ask} 'Wie alt bist du?' + {if} alter < 13 {print} 'Du bist jünger als ich!' {else} @@ -1743,11 +1476,6 @@ adventures: antwort = {ask} 'Was macht 5 mal 5?' {print} 'Es wurde eine richtige Antwort abgegeben' ``` - start_code: |- - antwort = 0 - {while} antwort != 25 - antwort = {ask} 'Wieviel ist 5 mal 5?' - {print} 'Das ist die richtge Antwort!' 16: story_text: |- Wir setzen jetzt eckige Klammern um Listen, so wie das in Python gemacht wird! Außerdem müssen wir jetzt einfache Anführungszeichen (') um jedes Element einer Liste setzen, wie wir es in den vorherigen Leveln gelernt haben. @@ -1777,8 +1505,7 @@ adventures: story_text: |- Wir sind bei echtem Python-Code angekommen! Das bedeutet, dass wir ab jetzt runde Klammern mit den Befehlen `{print}` und `{range}` benutzen müssen. Es bedeutet auch, dass du Hedy-Code aus diesem Level in jeder Python-Umgebung benutzen kannst, solange du die englischen Befehle nutzt. Falls du es bisher noch nicht gemacht hast, kannst du den Schalter im Befehlsmenü zum Umschalten benutzen. - start_code: |- - name = 'Hedy' + {print}('Ich heiße ', name) dice: name: Würfel @@ -1806,7 +1533,6 @@ adventures: ``` Auswahlmöglichkeiten {is} _ ``` - start_code: '{print} Was zeigt der Würfel diesmal?' 4: story_text: | In diesem Level kannst du auch Würfel erstellen. Aber dieses Mal kannst du es selbst versuchen, ohne Beispiel-Code! @@ -1814,7 +1540,6 @@ adventures: ### Übung Erstelle deinen eigenen Würfel in diesem Level. Tipp: Falls du keine Idee hast, wie man einen Würfel erstellt, schau dir deinen Würfel vom vorigen Level an, aber vergiss nicht, Anführungszeichen hinzuzufügen. - start_code: '{print} ''Was zeigt der Würfel diesmal?''' 5: story_text: | Wir werden die `{if}` und `{else}` Befehle zu unseren Würfeln hinzufügen! @@ -1830,7 +1555,6 @@ adventures: _ wurf {is} Regenwurm {print} 'Du kannst aufhören zu würfeln.' _ {print} 'Du musst nochmal würfeln!' ``` - start_code: '{print} ''Was zeigt der Würfel diesmal?''' 6: story_text: | Hier kannst Du auch wieder der Regenwurmwürfel erstellen, aber hier kannst Du dazu auch noch berechnen, wie viele Punkte gewürfelt wurden. @@ -1850,7 +1574,6 @@ adventures: ``` example_code_2: | Ist es dir gelungen, die Gesamtpunktzahl für 8 Würfel auszurechnen? Dafür musstest du ganz schön viel hin und her kopieren, oder?In Level 7 machen wir das einfacher! - start_code: '{print} ''Was wird der Würfel diesmal anzeigen?''' 7: story_text: | Auch in Level 5 kannst du wieder einen Würfel programmieren. Mit dem Befehl `{repeat}` kannst du ganz einfach eine ganze Handvoll Würfel werfen. @@ -1862,7 +1585,6 @@ adventures: Würfelseiten = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''Was wird der Würfel diesmal anzeigen?''' 10: story_text: | Brauchen alle zu lange, um zu würfeln? In diesem Level kannst du Hedy alle Würfel auf einmal werfen lassen. @@ -1877,7 +1599,6 @@ adventures: {print} Spieler ' würfelt ' Würfelseiten {at} {random} {sleep} ``` - start_code: '# setze hier deinen Code hin' 15: story_text: | ### Exercise @@ -1902,7 +1623,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# setze hier deinen Code hin' dishes: name: Abwasch? default_save_name: Abwasch @@ -1923,7 +1643,6 @@ adventures: Denke dann an eine Aufgabe, die erledigt werden soll, und lasse den Computer entscheiden, wer die Aufgabe erledigen muss, indem du `{at} {random}` benutzt. **Extra** Keine Lust auf selbst abwaschen? Hacke das Spülmaschinenprogramm und entferne deinen Namen von der Liste mit dem `{remove}` `{from}` Befehl. - start_code: '{print} Wer macht den Abwasch?' 4: story_text: | Mit Anführungszeichen kannst du dein Abwaschprogramm noch besser machen. @@ -1938,7 +1657,6 @@ adventures: {sleep} {print} Familienmitglieder {at} _ ``` - start_code: '{print} ''Wer macht den Abwasch?''' 5: story_text: | Mit dem Befehl `{if}` kannst Du noch etwas mehr Spaß haben, wenn Du die Auswahl auswertest. Du kannst Dein Programm auf die Auswahl, die der Computer trifft, reagieren lassen. @@ -1952,7 +1670,6 @@ adventures: _ tellerwäscher {is} Sophie {print} _ So ein Pech. Ich muss abwaschen. _ _ {print} 'Zum Glück kein Abwasch, weil ' _ ' dran ist.' ``` - start_code: '{print} ''Wer macht den Abwasch?''' 6: story_text: | Wer ist wie oft mit dem Abwasch dran? Ist es gerecht verteilt? In diesem Level kannst Du mitzählen. @@ -1985,7 +1702,6 @@ adventures: {remove} Tellerwäscher {from} Familienmitglieder Tellerwäscher = Familienmitglieder {at} {random} ``` - start_code: '{print} ''Wer wäscht ab?''' 7: story_text: | Mit dem Befehl `{repeat}` kannst du Code-Zeilen wiederholen. Das kannst du nutzen, um für mehrere Tage zu berechnen, wer abwäscht. @@ -1997,7 +1713,6 @@ adventures: Familienmitglieder = Mama, Papa, Emma, Sophie {repeat} _ _ {print} 'Abgewaschen wird von' _ _ _ ``` - start_code: '{print} ''Wer macht den Abwasch?''' 10: story_text: | In diesem Level kannst du einen Ablauf für die ganze Woche auf eine einfache Art und Weise erstellen! @@ -2012,7 +1727,6 @@ adventures: {for} tag {in} tage {print} namen {at} {random} ' ist mit dem Abwasch dran am ' tag ``` - start_code: '# setze hier deinen Code hin' elif_command: name: '{elif}' default_save_name: elif @@ -2060,10 +1774,6 @@ adventures: {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: |- In diesem Level fügen wir eine neue Form des Befehls `{for}` hinzu. In früheren Leveln haben wir `{for}` mit Listen benutzt, aber wir können `{for}` auch mit Zahlen verwenden. @@ -2076,10 +1786,6 @@ adventures: {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: 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. @@ -2118,7 +1824,6 @@ adventures: ### Übung Kopiere den Beispiel-Code in deinen Eingabebereich und fülle die Lücken, um den Code zum Laufen zu bringen. **Extra** Ändere den Code und lasse die Wahrsagerin nicht nur deinen Namen vorhersagen, sondern auch dein Alter, dein Lieblingssport-Team oder etwas anderes über dich. - start_code: '# setze hier deinen Code hin' 3: story_text: | Im vorigen Level hast du deine erste Wahrsagemaschine erstellt, aber Hedy konnte nichts wirklich vorhersagen, sonder nur `{echo}`. @@ -2136,7 +1841,6 @@ adventures: story_text_2: | ### Übung Bis hierhin konnte Hedy nur mit ja, nein oder vielleicht antworten. Kannst du Hedy mit zusätzlichen Antwortmöglichkeiten ausstatten, wie zum Beispiel 'auf jeden Fall' oder 'frag nochmal'? - start_code: '# setze hier deinen Code hin' 4: story_text: | Dieses Level hat keine neuen Funktionen, aber gibt dir die Möglichkeit ein wenig mit Anführungszeichen zu üben. @@ -2161,7 +1865,6 @@ adventures: {sleep} 2 {print} Antworten {at} {random} ``` - start_code: '# setze hier deinen Code hin' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2174,7 +1877,6 @@ adventures: Person {is} {ask} 'Wer bist du?' {if} Person {is} Hedy {print} 'Du wirst sicher gewinnen!🤩' {else} {print} 'Pech gehabt! Jemand anderes wird gewinnen!😭' ``` - start_code: '# setze hier deinen Code hin' 6: story_text: | In diesem Level können wir Mathe in deinen Vorhersagen als Wahrsagerin verwenden. Das ermöglicht es dir (alberne) Formeln zur Berechnung der Zukunft zu erfinden. @@ -2209,7 +1911,6 @@ adventures: Ergebnis = Ergebnis * Fußball {print} 'Du bist ' Ergebnis ' Prozent schlau.' ``` - start_code: '# setze hier deinen Code hin' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2221,7 +1922,6 @@ adventures: Antwort = ja, nein, vielleicht {repeat} 3 {times} {print} 'Meine Kristallkugel sagt... ' Antwort {at} {random} ``` - start_code: '# setze hier deinen Code hin' 8: story_text: | In den vorigen Leveln hast du gelernt `{repeat}` zu nutzen, um die Wahrsagerin 3 Fragen in Folge beantworten zu lassen, aber wir hatten ein Problem die Fragen anzuzeigen. @@ -2241,7 +1941,6 @@ adventures: {sleep} {print} 'Meine Kristallkugel sagt...' Antworten {at} {random} ``` - start_code: '# setze hier deinen Code hin' 10: story_text: | In diesem Level wirst du lernen, das englische Spiel MASH zu programmieren. In diesem Spiel geht es darum, für alle Spieler die Zukunft vorauszusagen. Auf Englisch stehen die Buchstaben für mansion, apartment, shack, und house, was auf Deutsch Schloss, Wohnung, Schuppen und Haus bedeutet. @@ -2260,7 +1959,6 @@ adventures: {print} Name ' wird eine(n) ' Haustiere {at} {random} ' als Haustier haben.' {sleep} ``` - start_code: '# setze hier deinen Code hin' 12: story_text: |- Ab Level 12 musst du auch in Listen Anführungszeichen vor und nach jedem Element verwenden. @@ -2275,7 +1973,6 @@ adventures: {sleep} {print} Schicksale {at} {random} ``` - start_code: '# setze hier deinen Code hin' functions: name: functions default_save_name: functions @@ -2315,21 +2012,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2358,13 +2040,6 @@ adventures: {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. @@ -2388,17 +2063,6 @@ adventures: 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 @@ -2427,7 +2091,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2449,7 +2112,6 @@ adventures: _ {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: Spukhaus default_save_name: Spukhaus @@ -2481,7 +2143,6 @@ adventures: Kopiere den Beispiel-Code in deinen Eingabebereich, indem du den gelben Knopf drückst. Beende nun die Geschichte, indem du mindestens 5 Zeilen zum Code hinzufügst. Denke daran, dass du jede Zeile mit einem `{print}` Befehl beginnst. - start_code: '{print} How did I get here?' 2: story_text: | In diesem Spukhaus kannst du Monster mit Emojis auswählen. Natürlich kannst du auch Wörter verwenden. @@ -2528,7 +2189,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# setze hier deinen Code hin' 4: story_text: | In diesem Level lernst du mit Anführungszeichen umzugehen. @@ -2550,7 +2210,6 @@ adventures: {sleep} {print} Monster {at} {random} ``` - start_code: '# setze hier deinen Code hin' 5: story_text: | Bis zu diesem Level hat das Spukaus den Spieler immer gefragt durch welche Tür er gehen will, aber wie du vielleicht gemerkt hast, musste der Spieler nicht wirklich richtig antworten. @@ -2572,7 +2231,6 @@ adventures: _ _ _ _ {print} 'Großartig! Du bist entkommen!' {else} {print} 'Oh nein! Du wirst gegessen von...' Monster {at} {random} ``` - start_code: '# setze hier deinen Code hin' 9: story_text: | In diesem Level kannst du Verschachtelung verwenden, um das Spukhaus noch interaktiver zu machen! @@ -2603,7 +2261,6 @@ adventures: {if} Spieler {is} am_Leben {print} 'Großartig! Du hast überlebt' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In diesem Level haben wir den `{for}` Befehl verändert, um dem Spieler zu sagen, wo er ist. @@ -2627,7 +2284,6 @@ adventures: {print} 'Raum ' i monster = monsterliste {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2656,7 +2312,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2690,7 +2345,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2721,18 +2375,7 @@ adventures: {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?' @@ -2771,10 +2414,6 @@ adventures: _ _ _ 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... @@ -2791,11 +2430,6 @@ adventures: {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. @@ -2811,16 +2445,6 @@ adventures: {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 @@ -2849,11 +2473,6 @@ adventures: _ 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 @@ -2879,10 +2498,6 @@ adventures: 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: @@ -2891,8 +2506,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2924,8 +2538,7 @@ adventures: {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} @@ -2952,7 +2565,6 @@ adventures: {if} Frosch {is} grenouille {print} 'Super!' {else} {print} 'Nein, Frosch heißt grenouille' ``` - start_code: '# setze hier deinen Code hin' 16: story_text: | ### Exercise @@ -2973,7 +2585,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# setze hier deinen Code hin' maths: name: maths default_save_name: maths @@ -3013,8 +2624,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Papagei @@ -3042,11 +2652,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Ich bin Hedy der Papagei - {ask} Was ist dein Name? - {echo} - {echo} 2: story_text: | Lass Deinen zahmen Papageien noch etwas echter klingen! @@ -3063,7 +2668,6 @@ adventures: story_text_2: | ### Übung Du kannst Variablen verwenden, damit der Papagei mehr als nur deinen Namen sagt. Kannst du diesen Code vervollständigen? - start_code: '{print} Ich bin Hedy der Papagei!' 3: story_text: | Bringe Deinem Papageien mit dem Befehl `{add}` neue Wörter bei. @@ -3078,7 +2682,6 @@ adventures: {print} 🧒 Sag neues_Wort, Hedy! {print} 🦜 Wörter {at} {random} ``` - start_code: '# setze hier deinen Code hin' 4: story_text: | In diesem Level müssen wir Anführungszeichen bei den Befehlen `{ask}` und `{print}` benutzen. @@ -3093,7 +2696,6 @@ adventures: {print} _ 🧒 Sage _ neues_wort _, Hedy!_ {print} _ 🦜 _ wörter {at} {random} ``` - start_code: '# Schreibe deinen Code hier' 5: story_text: | Belohne deinen Papagei, wenn er das richtige Wort sagt! @@ -3112,7 +2714,6 @@ adventures: _ gesagtes_Wort {is} neues_Wort _ '🧒 Gut gemacht, Hedy! 🍪' _ _ '🧒 Nein, Hedy! Sag ' neues_Wort ``` - start_code: '# setze hier deinen Code hin' piggybank: name: Sparschwein default_save_name: Sparschwein @@ -3136,7 +2737,6 @@ adventures: Wochen = zu_sparen / Taschengeld {print} 'Du kannst dir ein ' _ ' in ' _ ' Wochen kaufen.' ``` - start_code: '# setze hier deinen Code hin' 14: story_text: | ### Exercise @@ -3160,7 +2760,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Tastengedrücke default_save_name: Gedrückt @@ -3189,7 +2788,6 @@ adventures: {if} x {is} {pressed} {forward} 50 {else} {turn} 90 ``` - start_code: '# platziere deinen Code hier' 7: story_text: | Nun da du `{repeat}` kennengelernt hast, können wir Tasten mehrfach drücken! @@ -3201,12 +2799,10 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# Platziere deinen Code hier' 9: story_text: "Da du jetzt weißt wie man Befehle kombiniert, kannst du mit Hilfe von `{pressed}` ein Touch-Type-Tool erstellen. \n\n### Übung\nVervollständige den Code. Jedes Mal soll ein zufälliger Buchstabe ausgewählt werden. Diesen muss man drücken. Du bekommst einen Punkt für die richtige\ \ Taste und zwei Punkte Abzug für die falsche Taste.\n**(extra)** Lösche den Bildschirm nach jedem Buchstaben und zeige dem Benutzer, wie viele Punkte er erreicht hat.\n" example_code: "```\nPunkte = 0\nBuchstaben = a, b, c, d, e\n{repeat} 10 {times}\n Buchstabe = _ _ _ \n {print} 'Drück den Buchstaben ' Buchstabe\n {if} Buchstabe {is} {pressed}\n _\n _\n _\n```\n" - start_code: '# platziere deinen Code hier' print_command: name: '{print}' default_save_name: print @@ -3232,8 +2828,6 @@ adventures: ``` _ 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. @@ -3250,8 +2844,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmeister @@ -3282,7 +2875,6 @@ adventures: {if} punkte_b > punkte_a {print} 'Du gehörst zum B-Club' ``` - start_code: '# setze hier deinen Code hin' quotation_marks: name: '''quotation marks''' default_save_name: quotation_marks @@ -3312,10 +2904,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3350,10 +2938,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3387,9 +2971,6 @@ adventures: 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. @@ -3438,11 +3019,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3456,10 +3032,6 @@ adventures: {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! @@ -3474,13 +3046,6 @@ adventures: {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 @@ -3506,10 +3071,6 @@ adventures: 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? @@ -3527,11 +3088,6 @@ adventures: _ {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 @@ -3555,7 +3111,6 @@ adventures: Füge dann mindestens 4 zusätzliche Zeilen zum Restaurant-Programm hinzu. Frage die Gäste, was sie trinken möchten und frage, ob sie in bar oder mit Karte zahlen möchten. Denke die zum Schluss eine nette Verabschiedung für deine Gäste aus. - start_code: '# setze hier deinen Code hin' 2: story_text: | In Level 2 konntest du dein Restaurant mit Variablen erweitern. In Level 1 konnte Hedy nur die Bestellung einmal wiedergeben (mit `{echo}`) und sich nur das merken, was zuletzt bestellt wurde. @@ -3580,7 +3135,6 @@ adventures: Füge nun deine eigene Zusammenfassung der Essen- und Getränkebestellung deiner Gäste hinzu. **Extra** Nun da du gelernt hast Variablen zu benutzen, kannst du so viele Variablen in einer Zeile nutzen wie du magst. Kannst du mehr Variablen zu deinem Code hinzufügen, wie hier essen oder zum Mitnehmen, bar oder Karte, mit oder ohne Strohhalm usw.? - start_code: '# setze hier deinen Code hin' 3: story_text: | Fällt es dir schwer zu entscheiden, was du gerne zum Abendessen hättest? Du kannst das Hedy machen lassen! @@ -3608,7 +3162,6 @@ adventures: preise {is} _ _ ``` - start_code: '# setze hier deinen Code hin' 4: story_text: | In diesem Level musst du Anführungszeichen verwenden, wenn du die Befehle `{print}` oder `{ask}`benutzt. @@ -3631,7 +3184,6 @@ adventures: {print} Danke für Ihre Bestellung. {print} Ihre Essen und Getränke kommen sofort! ``` - start_code: '# setze hier deinen Code hin' 5: story_text: | In diesem Level erlaubt dir der `{if}`-Befehl deinen Kundinnen oder Kunden Fragen zu stellen (`{ask}`) und verschiedene Antworten zu geben. @@ -3652,7 +3204,6 @@ adventures: {if} etwas {is} nein {print} 'Das ist alles!' {else} {print} 'Einmal ' etwas {print} 'Danke für Ihre Bestellung und guten Appetit!' ``` - start_code: '# setze hier deinen Code hin' 6: story_text: | In diesem Level kannst du Mathe verwenden um den Gesamtpreis einer Bestellung auszurechnen. Da macht dein virtuelles Restaurant realistischer. @@ -3671,7 +3222,6 @@ adventures: {print} 'Das kostet ' preis ' Euro, bitte' {print} 'Danke, genießen Sie Ihre Mahlzeit!' ``` - start_code: '# setze hier deinen Code hin' 7: story_text: | In diesem Level hast du gelernt, wie du den Befehl `{repeat}` verwenden kannst, um eine Codezeile um eine bestimmte Anzahl zu wiederholen. @@ -3685,7 +3235,6 @@ adventures: {print} 'Willkommen im Restaurant Chez Hedy' Gäste = {ask} 'Wie viele Leute kommen heute zu uns?' ``` - start_code: '# setze hier deinen Code hin' 8: story_text: | In diesem Level kannst du dein virtuelles Restaurant ausbauen, indem du mehrere Zeilen Code wiederholst. Das geht so: @@ -3704,7 +3253,6 @@ adventures: ### Übung Dieser Code kann mit mehr Gerichten auf der Karte erweitert werden, zum Beispiel einem Getränkeangebot, und/oder mehreren Gängen oder Nachtisch. Füge mindestens ein Gericht hinzu. **(extra)** Füge so viele Gerichte hinzu wie du magst! - start_code: '# setze hier deinen Code hin' 9: story_text: "In diesem Level kannst du Verschachtelung benutzen, um dein Restaurant realistischer und spaßiger zu machen!\n\n### Übung\nDie Einrückung im Beispiel-Code wurde entfernt.\nKannst du herausfinden wie viel Einrückung jede Zeile benötigt, damit der Code ordentlich funktioniert?\n\ Falls der Kunde Pizza bestellt, sollte Hedy nicht fragen, welche Soße der Kunde möchte.\n\n**(extra)** Ein Restaurant lagert nicht alle möglichen Soßen. Erstelle eine Liste mit verfügbaren Soßen und gib eine Antwort bei jeder Bestellung, ob du sie auf Lager hast.
\n**(extra)**\ @@ -3731,7 +3279,6 @@ adventures: {print} 'Das macht ' Preis ' Euro' {print} 'Genießen Sie Ihre Mahlzeit!' ``` - start_code: '# setze hier deinen Code hin' 10: story_text: | In diesem Level wirst du lernen, wie du leicht nach Bestellungen für verschiedene Gänge fragst. @@ -3770,7 +3317,6 @@ adventures: {print} 'Also möchten Sie für' Leute ' Leute bestellen.' {print} "Los geht's!" ``` - start_code: '# setze hier deinen Code hin' 12: story_text: | Ab diesem Level kannst du Dezimalzahlen verwenden, um deine Speisekarte realistischer zu machen. @@ -3791,7 +3337,6 @@ adventures: preis = preis + 2.35 {print} 'Das macht ' preis ' Euro, bitte' ``` - start_code: '# setze hier deinen Code hin' 13: story_text: | In diesem Level lernst du neue Befehle, mit denen du deinen Code noch weiter ausbauen kannst. @@ -3811,7 +3356,6 @@ adventures: {print} 'Das ist eine gesunde Wahl' {print} 'Das kostet dann ' preis ' Euro' ``` - start_code: '# setze hier deinen Code hin' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3828,7 +3372,6 @@ adventures: mehr = {ask} 'Würden Sie gerne noch etwas bestellen?' {print} 'Dankeschön!' ``` - start_code: '# setze hier deinen Code hin' rock: name: Schere, Stein, Papier default_save_name: Stein @@ -3855,9 +3398,6 @@ adventures: {ask} Wähle aus _ {echo} Also war deine Wahl: ``` - start_code: | - {print} Willkommen bei deinem eigenen Stein Schere Papier! - {ask} Was wählst du? 2: story_text: | In diesem Level kannst du üben, Variablen zu benutzen, damit du im nächsten Level das Spiel Schere, Stein, Papier machen kannst! @@ -3866,7 +3406,6 @@ adventures: _ {is} {ask} Stein, Schere oder Papier? {print} Ich wähle ``` - start_code: '# setze hier deinen Code hin' 3: story_text: | You can use the `{at} {random}` command to let the computer pick rock, paper or scissors! @@ -3890,13 +3429,11 @@ adventures: {print} Spieler 1 wählt... Auswahl {at} {random} {print} Spieler 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 4: story_text: | In diesem Level können wir Stein Schere Papier weiter programmieren. Aber wenn du Text hinzufügen möchtest, musst du auch hier Anführungszeichen verwenden. ### Übung Kopiere deinen Code aus dem vorigen Level und bring ihn mit Hilfe von Anführungszeichen nach jedem `{print}` oder `{ask}` Befehl zum Laufen. - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In diesem Level können wir bestimmen, ob es unentschieden war oder nicht. Dafür brauchst du den neuen `{if}` Code. @@ -3918,7 +3455,6 @@ adventures: ``` Ersetze die Unterstriche (_) mit dem richtigen Code, um zu sehen, ob das Spiel unentschieden ausgeht. - start_code: '{print} ''Welcome to your own rock scissors paper!''' 9: story_text: | In diesem Level kannst du das ganze Stein-Schere-Papier-Programm programmieren, indem du `{if}` Befehle verschachtelst. @@ -3943,7 +3479,6 @@ adventures: {print} 'Du verlierst!' # mach den Beispiel-Code fertig ``` - start_code: '# setze hier deinen Code hin' 10: story_text: | Bist du zu faul, um das Spiel selbst zu spielen? Lass Hedy es für dich spielen! @@ -3963,7 +3498,6 @@ adventures: {for} Spieler {in} Personen {print} Spieler ' wählt ' Auswahl {at} {random} ``` - start_code: '# setze hier deinen Code hin' 13: story_text: | Mit dem Befehl `{and}` kannst du deinen Schere, Stein, Papier Code kürzen! Sieh dir den Beispielcode an. @@ -3985,7 +3519,6 @@ adventures: {print} 'Der Computer gewinnt!' _ ``` - start_code: '# setze hier deinen Code hin' 15: story_text: | ### Übung @@ -4008,7 +3541,6 @@ adventures: gewonnen = 'ja' _ ``` - start_code: '# setze hier deinen Code hin' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -4025,7 +3557,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: Superspion default_save_name: Sprache @@ -4055,7 +3586,6 @@ adventures: b = 'Morgen um 10 Uhr' {print} _ _ _ ``` - start_code: '# setze hier deinen Code hin' 13: story_text: | Wir können den Superspy-Code mit `{and}` vereinfachen, so dass wir nur einen `{if}` benötigen. @@ -4074,7 +3604,6 @@ adventures: {else} {print} 'Gehe um 10 Uhr zum Bahnhof' ``` - start_code: '# setze hier deinen Code hin' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -4092,10 +3621,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Singe ein Lied! default_save_name: Song @@ -4133,7 +3658,6 @@ adventures: {print} 'KEINE KLEINEN AFFEN SPRINGEN MEHR AUF DEM BETT!' {sleep} ``` - start_code: '{print} ''Lass uns singen!''' 7: story_text: "In Liedern wiederholt sich oft einiges. So auch im Lied \"Baby Hai\"! Wenn du es singst, singst du eigentlich immer das gleiche:\n\nBaby Hai tututudutudu
\nBaby Hai tututudutudu
\nBaby Hai tututudutudu
\nBaby Hai \n\n### Übung\nKannst du das Lied mit Hilfe des\ \ `{repeat}` Befehls ausgeben? Vervollständige den Code, indem du die Lücken füllst!\n **Extra** Nach dem Baby-Hai kannst du natürlich auch andere Lieder programmieren. Es gibt viele Lieder mit Wiederholung!\nKannst du an ein weiteres Lied denken und es ausgeben?\n" @@ -4142,7 +3666,6 @@ adventures: {repeat} _ _ {print} 'Baby Hai tututudutudu' {print} 'Baby Hai' ``` - start_code: '{print} ''Baby Hai''' 8: story_text: | In einem vorigen Level hast du das Lied über die Bierflaschen programmiert. Aber ohne den `{repeat}` Befehl musstest du die Strophen viele Male kopieren. @@ -4160,7 +3683,6 @@ adventures: Strophe = Strophe - 1 {print} Strophe ' Flaschen Bier an der Wand' ``` - start_code: '# setze hier deinen Code hin' 10: story_text: | Mit `{for}` kannst du den ganzen Babyhai-Song (inklusive aller anderen Haie in der Familie) in nur 6 Zeilen Code ausgeben. @@ -4177,7 +3699,6 @@ adventures: ``` affen = 5, 4, 3, 2, 1 ``` - start_code: '# setze hier deinen Code hin' 11: story_text: | In diesem Level nutzt du den Befehl `{for}` mit `{range}` für Lieder, in denen gezählt wird, wie z.B. bei 'Fünf kleine Affen'. @@ -4193,7 +3714,6 @@ adventures: {print} affen ' kleine Affen springen auf dem Bett' _ ``` - start_code: '# setze hier deinen Code hin' 12: story_text: | Jetzt machen wir es uns richtig einfach und programmieren 'Wenn du glücklich bist, dann klatsche in die Hand'. Alles, was wir tun möchten, wenn wir glücklich sind, speichern wir in einer Variablen. Sieh es dir an: @@ -4212,7 +3732,6 @@ adventures: _ {print} 'Wenn Du glücklich bist' _ {print} Aktion ``` - start_code: '# setze hier deinen Code hin' 13: 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? @@ -4229,16 +3748,6 @@ adventures: {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 diesem Level kannst Du 'Old MacDonald hat ne Farm' sogar noch schneller programmieren. Du kannst jedem Tier das richtige Geräusch zuordnen, indem Du sie an die selbe Stelle einer Liste speicherst. @@ -4271,7 +3780,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# setze hier deinen Code hin' 18: story_text: | In Level 16 haben wir Lieder mit Listen gemacht. Diese Programme funktionieren jedoch nicht mehr ganz in diesem Level. Die Doppelpunkte aus Level 17 und die Klammern aus Level 18 müssen noch hinzugefügt werden. @@ -4293,7 +3801,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schreibe deinen Code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4315,15 +3822,6 @@ adventures: {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 @@ -4359,7 +3857,6 @@ adventures: {else} spieler = 'x' ``` - start_code: '# Schreib deinen Code hier' 14: story_text: | In den vorigen Levels hast du ein Tic Tac Toe-Spiel kreiert. Jetzt weißt du, wie du das =-Symbol, das ==-Symbol und das !=-Symbol nutzen kannst. @@ -4422,7 +3919,6 @@ adventures: {else} zeichen = 'x' ``` - start_code: '# Schreibe deinen Code hier' 15: story_text: | In diesem Level kannst du dein Tic Tac Toe-Spiel mit der {while}-Schleife verbessern. Mit dieser Schleife kannst du `{if} game != 'over'` und `{for} i {in} {range} 1 {to} 9` in eine einfache Zeile zusammenführen. @@ -4484,7 +3980,6 @@ adventures: {else} zeichen = 'x' ``` - start_code: '# füge hier deinen Code ein' 17: story_text: | In den vorigen Leveln hatte das Tic-Tac-Toe-Spiel ein nerviges Verhalten. Nach jedem Zug musstest du selbstständig eintragen, ob du gewonnen hast oder nicht. @@ -4571,7 +4066,6 @@ adventures: {else}: zeichen = 'x' ``` - start_code: '# gib deinen Code hier ein' turtle: name: Schildkröte default_save_name: Schildkröte @@ -4595,9 +4089,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | In diesen level kann du Variablen nutzen, um die Schildkröte interaktiv zu machen. Du kannst zum Beispiel die Spieler fragen, wie viele Schritte die Schildkröte machen soll. @@ -4623,11 +4114,6 @@ adventures: {turn} winkel {forward} 25 ``` - start_code: |- - {print} Schildkrötenrennen! - Winkel {is} 90 - {turn} Winkel - {forward} 25 3: story_text: | In diesem Level kannst Du `{at} {random}` nutzen, während die Schildkröte etwas zeichnet. Durch eine zufällige Wahl nimmt die Schildkröte jedes Mal einen anderen Weg. @@ -4640,10 +4126,6 @@ adventures: {turn} Winkel {at} {random} {forward} 25 ``` - start_code: |- - Winkel {is} 10, 50, 90, 150, 250 - {turn} Winkel {at} {random} - {forward} 25 4: story_text: | In Level 4 musst Du bei `{print}` und `{ask}` Anführungszeichen nutzen. Das gilt auch für's Zeichnen! @@ -4670,11 +4152,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Formen zeichnen' - Winkel {is} 90 - {turn} Winkel - {forward} 25 5: story_text: | In Level 5 kannst Du mit dem Befehl `{if}` Entscheidungen treffen. Du kannst Dich zum Beispiel zwischen verschiedenen Formen entscheiden. @@ -4707,12 +4184,6 @@ adventures: {if} richtung {is} right {turn} _ {forward} 100 ``` - start_code: |- - {print} 'Formen zeichnen' - Form {is} {ask} 'Möchtest Du ein Quadrat oder ein Dreieck?' - {if} Form {is} Dreieck Winkel {is} 120 {else} Winkel {is} 90 - {turn} Winkel - {forward} 25 6: story_text: | In diesem Level nutzen wir Berechnungen, um verschiedene Formen zu zeichnen. @@ -4736,7 +4207,6 @@ adventures: {forward} 50 {turn} Winkel ``` - start_code: '{print} ''Formen zeichnen''' 8: story_text: | Jetzt, da wir einzelne Linien wiederholen können, fällt uns das Zeichnen einzelner Formen leichter. @@ -4786,7 +4256,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# schreibe deinen Code hier' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4804,7 +4273,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4829,16 +4297,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4854,7 +4312,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4865,7 +4322,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4876,7 +4332,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4894,7 +4349,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4913,7 +4367,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4933,7 +4386,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4944,7 +4396,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4957,7 +4408,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4988,7 +4438,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5029,7 +4478,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5052,7 +4500,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5081,7 +4528,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5105,7 +4551,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5133,7 +4578,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5167,7 +4611,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5187,11 +4630,6 @@ adventures: 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: Neujahr default_save_name: Neujahrs-Countdown @@ -5209,4 +4647,3 @@ adventures: {print} Zahl {print} 'Frohes neues Jahr!' ``` - start_code: '# Platziere deinen Code hier' diff --git a/content/adventures/el.yaml b/content/adventures/el.yaml index 21526d95a14..58710b83f97 100644 --- a/content/adventures/el.yaml +++ b/content/adventures/el.yaml @@ -17,7 +17,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: print Η ιστορία σου ξεκινά εδώ 2: story_text: | Στο επίπεδο 2 μπορείς να κάνεις την ιστορία σου πιο διασκεδαστική. Το όνομα του βασικού σου χαρακτήρα μπορεί πλεόν να εμφανίζεται οπουδήποτε στην πρόταση. @@ -42,7 +41,6 @@ adventures: 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 Η ιστορία σου 3: story_text: | Μπορείς επίσης να προσθέσεις κάτι τυχαίο στην ιστορία σου. Οποιοδήποτε τέρας, ζώο ή άλλο εμπόδιο. @@ -73,7 +71,6 @@ adventures: dump {is} {ask} Which item should he dump? {remove} dump {from} bag ``` - start_code: print Η ιστορία σου 4: story_text: | Θα παρατήρησες πως υπάρχει ακόμα ένα σφάλμα στο επίπεδο 2. @@ -93,7 +90,6 @@ adventures: print 'Ακούει τον ήχο ενός' animals at random print 'Ο' name 'φοβάται πως αυτό είναι ένα στοιχειωμένο δάσος' ``` - start_code: print 'Η ιστορία σου θα εμφανιστεί εδώ!' 5: story_text: | Στο επίπεδο 4 μπορείς να κάνεις την ιστορία σου ακόμα πιο διασκεδαστική. Στο επίπεδο 4 μπορείς να προγραμματίσεις διαφορετικά φινάλε. @@ -115,7 +111,6 @@ adventures: end is ask 'Θα ήθελες ένα ευχάριστο ή ένα δυσάρεστο φινάλε (good or bad)?' if end is good print 'Ο' name 'παίρνει το σπαθί και το τέρας τρέχει γρήγορα μακριά' else print 'Το τέρας τρώει τον' name ``` - start_code: print 'Εδώ θα βρίσκεται σύντομα η ιστορία σου!' 7: story_text: "Σε μια ιστορία, κάποιος μπορεί να αναφέρει διάφορες λέξεις πολλές φορές. Για παράδειγμα, όταν κάποιος φωνάζει βοήθεια ή τραγουδά ένα τραγούδι. \nΜπορείς να βάλεις μια τέτοια επανάληψη στην ιστορία σου στο επίπεδο 5 με την `repeat`.\n" example_code: | @@ -124,7 +119,6 @@ adventures: repeat 5 times print 'Βοήθεια!' print 'Γιατί δε με βοηθάει κανείς;' ``` - start_code: repeat 5 times print 'Βοήθεια!' 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! @@ -139,7 +133,6 @@ adventures: {print} 'Oh no! Richard is too slow...' {print} _ ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -158,12 +151,10 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. example_code: "```\nanimals = _ , _ , _ \n{print} 'Brown bear, Brown bear'\n{print} 'What do you see?'\n```\n" - start_code: '# place your code here' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -172,7 +163,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -185,7 +175,6 @@ adventures: {if} path {is} 'left' {and} weapon {is} 'sword' _ ``` - start_code: '# place your code here' 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. @@ -208,7 +197,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -229,7 +217,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -269,13 +256,6 @@ adventures: _ {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 @@ -293,11 +273,6 @@ adventures: {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 @@ -330,10 +305,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -361,11 +332,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -477,7 +443,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Αριθμομηχανή default_save_name: Αριθμομηχανή @@ -518,7 +483,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: print 'Καλωσήλθες σε αυτήν την αριθμομηχανή!' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -537,7 +501,6 @@ adventures: 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! @@ -554,7 +517,6 @@ adventures: {else} {print} 'That is wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -570,7 +532,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -581,7 +542,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' _ ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -598,7 +558,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -623,11 +582,7 @@ adventures: 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 @@ -659,7 +614,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -708,17 +662,6 @@ adventures: 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 @@ -741,12 +684,6 @@ adventures: {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. @@ -766,14 +703,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -795,16 +724,6 @@ adventures: 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 @@ -819,13 +738,6 @@ adventures: {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 @@ -848,17 +760,7 @@ adventures: {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' @@ -885,19 +787,7 @@ adventures: 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: @@ -913,11 +803,6 @@ adventures: 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 @@ -942,10 +827,7 @@ adventures: {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} @@ -982,19 +864,7 @@ adventures: 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: @@ -1009,11 +879,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1053,26 +918,6 @@ adventures: 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 @@ -1101,27 +946,6 @@ adventures: 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 @@ -1154,31 +978,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1208,9 +1007,7 @@ adventures: 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?' @@ -1267,36 +1064,6 @@ adventures: 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 @@ -1442,7 +1209,6 @@ adventures: 1: story_text: "Καλωσήρθες στη Hedy! Στο επίπεδο 1 μπορείς να χρησιμοποιήσεις τις εντολές `{print}`, `{ask}` και`{echo}`.\n\nΓια παράδειγμα, μπορείς να εμφανίσεις κείμενο στην οθόνη χρησιμοποιώντας την `{print}`. Μπορείς να δεις ένα παράδειγμα \nμε απόσπασμα κώδικα στα αριστερά.\n\nΠάτησε\ \ το πράσινο κουμπί και ο κώδικας θα πληκτρολογηθεί για σένα.\nΔοκίμασε και εσύ τον κώδικα πατώντας το πράσινο κουμπί 'Εκτέλεσε κώδικα' κάτω από το αριστερό προγραμματιστικό πεδίο.\n" - start_code: print γειά σου κόσμε! 2: story_text: | Στο επίπεδο 2 θα μάθουμε κάτι καινούριο. Μπορείς να ορίσεις μια λέξη με την `is`. Μπορείς να χρησιμοποιήσεις τη λέξη οπουδήποτε στον κώδικά σου και θα αντικατασταθεί από την Hedy, ως εξής: @@ -1459,11 +1225,9 @@ adventures: ``` story_text_2: | `{print}` εξακολουθεί να λειτουργεί ως είχε, αλλά `{ask}` εντολή έχει αλλάξει. Χρειάζεται να χρησιμοποιήσετε μία μεταβλητή στην εντολή `{ask}` . Φαίνεται ως εξής: - start_code: print γεια σου κόσμε! 3: story_text: | Στο επίπεδο 3 μπορείς να δημιουργήσεις μια λίστα. Μπορείς να αφήσεις τον υπολογιστή να επιλέξει κάτι τυχαία από τη λίστα. Αυτό γίνεται με τη χρήση της `at random`. - start_code: print γεια σου κόσμε! 4: story_text: "Στο επίπεδο 4 οι εντολές `{ask}` and `{print}` αλλάζουν.\n\n Πρέπει να περικλείσεις το κείμενο που θέλεις να εμφανίσεις σε εισαγωγικά.\n \nΑυτό είναι χρήσιμο, επειδή τώρα μπορείς να εμφανίσεις όσες λέξεις θέλεις. Επίσης, τις λέξεις που αποθήκευες με την `{is}`.\n\nΟι περισσότερες\ \ γλώσσες προγραμματισμού χρησιμοποιούν εισαγωγικά όταν εμφανίζουν στην οθόνη, οπότε βρισκόμαστε ένα βήμα πιο κοντά στον πραγματικό προγραμματισμό!\n\nΘα βρεις τις εντολές στα αριστερά και πάλι, και τις ασκήσεις στις ακόλουθες καρτέλες. Οι ασκήσεις πλέον γίνονται όλο και πιο δύσκολες\ @@ -1474,7 +1238,6 @@ adventures: answer is ask 'What do we need to use from now on?' print 'We need to use ' answer ``` - start_code: print 'Γεια σου κόσμε' 5: story_text: | Οι `ask` και `print` λειτουργούν ακριβώς όπως στο επίπεδο 4. @@ -1522,7 +1285,6 @@ adventures: ``` repeat 3 times print 'H Hedy είναι διασκεδαστική!' ``` - start_code: repeat 3 times print 'Η Hedy είναι διασκεδαστική!' 8: story_text: | Οι ask και print λειτουργούν ακόμα όπως τις γνωρίζεις. Όμως, οι if και repeat έχουν αλλάξει! @@ -1534,10 +1296,6 @@ adventures: print 'Γεια σας' print 'Αυτό θα επαναληφθεί 5 φορές' ``` - start_code: |- - repeat 5 times - print 'Γειά σας παιδιά' - print 'Αυτό θα εμφανιστεί 5 φορές' 9: story_text: "Σ΄αυτό το επίπεδο όχι μόνον μπορείς να χρησιμοποιήσεις πολλές γραμμές στις εντολές `if` and `repeat`, αλλά μπορέις και να τις τοποθετήσεις μαζί! \nΣτο παρακάτω παράδειγμα βλέπεις μια εντολή `if` μέσα σε μια εντολή `repeat`. Μπορεί να χρησιμοποιηθεί και αντίστροφα, επιτέπεται\ \ επίσης και ένα `if` μέσα σε ένα `if` και ένα `repeat` μέσα σε ένα `repeat`.\nΔοκίμασέ το!\n" @@ -1550,8 +1308,7 @@ adventures: else print 'η πίτσα είναι καλύτερη!' ``` - start_code: |- - repeat 3 times + food = ask 'Τι θέλεις;' if food is 'πίτσα' print 'ωραία!' @@ -1567,17 +1324,10 @@ adventures: for animal in animals print 'I love ' animal ``` - start_code: |- - animals is 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: "Μέχρι τώρα η Hedy δενεπέτρεπε δεκαδικούς αριθμούς όπως 1.5, αλλά δεν θα το επιτρέψουμε πλέον. Σημείωσε ότι οι υπολογιστές χρησιμοποιούν το `.` για τους δεκαδικούς αριθμούς.\n\nΑπό αυτό το επίπεδο και μετά πρέπει να χρησιμοποιείς τα εισαγωγικά όταν αποθηκεύεις κείμενο με `=`:\n\ \nΟι λίστες είναι κείμενα, άρα θέλουν επίσης εισαγωγικά. Πρόσεξε ότι κάθε στοιχείο στη λίστα έχει εισαγωγικά. \nΑυτό σου επιτρέπει να αποθηκέυσεις δυο λέξεις ως ένα στοιχείο, πχ 'Iron Man'.\n\n\nΓια τους αριθμούς, δεν χρησιμοποιούνται εισαγωγικά στο `=`/\n" @@ -1586,8 +1336,7 @@ adventures: {print} 'Δύο και μισό συν δύο και μισό είναι...' {print} 2.5 + 2.5 ``` - start_code: |- - print 'decimal numbers now need to use a dot' + print 2.5 + 2.5 13: story_text: Τώρα θα μάθουμε τα `and` και `or`! Αν θέλεις να ελέγξεις δύο δηλώσεις, δεν χρειάζεται να χρησιμοποίησεις δύο if αλλά μπορείς να χρησιμοποιήσεις τα `and` και `or`. Αν χρησιμοποιήσεις τo `and`, και οι δύο προτάσεις, αριστερά και δεξιά από το `and` θα πρέπει να είναι αληθείς. @@ -1599,11 +1348,6 @@ adventures: 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!' 14: story_text: "Θα μάθουμε μερικά ακόμα νέα πράγματα! Ίσως να τα γνωρίζεις ήδη από τα μαθηματικά, τα `<` και `>`. \nΤο `<` ελέγχει αν ο πρώτος αριθμός είναι μικρότερος από τον δεύτερο, πχ `age < 12` ελέγχει αν το `age` είναι μικρότερο από 12.\nΑν θέλεις να ελέγξεις αν ο πρώτος αριθμός είναι\ \ μικρότερος ή ίσος από τον δεύτερο, μπορείς να χρησιμοποιήσεις `<=`, πχ`age <= 11`.\n Το `>` ελέγχει αν ο πρώτος αριθμός είναι μεγαλύτερος από τον δεύτερο, πχ `points > 10` ελέγχει αν `points` είναι μεγαλύτερο από 10.\nΑν θέλεις να ελέγξεις αν ο πρώτος αριθμός είναι μεγαλύτερος\ @@ -1630,9 +1374,7 @@ adventures: answer = ask 'What is 5 times 5?' print 'A correct answer has been given' ``` - start_code: |- - answer = 0 - while answer != 25 + answer = ask 'Πόσο κάνει 5 φορές το 5;' print 'Δόθηκε η σωστή απάντηση' 16: @@ -1649,9 +1391,8 @@ adventures: print i print 'Έτοιμοι ή όχι, έρχομαι!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Φτιάξε τα δικά σου ζάρια @@ -1743,7 +1484,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1768,7 +1508,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Ποιός πρέπει να πλύνει τα πιάτα default_save_name: πιάτα @@ -1871,7 +1610,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1919,10 +1657,6 @@ adventures: {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: |- 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. @@ -1934,10 +1668,6 @@ adventures: {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: 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. @@ -1977,7 +1707,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -1995,7 +1724,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2017,7 +1745,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2033,7 +1760,6 @@ adventures: {if} person {in} friends {print} good_answer {at} {random} {else} {print} bad_answer {at} {random} ``` - start_code: '# place your code here' 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. @@ -2051,7 +1777,6 @@ adventures: {sleep} {print} kids ' kids!' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2063,7 +1788,6 @@ adventures: options = they love you, they love you not _ _ _ _ options {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2080,7 +1804,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2096,7 +1819,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2108,7 +1830,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2148,21 +1869,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2191,13 +1897,6 @@ adventures: {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. @@ -2221,17 +1920,6 @@ adventures: 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 @@ -2260,7 +1948,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2282,7 +1969,6 @@ adventures: _ {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 @@ -2311,7 +1997,6 @@ adventures: ``` story_text_2: | Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2358,7 +2043,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2374,7 +2058,6 @@ adventures: {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. @@ -2393,7 +2076,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2421,7 +2103,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2447,7 +2128,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2476,7 +2156,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2510,7 +2189,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2541,18 +2219,7 @@ adventures: {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?' @@ -2591,10 +2258,6 @@ adventures: _ _ _ 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... @@ -2611,11 +2274,6 @@ adventures: {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. @@ -2631,16 +2289,6 @@ adventures: {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 @@ -2669,11 +2317,6 @@ adventures: _ 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 @@ -2699,10 +2342,6 @@ adventures: 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: @@ -2711,8 +2350,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2744,8 +2382,7 @@ adventures: {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} @@ -2768,7 +2405,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2789,7 +2425,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2829,8 +2464,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2856,7 +2490,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2873,7 +2506,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2886,7 +2518,6 @@ adventures: {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}`. @@ -2900,7 +2531,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -2916,7 +2546,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -2936,7 +2565,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -2960,7 +2588,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -2989,7 +2616,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3002,7 +2628,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3022,7 +2647,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3048,8 +2672,6 @@ adventures: ``` _ 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. @@ -3066,8 +2688,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3099,7 +2720,6 @@ adventures: {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 @@ -3129,10 +2749,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3167,10 +2783,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3204,9 +2816,6 @@ adventures: 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. @@ -3255,11 +2864,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3273,10 +2877,6 @@ adventures: {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! @@ -3291,13 +2891,6 @@ adventures: {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 @@ -3323,10 +2916,6 @@ adventures: 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? @@ -3344,11 +2933,6 @@ adventures: _ {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: Εστιατόριο default_save_name: Εστιατόριο @@ -3361,7 +2945,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - start_code: '# place your code here' 2: story_text: | Στο επίπεδο 2 μπορείς να επεκτείνεις το εστιατόριό σου χρησιμοποιώντας μεταβλητές. Στο επίπεδο 1, η Hedy μπορούσε μόνο να εμφανίσει την παραγγελία μια φορά και να θυμηθεί μόνο το τελευταίο αντικείμενο που παραγγέλθηκε. @@ -3381,7 +2964,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Δυσκολεύεσαι να αποφασίσεις τί θέλεις να φάς για δείπνο. Μπορείς να αφήσεις τη Hedy να επιλέξει για σένα! @@ -3413,7 +2995,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: |- In this level you have to use quotation marks when using the `{print}` command. @@ -3433,7 +3014,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3445,7 +3025,6 @@ adventures: {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: 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. @@ -3464,7 +3043,6 @@ adventures: {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. @@ -3476,7 +3054,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3497,7 +3074,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3525,7 +3101,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3555,7 +3130,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3574,7 +3148,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3589,7 +3162,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3606,7 +3178,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Πέτρα, ψαλίδι, χαρτί default_save_name: Πέτρα @@ -3628,7 +3199,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: print Καλωσήλθες στο δικό σου παιχνίδι Πέτρα, ψαλίδι, χαρτί! 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! @@ -3637,7 +3207,6 @@ adventures: choice {is} rock {print} I choose _ ``` - start_code: '# place your code here' 3: story_text: "Στο επίπεδο 2 μπορούμε να εισάγουμε λίστες και να επιλέξουμε πράγματα από αυτές. \n\nΑρχικά θα φτιάξεις μια λίστα με την `is`. Ύστερα μπορείς να αφήσεις τον υπολογιστή να επιλέξει κάτι από τη λίστα με την `at random` (τυχαία).\n\nΓια παράδειγμα, μπορείς να αφήσεις τον υπολογιστή\ \ να επιλέξει ανάμεσα σε πέτρα, ψαλίδι και χαρτί.\n" @@ -3659,11 +3228,9 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: print Καλωσήλθες στο δικό σου παιχνίδι Πέτρα ψαλίδι χαρτί! 4: story_text: | Στο επίπεδο 3 μπορούμε να προγραμματίσουμε περαιτέρω το Πέτρα, ψαλίδι, χαρτί. Όμως αν θέλεις να προσθέσεις κείμενο, πρέπει να χρησιμοποιήσεις εισαγωγικά και εδώ. Μπορείς να συμπληρώσεις τον κώδικα τοποθετώντας τις σωστές εντολές ή χαρακτήρες στις τελίτσες; - start_code: print 'Καλωσήλθες στο δικό σου παιχνίδι Πέτρα, ψαλίδι, χαρτί!' 5: story_text: | Στο επίπεδο 4 μπορούμε να αποφασίσουμε ποιός θα κερδίσει. Για αυτό θα χρειαστούμε τον νέο κώδικα `if`. @@ -3682,7 +3249,6 @@ adventures: ``` Πρώτα, συμπλήρωσε το σωστό κώδικα στις τελίτσες για να δεις αν είναι ισοπαλία. - start_code: print 'Καλωσήλθες στο δικό σου παιχνίδι Πέτρα, ψαλίδι, χαρτί' 9: story_text: | In this level you can program the whole rock, paper, scissors game by nesting the {if}-commands. Can you finish the code? @@ -3702,7 +3268,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3712,7 +3277,6 @@ adventures: players = _ {for} _ ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3731,7 +3295,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3754,7 +3317,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3771,7 +3333,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3795,7 +3356,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3808,7 +3368,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3824,10 +3383,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Τραγούδα ένα τραγούδι! default_save_name: τραγούδι @@ -3868,7 +3423,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: print 'Μωρό Καρχαρίας' 7: story_text: | Τα τραγούδια συχνά περιλαμβάνουν αρκετή επανάληψη. Για παράδειγμα... το Μωρό Καρχαρίας! Αν το τραγουδήσεις, τραγουδάς διαρκώς το ίδιο πράγμα: @@ -3886,7 +3440,6 @@ adventures: repeat _ _ print 'Μωρό Καρχαρίας τουτουρουτουτου' print 'Μωρό Καρχαρίας' ``` - start_code: print 'Μωρό Καρχαρίας' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3900,7 +3453,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -3952,7 +3504,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -3967,7 +3518,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -3982,7 +3532,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -3999,16 +3548,6 @@ adventures: {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. @@ -4044,7 +3583,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4066,7 +3604,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4088,15 +3625,6 @@ adventures: {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 @@ -4165,7 +3693,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4228,7 +3755,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4290,7 +3816,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4377,7 +3902,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: turtle @@ -4401,9 +3925,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | In level 1 the turtle could only turn left or right. That is a bit boring! @@ -4431,11 +3952,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: | - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4446,10 +3962,6 @@ adventures: {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! @@ -4476,11 +3988,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: | - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4513,12 +4020,6 @@ adventures: 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. @@ -4542,8 +4043,6 @@ adventures: {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. @@ -4566,8 +4065,6 @@ adventures: {turn} _ {forward} _ ``` - start_code: | - hoeken = {ask} 'How many angles should I draw?' 9: story_text: | Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures. @@ -4587,7 +4084,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4605,7 +4101,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4630,16 +4125,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4655,7 +4140,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4666,7 +4150,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4677,7 +4160,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4695,7 +4177,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4714,7 +4195,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4734,7 +4214,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4745,7 +4224,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4758,7 +4236,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4789,7 +4266,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4830,7 +4306,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4853,7 +4328,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4882,7 +4356,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4906,7 +4379,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -4934,7 +4406,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -4968,7 +4439,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -4988,11 +4458,6 @@ adventures: 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 @@ -5010,4 +4475,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/en.yaml b/content/adventures/en.yaml index 83a5040d9b9..0955318dc28 100644 --- a/content/adventures/en.yaml +++ b/content/adventures/en.yaml @@ -27,7 +27,6 @@ adventures: 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: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -53,7 +52,6 @@ adventures: 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: @@ -87,7 +85,6 @@ adventures: 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. @@ -112,7 +109,6 @@ adventures: {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. @@ -138,7 +134,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -153,7 +148,6 @@ adventures: {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! @@ -176,7 +170,6 @@ adventures: {print} 'Oh no! Richard is too slow...' {print} _ ``` - 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" @@ -195,7 +188,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -204,7 +196,6 @@ adventures: 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' 12: story_text: |- In this level quotation marks will be needed to save multiple words in a variable. @@ -217,7 +208,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 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. @@ -236,7 +226,6 @@ adventures: {if} path {is} 'left' {and} weapon {is} 'sword' _ ``` - start_code: '# place your code here' 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. @@ -259,7 +248,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -280,7 +268,6 @@ adventures: 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 @@ -320,13 +307,6 @@ adventures: _ {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 @@ -344,11 +324,6 @@ adventures: {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 @@ -381,10 +356,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -412,11 +383,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -528,7 +494,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -596,7 +561,6 @@ adventures: 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! @@ -614,7 +578,6 @@ adventures: {else} {print} 'That is wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -630,10 +593,6 @@ adventures: {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. @@ -652,7 +611,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' _ ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -669,7 +627,6 @@ adventures: {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. @@ -694,11 +651,7 @@ adventures: 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 @@ -730,7 +683,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -779,17 +731,6 @@ adventures: {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 @@ -812,12 +753,6 @@ adventures: {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. @@ -837,14 +772,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -866,16 +793,6 @@ adventures: 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 @@ -890,13 +807,6 @@ adventures: {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 @@ -919,17 +829,7 @@ adventures: {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' @@ -956,19 +856,7 @@ adventures: 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: @@ -984,11 +872,6 @@ adventures: 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 @@ -1014,10 +897,7 @@ adventures: {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} @@ -1054,19 +934,7 @@ adventures: 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: @@ -1081,11 +949,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1125,26 +988,6 @@ adventures: 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 @@ -1173,27 +1016,6 @@ adventures: 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 @@ -1226,31 +1048,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1280,9 +1077,7 @@ adventures: 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?' @@ -1339,36 +1134,6 @@ adventures: 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 @@ -1518,7 +1283,6 @@ adventures: 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! @@ -1540,14 +1304,12 @@ adventures: 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: story_text: | In the previous levels you've been practising with variables, but you may have come across this problem. @@ -1567,9 +1329,6 @@ adventures: name {is} Sophie {print} My name is name ``` - start_code: | - name {is} Sophie - {print} My name is name 5: 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. @@ -1581,9 +1340,6 @@ adventures: ``` 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. @@ -1607,7 +1363,6 @@ adventures: total_price {is} food_price + drink_price {print} 'That will be ' total_price ' dollars, please' ``` - start_code: '# place your code here' 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. @@ -1621,11 +1376,6 @@ adventures: {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. @@ -1634,7 +1384,6 @@ adventures: ``` {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... @@ -1649,7 +1398,6 @@ adventures: {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. @@ -1665,12 +1413,10 @@ adventures: {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. @@ -1683,7 +1429,6 @@ adventures: 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: @@ -1703,7 +1448,6 @@ adventures: {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). @@ -1720,12 +1464,6 @@ adventures: {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... @@ -1743,7 +1481,6 @@ adventures: {if} answer == 'yes' {print} 'Ok we will continue' ``` - start_code: '{print} ''Lets go to the next tab!''' 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. @@ -1765,14 +1502,12 @@ adventures: {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! @@ -1804,9 +1539,6 @@ adventures: ``` 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! @@ -1814,7 +1546,6 @@ adventures: ### 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! @@ -1830,7 +1561,6 @@ adventures: _ 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. @@ -1850,7 +1580,6 @@ adventures: ``` 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: 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. @@ -1862,7 +1591,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the dice indicate this time?''' 10: story_text: | ### Exercise @@ -1876,7 +1604,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1901,7 +1628,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1922,7 +1648,6 @@ adventures: 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: story_text: | With quotation marks you can make your dishwashing program even better. @@ -1937,7 +1662,6 @@ adventures: {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. @@ -1951,7 +1675,6 @@ adventures: _ 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: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1983,7 +1706,6 @@ adventures: {print} 'Tuesday the dishes are done by: ' dishwasher {remove} dishwasher {from} people ``` - start_code: '{print} ''Who does the dishes?''' 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! @@ -1995,7 +1717,6 @@ adventures: 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! @@ -2010,11 +1731,6 @@ adventures: {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 @@ -2062,10 +1778,6 @@ adventures: {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: |- 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. @@ -2078,10 +1790,6 @@ adventures: {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: 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. @@ -2120,7 +1828,6 @@ adventures: ### 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: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only `{echo}`. @@ -2138,7 +1845,6 @@ adventures: 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. @@ -2163,7 +1869,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | ### Exercise @@ -2187,7 +1892,6 @@ adventures: {if} person {in} friends {print} good_answer {at} {random} {else} {print} bad_answer {at} {random} ``` - start_code: '# place your code here' 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. @@ -2210,7 +1914,6 @@ adventures: {sleep} {print} kids ' kids!' ``` - start_code: '# place your code here' 7: story_text: | ### Exercise @@ -2223,7 +1926,6 @@ adventures: options = they love you, they love you not _ _ _ _ options {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the next example you can have your fortune teller ask multiple questions and also print them! @@ -2241,7 +1943,6 @@ adventures: {sleep} {print} 'My crystal ball says... ' answers {at} {random} ``` - start_code: '# place your code here' 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. @@ -2260,7 +1961,6 @@ adventures: {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. @@ -2275,7 +1975,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2315,21 +2014,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2358,13 +2042,6 @@ adventures: {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. @@ -2388,17 +2065,6 @@ adventures: 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 @@ -2427,7 +2093,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2449,7 +2114,6 @@ adventures: _ {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 @@ -2481,7 +2145,6 @@ adventures: 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. @@ -2536,7 +2199,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2558,7 +2220,6 @@ adventures: {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. @@ -2580,7 +2241,6 @@ adventures: _ _ _ _ {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" @@ -2605,7 +2265,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - 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\ @@ -2618,7 +2277,6 @@ adventures: {print} 'Room ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2647,7 +2305,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2681,7 +2338,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2712,18 +2368,7 @@ adventures: {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?' @@ -2762,10 +2407,6 @@ adventures: _ _ _ 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... @@ -2782,11 +2423,6 @@ adventures: {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. @@ -2802,16 +2438,6 @@ adventures: {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 @@ -2840,11 +2466,6 @@ adventures: _ 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 @@ -2870,10 +2491,6 @@ adventures: 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: @@ -2882,8 +2499,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2915,8 +2531,7 @@ adventures: {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} @@ -2943,7 +2558,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2964,7 +2578,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -3009,8 +2622,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -3038,11 +2650,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Im Hedy the parrot - {ask} What is your name? - {echo} - {echo} 2: 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. @@ -3063,7 +2670,6 @@ adventures: 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!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3078,7 +2684,6 @@ adventures: {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}`. @@ -3093,7 +2698,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3112,7 +2716,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3136,7 +2739,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3160,7 +2762,6 @@ adventures: {call} _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3189,7 +2790,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3202,7 +2802,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3222,7 +2821,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3248,8 +2846,6 @@ adventures: ``` _ 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. @@ -3266,8 +2862,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3299,7 +2894,6 @@ adventures: {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 @@ -3329,10 +2923,6 @@ adventures: {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** @@ -3367,10 +2957,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3404,9 +2990,6 @@ adventures: 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. @@ -3456,11 +3039,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3474,10 +3052,6 @@ adventures: {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! @@ -3492,13 +3066,6 @@ adventures: {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 @@ -3524,10 +3091,6 @@ adventures: 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? @@ -3545,11 +3108,6 @@ adventures: _ {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 @@ -3573,7 +3131,6 @@ adventures: 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. @@ -3598,7 +3155,6 @@ adventures: 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: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3626,7 +3182,6 @@ adventures: 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. @@ -3650,7 +3205,6 @@ adventures: {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 @@ -3667,7 +3221,6 @@ adventures: {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: 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. @@ -3695,7 +3248,6 @@ adventures: {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. @@ -3709,7 +3261,6 @@ adventures: {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: @@ -3728,7 +3279,6 @@ adventures: ### 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 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\ @@ -3755,7 +3305,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily ask orders for different courses. @@ -3794,7 +3343,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3816,7 +3364,6 @@ adventures: 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. @@ -3840,7 +3387,6 @@ adventures: {print} 'That is a healthy choice' {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3857,7 +3403,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock_2 @@ -3884,9 +3429,6 @@ adventures: {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! @@ -3898,7 +3440,6 @@ adventures: 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! @@ -3918,13 +3459,11 @@ adventures: player_1 {is} {ask} Name of player 1: _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. ### 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. @@ -3946,7 +3485,6 @@ 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" @@ -3966,7 +3504,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | ### Exercise @@ -3977,7 +3514,6 @@ adventures: players = _ {for} _ ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code. @@ -3999,7 +3535,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -4022,7 +3557,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -4039,7 +3573,6 @@ adventures: choice {is} _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -4069,7 +3602,6 @@ adventures: b = 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | We can simplify the superspy code with `{and}`, such that we only need one `{if}`. @@ -4088,7 +3620,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -4106,10 +3637,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4147,7 +3674,6 @@ adventures: {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: @@ -4166,7 +3692,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: 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. @@ -4184,7 +3709,6 @@ adventures: 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! @@ -4201,7 +3725,6 @@ adventures: ``` 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. @@ -4217,7 +3740,6 @@ adventures: {print} monkeys ' little monkeys jumping on the bed' _ ``` - start_code: '# place your code here' 12: 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: @@ -4236,7 +3758,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4253,16 +3774,6 @@ adventures: {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. @@ -4298,7 +3809,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4320,7 +3830,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4342,15 +3851,6 @@ adventures: {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 @@ -4386,7 +3886,6 @@ adventures: {else} player = 'x' ``` - start_code: '# Write your code here' 14: 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. @@ -4449,7 +3948,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4511,7 +4009,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4598,7 +4095,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4622,9 +4118,6 @@ adventures: {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. @@ -4650,11 +4143,6 @@ adventures: {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. @@ -4667,10 +4155,6 @@ adventures: {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! @@ -4697,11 +4181,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4734,12 +4213,6 @@ adventures: {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. @@ -4763,7 +4236,6 @@ adventures: {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" @@ -4804,7 +4276,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4823,7 +4294,6 @@ adventures: {forward} distance ``` ``` - start_code: '# place your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4848,16 +4318,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4874,7 +4334,6 @@ adventures: Stairs example_code: '' - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4886,7 +4345,6 @@ adventures: Boat example_code: '' - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4898,7 +4356,6 @@ adventures: Arrow example_code: '' - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4916,7 +4373,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4935,7 +4391,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4955,7 +4410,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4967,7 +4421,6 @@ adventures: Fan example_code: '' - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4981,7 +4434,6 @@ adventures: Randomly colored spiral (7) example_code: '' - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -5012,7 +4464,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5053,7 +4504,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5076,7 +4526,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5105,7 +4554,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5129,7 +4577,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5157,7 +4604,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5191,7 +4637,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5211,11 +4656,6 @@ adventures: 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 @@ -5233,4 +4673,3 @@ adventures: {print} number {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/eo.yaml b/content/adventures/eo.yaml index f75513535b9..720fd538cc7 100644 --- a/content/adventures/eo.yaml +++ b/content/adventures/eo.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Jen la komenco de via rakonto' 2: story_text: | En nivelo 2 vi povas fari vian rakonton pli amuza. La nomo de via ĉeffiguro nun povas esti ie ajn en la frazo. @@ -49,7 +48,6 @@ adventures: 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} Via rakonto' 3: story_text: | En Nivelo 3, oni povas igi sian rakonton pli amuza. Oni povas uzi hazardecon por iu ajn monstro, besto aŭ alia obstaklo, jene: @@ -78,7 +76,6 @@ adventures: forĵetoto {is} {ask} Kiun li forĵetu? {remove} forĵetoto {from} sako ``` - start_code: '{print} Via rakonto' 4: story_text: | Vi eble rimarkis, ke ankoraŭ ekzistas problemo en la antaŭaj niveloj. Ĉu vi provis presi frazon, kiu enhavis la vorton nomon? @@ -93,7 +90,6 @@ adventures: {print} 'Li aŭdas la sonon de' bestoj {at} {random} {print} nomo 'timas, ke ĉi tiu arbaro estas hantita' ``` - start_code: '{print} ''Via rakonto ĉi tie!''' 5: story_text: | En ĉi tiu nivelo vi povas programi malsamajn finaĵojn, kiuj faros vian rakonton eĉ pli amuza. @@ -116,7 +112,6 @@ adventures: {if} fino {is} bona {print} nomo 'takes the sword and the monster quickly runs away' {else} {print} nomo 'estis manĝita de monstro' ``` - start_code: '{print} ''Jen la komenco de via rakonto!''' 7: story_text: | En rakonto, iu diras vortojn plurajn fojojn. Ekzemple, kiam iu vokas helpon aŭ kantas kanton. @@ -127,7 +122,6 @@ adventures: {repeat} 5 {times} {print} 'Helpon!' {print} 'Kial neniu helpas min?' ``` - start_code: '{repeat} 5 {times} {print} ''Helpon!''' 8: story_text: | En ĉi tiu nivelo, vi povas uzi plurajn liniojn en viaj `{if}`-komandoj; tiel, vi povas plibonigi vian ĝojan aŭ malĝojan finon! @@ -145,7 +139,6 @@ adventures: {print} 'Sed Rikardo estas tro malrapida…' {print} 'La tiranosaŭro proksimiĝas kaj manĝas lin per unu mordego!🦖' ``` - start_code: '# via kodo ĉi tie' 9: story_text: | En ĉi tiu nivelo vi povas uzi nestadon por meti {if}, {repeat} aŭ {for} komandojn en aliajn {if}, {repeat} aŭ {for}. Ĉi tio donas al vi multajn eblojn kaj vere helpas vin fari vian rakonton interaga. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robertino iras hejmen' ``` - start_code: '# via kodo ĉi tie' 10: story_text: | En ĉi tiu nivelo, vi povas uzi la komandon `{for}` en via rakonto. Tiel vi povas facile programi la infanlibron «Bruna urso, bruna urso, kion vi vidas?». @@ -181,7 +173,6 @@ adventures: {print} 'Kion vi vidas?' {print} 'Mi vidas ĉiujn bestojn, kiuj rigardas min!' ``` - start_code: '# via kodo ĉi tie' 12: story_text: En ĉi tiu nivelo, oni povas uzi la citilojn por konservi plurajn vortojn en variablo. example_code: | @@ -189,7 +180,6 @@ adventures: nomo = 'La Reĝino de Anglio' {print} nomo ' estis manĝanta pecon da kuko, kiam subite…' ``` - start_code: '# via kodo ĉi tie' 13: story_text: | Uzante la komandojn `{and}` kaj `{or}`, oni povas mallongigi siajn rakontojn. Ekzemple, rigardu la jenan rakonton pri drakoj. @@ -219,7 +209,6 @@ adventures: {print} 'Ĉi tio povus esti tre oportuna' glavo = 'trovita' ``` - start_code: '# via kodo ĉi tie' 15: story_text: | Uzante la buklon `{while}`, oni povas igi siajn rakontojn pli interesaj. Ekzemple, oni povas uzi `{while} ludo {is} 'daŭranta'` por ke oni povu ludi ĝis la ludo finiĝos. @@ -242,7 +231,6 @@ adventures: {print} 'Ne, ĝi ne estas ĉe la ' loko {print} 'Nun vi povas eniri la domon!' ``` - start_code: '# via kodo ĉi tie' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} poentoj > kazinistaj_poentoj {and} poentoj < 21: {print} 'Vi gajnas!' ``` - start_code: '# via kodo ĉi tie' calculator: name: Kalkulilo default_save_name: Kalkulilo @@ -551,7 +516,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Bonvenon al kalkulilo!''' 9: story_text: | En antaŭaj niveloj, vi lernis kiel verki kalkulilon. En ĉi tiu nivelo, vi povas apliki tiun kodon por verki matematikan ludeton jene… @@ -570,7 +534,6 @@ adventures: poentaro = poentaro + 1 {print} 'Bonege! Jen via poentaro: ' poentaro '/10!' ``` - start_code: '{print} ''Bonvenon al kalkulilo!''' 10: story_text: | Ĉi tiu kalkulilo-ludo helpas vin praktiki tabelojn de multipliko! @@ -587,7 +550,6 @@ adventures: {else} {print} 'Via respondo ne estas ĝusta. Jen la ĝusta respondo: ' ĝusta ``` - start_code: '# via kodo ĉi tie' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -603,7 +565,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Nun oni povas verki kalkulilon, kiu funkcias por decimalaj frakcioj. @@ -614,7 +575,6 @@ adventures: respondo = nombro1 + nombro2 {print} nombro1 ' plus ' nombro2 ' estas ' respondo ``` - start_code: '# via kodo ĉi tie' 13: story_text: | ### Exercise 1 @@ -631,7 +591,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -656,11 +615,7 @@ adventures: 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 @@ -692,7 +647,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -741,17 +695,6 @@ adventures: 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 @@ -774,12 +717,6 @@ adventures: {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. @@ -799,14 +736,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -828,16 +757,6 @@ adventures: 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 @@ -852,13 +771,6 @@ adventures: {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 @@ -881,17 +793,7 @@ adventures: {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' @@ -918,19 +820,7 @@ adventures: 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: @@ -946,11 +836,6 @@ adventures: 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 @@ -975,10 +860,7 @@ adventures: {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} @@ -1015,19 +897,7 @@ adventures: 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: @@ -1042,11 +912,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1086,26 +951,6 @@ adventures: 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 @@ -1134,27 +979,6 @@ adventures: 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 @@ -1187,31 +1011,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1241,9 +1040,7 @@ adventures: 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?' @@ -1300,36 +1097,6 @@ adventures: 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 @@ -1479,7 +1246,6 @@ adventures: Provu mem la kodon per la verda butono «Ruli kodon» sub la programa kampo. Vi povas presi tekston al la ekrano per la komando `{print}`. - start_code: '{print} saluton mondo!' 2: story_text: | En Nivelo 2, ni lernas du novajn komandojn: `{is}` kaj `{sleep}`. @@ -1494,11 +1260,9 @@ adventures: ``` story_text_2: | `{print}` ankoraŭ funkcias same, sed la komando `{ask}` ŝanĝiĝis. Vi devas uzi variablon ankaŭ en la komando `{ask}`. Ĝi aspektas jene: - start_code: '{print} saluton mondo!' 3: story_text: | En Nivelo 3, oni povas fari liston. Oni povas lasi la komputilon elekti hazardaĵon el la listo. Oni faras tion per `{at} {random}`. - start_code: '{print} saluton mondo!' 4: story_text: | En Nivelo 4, `{ask}` kaj `{print}` ŝanĝiĝis. @@ -1514,7 +1278,6 @@ adventures: respondo {is} {ask} 'Kion oni bezonas uzi ekde nun?' {print} 'Oni devas uzi ' respondo 'n' ``` - start_code: '{print} ''Saluton, mondo''' 5: story_text: | En Nivelo 5 estas io nova, la `{if}`! Per la `{if}`, oni povas elekti inter du malsamaj opcioj. @@ -1525,9 +1288,6 @@ adventures: nomo {is} {ask} 'kio estas via nomo?' {if} nomo {is} Hedy {print} 'bone' {else} {print} 'ba!' ``` - start_code: |- - nomo {is} {ask} 'Kio estas via nomo?' - {if} nomo {is} Hedy {print} 'bone!' {else} {print} 'ba!' 6: story_text: | En ĉi tiu nivelo, vi lernas ion novan: vi povas nun ankaŭ kalkuli. @@ -1550,7 +1310,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy estas amuza!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy estas amuza!''' 8: story_text: | `{ask}` kaj `{print}` ankoraŭ funkcias kiel vi konas ilin. Sed `{if}`, `{else}` kaj `{repeat}` ŝanĝiĝis! @@ -1574,10 +1333,6 @@ adventures: {print} 'ENTRUDULO!' {print} 'Vi ne rajtas uzi ĉi tiun komputilon!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Saluton ĉiuj' - {print} 'Jen linio represota 5 fojojn' 9: story_text: | En ĉi tiu nivelo, oni povas ne nur uzi plurajn liniojn kun `{if}` kaj `{repeat}`, sed oni ankaŭ povas kunmeti ilin! @@ -1592,13 +1347,6 @@ adventures: {else} {print} 'vi preferu picon' ``` - start_code: |- - {repeat} 3 {times} - manĝaĵo = {ask} 'Kion vi volas manĝi?' - {if} manĝaĵo {is} pico - {print} 'Bonege!' - {else} - {print} 'Pico estas preferinda.' 10: story_text: |- En ĉi tiu nivelo, ni lernas novan kodon nomitan `{for}`. Per `{for}` oni povas fari liston kaj uzi ĉiujn elementojn. @@ -1609,17 +1357,10 @@ adventures: {for} besto {in} bestoj {print} 'Mi amas ' besto 'n' ``` - start_code: |- - bestoj {is} hundo, kato, fiŝo - {for} besto {in} bestoj - {print} 'Mi amas ' besto 'n' 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: |- - {for} nombro {in} {range} 1 {to} 5 - {print} nombro 12: story_text: |- **Decimalaj frakcioj** @@ -1642,11 +1383,6 @@ adventures: {if} nomo {is} 'Hedy' {and} aĝo {is} 2 {print} 'Vi estas la vera Hedy!' ``` - start_code: |- - nomo = {ask} 'Kio estas via nomo?' - aĝo = {ask} 'Kio estas via aĝo?' - {if} nomo {is} 'Hedy' {and} aĝo {is} 2 - {print} 'Vi estas la vera Hedy!' 14: story_text: | Ni lernos pli da novaj sintaksaĵoj. Vi eble jam konas ilin pro matematiko: la `<` kaj `>`. @@ -1661,8 +1397,7 @@ adventures: {if} aĝo > 12 {print} 'Vi estas pli aĝa ol mi!' ``` - start_code: |- - aĝo = {ask} 'Kia estas via aĝo?' + {if} aĝo < 13 {print} 'Vi estas malpli aĝa ol mi!' {else} @@ -1681,11 +1416,6 @@ adventures: respondo = {ask} 'Kio estas 5 multiplikite per 5?' {print} 'Jen la ĝusta respondo' ``` - start_code: |- - respondo = 0 - {while} respondo != 25 - respondo = {ask} 'Kio estas 5 multiplikite per 5?' - {print} 'Jen ĝusta respondo' 16: story_text: |- Ni faros listojn laŭ la maniero de Python, kun rektaj krampoj ĉirkaŭ la listoj! Ni ankaŭ konservas la citilojn ĉirkaŭ ĉiu ero, kiel ni lernis en antaŭaj niveloj. @@ -1712,9 +1442,8 @@ adventures: {print} i {print} 'Jen mi venas!' 18: - story_text: Ni alvenis al vera Python-kodo! Tio signifas, ke ni devas uzi rondajn krampojn kun {print} kaj {range} de nun. - start_code: |- - nomo = 'Hedy' + story_text: |- + Ni alvenis al vera Python-kodo! Tio signifas, ke ni devas uzi rondajn krampojn kun {print} kaj {range} de nun. {print}('Mia nomo estas ', nomo) dice: name: Ĵetkuboj @@ -1742,7 +1471,6 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} Kion indikos la ĵetkubo ĉi foje?' 4: story_text: | En ĉi tiu nivelo ni povas fari frazojn kun la die valoro en la frazo, kun citaĵoj kompreneble. @@ -1803,7 +1531,6 @@ adventures: {print} 'La rezulto de la ĵeto de ' ludanto ' estas ' elektoj {at} {random} {sleep} ``` - start_code: '# via kodo ĉi tie' 15: story_text: | ### Exercise @@ -1828,7 +1555,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# via kodo ĉi tie' dishes: name: Lavi telerojn? default_save_name: Telerlavado @@ -1846,7 +1572,6 @@ adventures: ``` story_text_2: | Ĉu vi ne emas prepari la telerojn mem? Haki la programon por forigi vian nomon de la listo. - start_code: '{print} Kiu lavos la telerojn?' 4: story_text: | Per citiloj vi povas fari vian vazlavadon planadon pli bela. @@ -1862,7 +1587,6 @@ adventures: {sleep} {print} homoj {at} _ ``` - start_code: '{print} ''Kiu lavos la telerojn?''' 5: story_text: | Per la `{if}` vi nun povas amuziĝi pli kun elekto en la programo. Vi povas havi vian programon respondi al la elekto kiun la komputilo faris. @@ -1875,7 +1599,6 @@ adventures: lavonto {is} homoj {at} {random} {if} lavonto {is} Sofio {print} _ domaĝe ke mi devas lavadi _ {else} {print} 'feliĉe neniuj teleroj ĉar' _ 'jam lavas' ``` - start_code: '{print} ''Kiu lavos la telerojn?''' 6: story_text: | Kiom ofte ĉiuj lavos la telerojn? Ĉu tio estas justa? Vi povas kalkuli tion en ĉi tiu nivelo. @@ -1908,7 +1631,6 @@ adventures: {remove} lavonto {from} homoj lavonto = homoj {at} {random} ``` - start_code: '{print} ''Kiu lavos la telerojn?''' 7: story_text: | Per `{repeat}` oni povas ripeti pecojn da kodo. Vi povas uzi tion por determini la telerlavontojn por tuta semajno. @@ -1917,7 +1639,6 @@ adventures: homoj = panjo, paĉjo, Emilio, Sofio {repeat} _ _ {print} 'la lavonto estas' _ ``` - start_code: '{print} ''Kiu lavos la telerojn?''' 10: story_text: | En ĉi tiu nivelo, vi povas fari eĉ pli bonan lavadhoraron. @@ -1928,7 +1649,6 @@ adventures: {for} tago {in} tagoj {print} nomoj {at} {random} ' lavas telerojn je ' tago ``` - start_code: '# via kodo ĉi tie' elif_command: name: '{elif}' default_save_name: elif @@ -1976,10 +1696,6 @@ adventures: {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: |- 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. @@ -1991,10 +1707,6 @@ adventures: {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: 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. @@ -2034,7 +1746,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# via kodo ĉi tie' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2052,7 +1763,6 @@ adventures: ``` story_text_2: | Nun, Hedy povas respondi nur «jes», «ne» aŭ «eble». Ĉu vi povas doni al Hedy pliajn eblajn respondojn, kiel «certe» aŭ «demandu denove»? - start_code: '# via kodo ĉi tie' 4: story_text: | Ĉi tiu nivelo ne havas novajn funkciojn, sed permesas al vi ekzerci vin al uzado de la citiloj. @@ -2073,7 +1783,6 @@ adventures: {sleep} 2 {print} respondoj {at} {random} ``` - start_code: '# via kodo ĉi tie' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2086,7 +1795,6 @@ adventures: homo {is} {ask} 'Kiu vi estas?' {if} homo {is} Hedy {print} 'Vi certe gajnos!🤩' {else} {print} 'Misfortune, aliulo gajnos!😭' ``` - start_code: '# via kodo ĉi tie' 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. @@ -2117,7 +1825,6 @@ adventures: rezulto = rezulto * futbalo {print} 'You are ' rezulto ' percent smart.' ``` - start_code: '# via kodo ĉi tie' 7: story_text: | En ĉi tiu nivelo, oni povas uzi la komandon `{repeat}` por igi vian komputilon aŭguri plurfoje. @@ -2129,7 +1836,6 @@ adventures: respondo = jes, ne, eble {repeat} 3 {times} {print} 'Laŭ mia kristala globo… ' respondo {at} {random} ``` - start_code: '# via kodo ĉi tie' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2146,7 +1852,6 @@ adventures: {sleep} {print} 'Laŭ mia kristala globo…' respondoj {at} {random} ``` - start_code: '# via kodo ĉi tie' 10: story_text: | En ĉi tiu nivelo, vi lernos kiel programi la ludon MASH (domego, apartamento, barako, domo). En ĉi tiu ludo vi povas aŭguri por ĉiuj ludantoj samtempe, kiel aspektos iliaj estontecoj. @@ -2162,7 +1867,6 @@ adventures: {print} nomo ' ricevos ' dorlotbestoj {at} {random} 'n kiel sian dorlotbeston.' {sleep} ``` - start_code: '# via kodo ĉi tie' 12: story_text: | En ĉi tiu nivelo, vi povas montri plurvortajn aŭguraĵojn jene: @@ -2174,7 +1878,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# via kodo ĉi tie' functions: name: functions default_save_name: functions @@ -2214,21 +1917,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2257,13 +1945,6 @@ adventures: {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. @@ -2287,17 +1968,6 @@ adventures: 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 @@ -2326,7 +1996,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2348,7 +2017,6 @@ adventures: _ {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: Hantata domo default_save_name: Hantata domo @@ -2377,7 +2045,6 @@ adventures: ``` story_text_2: | Ĉu vi povas fini la timigan rakonton? Aŭ elpensu vian propran fantomdoman rakonton? - start_code: '{print} Kiel mi alvenis ĉi tien?' 2: story_text: | En ĉi tiu hantata domo, vi povas montri viajn monstrojn per vinjetosignoj. Kompreneble vi ankaŭ povas uzi vortojn. @@ -2424,7 +2091,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# via kodo ĉi tie' 4: story_text: | En ĉi tiu nivelo vi lernas kiel uzi citilojn en viaj ludoj. @@ -2440,7 +2106,6 @@ adventures: {sleep} {print} monsters {at} {random} ``` - start_code: '# via kodo ĉi tie' 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. @@ -2459,7 +2124,6 @@ adventures: {if} chosen_door {is} correct_door {print} 'Great! Youve escaped!' {else} {print} 'Oh no! You are being eaten by a...' monsters {at} {random} ``` - start_code: '# via kodo ĉi tie' 9: story_text: | In this level you can use nesting, which allows you to make the haunted house even more interactive! @@ -2488,7 +2152,6 @@ adventures: {if} ludanto {is} vivanta {print} 'Bonege! Vi pretervivis!' ``` - start_code: '{print} ''Eskapu el la hantata domo!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2514,7 +2177,6 @@ adventures: {if} ludanto {is} vivanta {print} 'Bonege! Vi pretervivis!' ``` - start_code: '{print} ''Eskapu el la hantata domo!''' 14: story_text: | ### Exercise @@ -2543,7 +2205,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2577,7 +2238,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2608,18 +2268,7 @@ adventures: {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?' @@ -2658,10 +2307,6 @@ adventures: _ _ _ 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... @@ -2678,11 +2323,6 @@ adventures: {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. @@ -2698,16 +2338,6 @@ adventures: {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 @@ -2736,11 +2366,6 @@ adventures: _ 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 @@ -2766,10 +2391,6 @@ adventures: 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: @@ -2778,8 +2399,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2811,8 +2431,7 @@ adventures: {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} @@ -2835,7 +2454,6 @@ adventures: {if} rano {is} grenouille {print} 'Bonege!' {else} {print} 'Ne, rano estas grenouille' ``` - start_code: '# via kodo ĉi tie' 16: story_text: | ### Exercise @@ -2856,7 +2474,6 @@ adventures: {print} 'Malĝuste, ' francaj_vortoj[i] ' signifas la jenon: ' traduko[i] {print} 'Vi respondis ' poentaro ' fojojn ĝuste.' ``` - start_code: '# via kodo ĉi tie' maths: name: maths default_save_name: maths @@ -2896,8 +2513,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Papago @@ -2923,7 +2539,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Mi estas Hedy la papago' 2: story_text: | Kreu vian propran Interretan dorlotpapagon, kiu kopios vin! @@ -2940,7 +2555,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Mi estas Hedy la papago!' 3: story_text: | Instruu al via papago novan vorton per `{add}`. @@ -2953,7 +2567,6 @@ adventures: {print} 🧒 Diru nova_vorto , Hedy! {print} 🦜 vortoj {at} {random} ``` - start_code: '# via kodo ĉi tie' 4: story_text: | In this level we have to use quotation marks with the commands `{ask}` and `{print}`. @@ -2967,7 +2580,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Rekompencu vian papagon, se ĝi diras la ĝustan vorton! @@ -2983,7 +2595,6 @@ adventures: {if} dirita_vorto {is} nova_vorto {print} '🧒 Bonege, Hedy! 🍪' {else} {print} '🧒 Ne, Hedy! Diru «' nova_vorto '»' ``` - start_code: '# via kodo ĉi tie' piggybank: name: Ŝparujo default_save_name: Ŝparujo @@ -3003,7 +2614,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# via kodo ĉi tie' 14: story_text: | ### Exercise @@ -3027,7 +2637,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3056,7 +2665,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3069,7 +2677,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3089,7 +2696,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3115,8 +2721,6 @@ adventures: ``` _ 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. @@ -3133,8 +2737,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Kvizmajstro @@ -3165,7 +2768,6 @@ adventures: {if} poentoj_b > poentoj_a {print} 'Vi apartenas al la B-klubo' ``` - start_code: '# via kodo ĉi tie' quotation_marks: name: '''quotation marks''' default_save_name: quotation_marks @@ -3195,10 +2797,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3233,10 +2831,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3270,9 +2864,6 @@ adventures: 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. @@ -3321,11 +2912,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3339,10 +2925,6 @@ adventures: {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! @@ -3357,13 +2939,6 @@ adventures: {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 @@ -3389,10 +2964,6 @@ adventures: 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? @@ -3410,11 +2981,6 @@ adventures: _ {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: Restoracio default_save_name: Restoracio @@ -3434,7 +3000,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - start_code: '# via kodo ĉi tie' 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. @@ -3454,7 +3019,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# via kodo ĉi tie' 3: story_text: | Ĉu vi havas problemon decidante, kion vi volas manĝi por vespermanĝo? Vi povas lasi Hedy elekti por vi! @@ -3486,7 +3050,6 @@ adventures: {remove} alergio {from} ingrediencoj {print} Vi ricevas laktotrinkaĵon kun ingrediencoj {at} {random} ``` - start_code: '# via kodo ĉi tie' 4: story_text: | En ĉi tiu nivelo, oni devas uzi citilojn kiam oni uzas la komandon `{print}`. @@ -3506,7 +3069,6 @@ adventures: {print} 'Dankon pro via mendo.' {print} 'Your ' manĝaĵo ' and ' trinkaĵo ' will be right there!' ``` - start_code: '# via kodo ĉi tie' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3527,7 +3089,6 @@ adventures: {if} anything {is} ne {print} 'Thats it!' {else} {print} 'Unu ' anything {print} 'Dankon pro via mendo. Ĝuu vian manĝon!' ``` - start_code: '# via kodo ĉi tie' 6: 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. @@ -3546,7 +3107,6 @@ adventures: {print} 'La prezo estas ' prezo ' spesmiloj' {print} 'Dankon, ĝuu vian manĝon!' ``` - start_code: '# via kodo ĉi tie' 7: story_text: | En ĉi tiu nivelo, vi lernis kiel uzi la komandon `{repeat}` por ripeti linion da kodo iomfoje. @@ -3558,7 +3118,6 @@ adventures: {repeat} homoj {times} manĝaĵo = {ask} 'Kion vi volas manĝi?' {print} 'Dankon pro via mendo! La manĝaĵo baldaŭ venos!' ``` - start_code: '# via kodo ĉi tie' 8: story_text: | En ĉi tiu nivelo, vi povas plu ellabori vian virtualan restoracion ripetante plurajn liniojn da kodo. Jen: @@ -3575,7 +3134,6 @@ adventures: ``` story_text_2: | Kompreneble, ĉi tiu kodo povas esti vastigita kun pli da eroj en la menuo, proponante trinkaĵojn, kaj/aŭ plurajn kursojn, do bonvolu aldoni tiom da ebloj kiel vi volas! - start_code: '# via kodo ĉi tie' 9: story_text: | In this level you can use nesting to make your restaurant more realistic and more fun! @@ -3603,7 +3161,6 @@ adventures: {print} 'That will be ' prezo ' dollar' {print} 'Ĝuu vian manĝon!' ``` - start_code: '# via kodo ĉi tie' 10: story_text: | En ĉi tiu nivelo, vi lernos kiel facile peti (per `{ask}`) la mendojn de viaj gastoj en mallonga kodo. @@ -3645,7 +3202,6 @@ adventures: prezo = 4 * homoj {print} 'Jen ' prezo ' spesmiloj totale!' ``` - start_code: '# via kodo ĉi tie' 12: story_text: | En ĉi tiu nivelo, vi povas uzi decimalajn frakciojn por igi vian menuon pli realeca. @@ -3664,7 +3220,6 @@ adventures: prezo = prezo + 2.35 {print} 'Bonvolu pagi ' prezo ' spesmilojn' ``` - start_code: '# via kodo ĉi tie' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3679,7 +3234,6 @@ adventures: prezo = prezo - 3 {print} 'La totalo estas ' prezo ' spesmiloj' ``` - start_code: '# via kodo ĉi tie' 15: story_text: | Per la `{while}` vi povas certigi, ke viaj klientoj povas mendadi ĝis ili finiĝos. @@ -3696,7 +3250,6 @@ adventures: pli = {ask} 'Ĉu vi volas mendi ion pli?' {print} 'Dankon!' ``` - start_code: '# via kodo ĉi tie' rock: name: Roko, papero, tondilo default_save_name: Roko @@ -3724,7 +3277,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Bonvenon al ludo de roko, papero kaj tondilo!' 2: story_text: | En ĉi tiu nivelo, vi povas praktiki uzi la variablojn, por ke vi povu fari la ludon de roko, papero kaj tondilo en la sekva nivelo! @@ -3733,7 +3285,6 @@ adventures: elekto {is} _ {print} Mi elektas elekto ``` - start_code: '# via kodo ĉi tie' 3: story_text: | En ĉi tiu nivelo ni povas eniri listojn kaj elekti aferojn el ili. @@ -3754,12 +3305,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Bonvenon al ludo de roko, papero kaj tondilo!' 4: story_text: | En ĉi tiu nivelo ni povas plu programi rokon, paperon, tondilon. Sed se vi volas aldoni tekston, vi devas uzi citilojn ankaŭ ĉi tie. Ĉu vi kompletigas la kodon enmetante la ĝustajn komandojn aŭ signojn sur la substrekoj? - start_code: '{print} ''Bonvenon al ludo de roko, papero kaj tondilo!''' 5: story_text: | En ĉi tiu nivelo ni povas determini kiu venkis. @@ -3779,7 +3328,6 @@ adventures: ``` Plenigu la ĝustan kodon en la spacoj por kontroli, ĉu la partio estas vana. - start_code: '{print} ''Bonvenon al ludo de roko, papero kaj tondilo!''' 9: story_text: | En ĉi tiu nivelo, vi povas programi la tutan ludon de roko, papero kaj tondilo ingante la {if}-komandojn. Ĉu vi povas fini la kodon? @@ -3799,7 +3347,6 @@ adventures: {print} 'Vi malgajnas!' # finu ĉi tiun kodon ``` - start_code: '# via kodo ĉi tie' 10: story_text: | Ĉu vi estas tro maldiligenta por ludi la ludon mem? Lasu Hedy ludi ĝin por vi! @@ -3810,7 +3357,6 @@ adventures: {for} ludanto {in} ludantoj {print} ludanto ' elektas la jenon: ' elektoj {at} {random} ``` - start_code: '# via kodo ĉi tie' 13: story_text: | Per la komando `{and}`, vi povas mallongigi vian kodon por la ludo! Rigardu la jenan ekzemplokodon kaj provu kompletigi ĝin. @@ -3828,7 +3374,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'La komputilo gajnas!' ``` - start_code: '# via kodo ĉi tie' 15: story_text: | ### Exercise @@ -3850,7 +3395,6 @@ adventures: {print} 'Vi gajnas la partion!' gajnis = 'jes' ``` - start_code: '# via kodo ĉi tie' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3867,7 +3411,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: Superspiono default_save_name: Superspiono @@ -3891,7 +3434,6 @@ adventures: b = 'hodiaŭ je la 10a horo' {print} a + b ``` - start_code: '# via kodo ĉi tie' 13: story_text: | La kodo, kiun vi faris en la antaŭa nivelo, estas simpligebla en ĉi tiu nivelo per la komando `{and}`. @@ -3904,7 +3446,6 @@ adventures: {else} {print} 'Iru al la stacidomo je la 10a horo' ``` - start_code: '# via kodo ĉi tie' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3920,10 +3461,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Kantu! default_save_name: Kanto @@ -3957,7 +3494,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Ŝarkido''' 7: story_text: | Kantoj ofte enhavas multe da ripetaĵojn. Ekzemple… Ŝarkido! Se vi kantas ĝin, vi ripete kantas la samajn vortojn: @@ -3975,7 +3511,6 @@ adventures: ``` Post Ŝarkido, vi povas programi aliajn kantojn. Ekzistas multaj kantoj enhavantaj ripetaĵojn. - start_code: '{print} ''Ŝarkido''' 8: story_text: | En antaŭa nivelo vi programis la kanton 'Boteloj da biero'. Vi faris unu verson kaj tiam devis kopii la versojn 99 fojojn. En la nivelo 7 vi povas ripeti la kanton 99 fojojn, nur aldonante unu simplan linion! @@ -3989,7 +3524,6 @@ adventures: nombro = nombro - 1 {print} nombro ' boteloj da biero sur la muro' ``` - start_code: '# via kodo ĉi tie' 10: story_text: | En ĉi tiu nivelo vi povas facile fari la infanan kanton "Kvin simietoj". Ĉu vi povas fari la lastan koruson? @@ -4041,7 +3575,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# via kodo ĉi tie' 11: story_text: | En ĉi tiu nivelo, oni povas uzi la komandon `{for} i {in} {range}` por fari kantojn, kiuj uzas kalkuladon. @@ -4056,7 +3589,6 @@ adventures: {else} {print} 'SIMIOJ NE SALTU SUR LA LITO!' ``` - start_code: '# via kodo ĉi tie' 12: story_text: | En ĉi tiu kanto, oni povas eĉ pli facile programi «se vi estas feliĉa kaj vi scias ĝin, frapu la manojn», ĉar oni povas meti ĉiujn agojn en unu variablon jene: @@ -4071,7 +3603,6 @@ adventures: {print} 'se vi feliĉas kaj scias tion' {print} ago ``` - start_code: '# via kodo ĉi tie' 13: 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? @@ -4088,16 +3619,6 @@ adventures: {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: | En ĉi tiu nivelo, vi povas programi kanton kiel OldMacDonald eĉ pli rapide. Vi povas konekti la ĝustan beston al la ĝusta sono simple metante ilin en la sama loko en la listo. @@ -4130,7 +3651,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# via kodo ĉi tie' 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. @@ -4152,7 +3672,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4174,15 +3693,6 @@ adventures: {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: Tri en Vico default_save_name: Trienvico @@ -4250,7 +3760,6 @@ adventures: {else} signo = 'x' ``` - start_code: '# via kodo ĉi tie' 14: story_text: | En la antaŭaj niveloj, vi faris la ludon «Tri en Vico». Nun vi lernis kiel uzi la signon `=`, la signon `==` kaj la signon `!=`. @@ -4313,7 +3822,6 @@ adventures: {else} signo = 'x' ``` - start_code: '# via kodo ĉi tie' 15: story_text: | En ĉi tiu nivelo, vi povas plibonigi vian ludon «Tri en Vico» per la iteracio `{while}`. Per ĉi tiu iteracio, vi povas kombini la `{if} ludo != 'finita'` kaj la `{for} i {in} {range} 1 ĝis 9` en unu simplan linion. @@ -4375,7 +3883,6 @@ adventures: {else} signo = 'x' ``` - start_code: '# via kodo ĉi tie' 17: story_text: | En la antaŭaj niveloj, la ludo «Tri en Vico» havis ĝenan trajton. Post ĉiu movo, oni devis respondi, ĉu oni gajnis aŭ ne. @@ -4462,7 +3969,6 @@ adventures: {else}: signo = 'x' ``` - start_code: '# via kodo ĉi tie' turtle: name: Testudo default_save_name: Testudo @@ -4484,9 +3990,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | En ĉi tiu nivelo vi povas uzi variablojn por fari la testudon interaga. Ekzemple vi povas demandi al la ludanto kiom da paŝoj devas fari la testudo. @@ -4510,11 +4013,6 @@ adventures: {turn} angulo {forward} 25 ``` - start_code: |- - {print} Testuda vetkuro! - angulo {is} 90 - {turn} angulo - {forward} 25 3: story_text: | En ĉi tiu nivelo, oni povas uzi `{at} {random}` kun la desegnanta testudo. Hazarda elekto igas la testudon marŝi laŭ malsamaj vojoj ĉiufoje. @@ -4525,10 +4023,6 @@ adventures: {turn} anguloj {at} {random} {forward} 25 ``` - start_code: |- - anguloj {is} 10, 50, 90, 150, 250 - {turn} anguloj {at} {random} - {forward} 25 4: story_text: | En Nivelo 4, oni devas uzi citilojn kun `{print}` kaj `{ask}`. Ankaŭ dum desegnado! @@ -4555,11 +4049,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Desegnante figurojn' - angulo {is} 90 - {turn} angulo - {forward} 25 5: story_text: | En Nivelo 5, oni povas fari elekton per `{if}`. Ekzemple, inter diversaj specoj de figuroj. @@ -4592,12 +4081,6 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: |- - {print} 'Desegnante figurojn' - figuro {is} {ask} 'Ĉu vi deziras kvadraton aŭ triangulon?' - {if} figuro {is} triangulo angulo {is} 120 {else} angulo {is} 90 - {turn} angulo - {forward} 25 6: story_text: | En ĉi tiu nivelo vi povas uzi kalkulojn por desegni malsamajn figurojn. @@ -4621,7 +4104,6 @@ adventures: {forward} 50 {turn} angulo ``` - start_code: '{print} ''Desegnante figurojn''' 8: story_text: | Nun ni povas ripeti plurajn liniojn; tial ni povas fari figurojn pli facile. @@ -4657,7 +4139,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4675,7 +4156,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4700,16 +4180,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4725,7 +4195,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4736,7 +4205,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4747,7 +4215,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4765,7 +4232,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4784,7 +4250,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4804,7 +4269,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4815,7 +4279,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4828,7 +4291,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4859,7 +4321,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4900,7 +4361,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4923,7 +4383,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4952,7 +4411,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4976,7 +4434,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5004,7 +4461,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5038,7 +4494,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5058,11 +4513,6 @@ adventures: 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 @@ -5080,4 +4530,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/es.yaml b/content/adventures/es.yaml index 7efb779906a..a353922d9a1 100644 --- a/content/adventures/es.yaml +++ b/content/adventures/es.yaml @@ -27,7 +27,6 @@ adventures: Utiliza mínimo un comando `{ask}` y un comando `{echo}`. Lo puedes hacer sobre cualquier tema que quieras. Si no se te ocurre ningún tema, usa uno de estos: en el cine, un partido o un día en el zoológico. - start_code: '{print} Aquí comienza tu historia' 2: story_text: | En el nivel 2 puedes hacer tu historia más divertida. El nombre de tu protagonista ahora puede estar en cualquier posición de la frase. @@ -53,7 +52,6 @@ adventures: Cambia los comandos `{ask}` y `{echo}` en tu código a la forma correcta que aprendiste en este nivel. **Extra** añade un comando `{sleep}` a tu código para crear tensión en la historia. - start_code: '{print} Tu historia' 3: story_text: | En el nivel 3 puedes hacer tu historia más divertida. Puedes usar aleatoriedad para cualquier monstruo, animal, o cualquier otro obstáculo, como este: @@ -87,7 +85,6 @@ adventures: botar {is} {ask} ¿Qué artículo debería botar él? {remove} botar {from} bolso ``` - start_code: '{print} Tu historia' 4: story_text: | Quizá te hayas dado cuenta de que aún hay un problema en los niveles anteriores. ¿Has intentado mostrar por pantalla una frase que contenga la palabra nombre? por ejemplo `{print}` mi nombre es nombre. @@ -169,7 +166,6 @@ adventures: {print} '¡Oh, no! Richard es demasiado lento... {print} _ ``` - start_code: '# coloca tu código aquí' 9: story_text: | En este nivel puedes usar los comandos `{if}` y `{repeat}` dentro de otros comandos `{if}` y `{repeat}`. @@ -198,7 +194,6 @@ adventures: {else} {print} 'Robin se va a casa' ``` - start_code: '# coloca tú código aquí' 10: story_text: | En este nivel puedes usar el comando {for} en tu historia. De esta manera puedes programar fácilmente el libro para niños 'oso pardo, oso pardo, ¿qué ves?' @@ -207,7 +202,6 @@ adventures: Mira en la historia si no la conoces, asegúrate que este igual que el libro. example_code: "```\nanimales = _ , _ , _ \n{print} 'Oso pardo, Oso pardo'\n {print} '¿Qué ves?'\n```\n" - start_code: '# coloca tu código aquí' 12: story_text: |- En este nivel puedes usar las comillas para almacenar múltiples palabras en una variable. @@ -220,7 +214,6 @@ adventures: nombre = 'La Reina de Inglaterra' {print} nombre ' estaba comiendo un pedazo de pastel, cuando de pronto...' ``` - start_code: '# coloca tu código aquí' 13: story_text: | Usando los comandos `{and}` y `{or}` puedes hacer tus historias mas versátiles. Puedes hacer dos preguntas y responder a la combinación de respuestas. @@ -239,7 +232,6 @@ adventures: {if} camino {is} 'derecha' {and} arma {is} 'espada' _ ``` - start_code: '# coloca tu código aquí' 15: story_text: | Usar un bucle `{while}` puede hacer que tus historias sean más interesantes. Por ejemplo, puedes usar `{while} game == 'on'` para seguir jugando hasta que termine. @@ -262,7 +254,6 @@ adventures: {print} 'No, no están en ' lugar {print} '¡Ahora puedes entrar en la casa' ``` - start_code: '# coloca tú código aquí' 18: story_text: | Vamos a hacer otra historia, pero ahora usaremos paréntesis con `{print}`. @@ -283,7 +274,6 @@ adventures: nombre = {input}("Cual es tu nombre?") {print}('Bienvenido a esta historia!') ``` - start_code: '# Pon tu código aquí' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: comando_añadir_borrar @@ -323,8 +313,7 @@ adventures: _ {print} Recibe un batido de sabores {at} {random} ``` - start_code: |- - animales {is} perro, gato, canguro + gustar {is} {ask} ¿Cuál es tu animal preferido? {add} gustar {to_list} animales no_gustar {is} {ask} ¿Qué animal no te gusta? @@ -384,8 +373,7 @@ adventures: _ ¿Qué tal estás? _ ``` - start_code: | - {print} ¡Hola! + {ask} ¿Cómo te llamas? {echo} hola 2: @@ -531,7 +519,6 @@ adventures: {elif} puntos > puntos_repartidor {and} puntos < 21: {print} '¡Ganaste!' ``` - start_code: '# pon tu código aquí' calculator: name: Calculadora default_save_name: Calculadora @@ -602,7 +589,6 @@ adventures: {else} {print} 'Te equivocas. La respuesta correcta es ' correcta ``` - start_code: '# pon tu código aquí' 11: story_text: | Con `{for}` puedes simplificar programas de practica de las tablas de multiplicación. @@ -618,10 +604,6 @@ adventures: {for} i {in} {range} 1 {to} 10 {print} i * número ``` - start_code: | - número = 10 - {for} i {in} {range} 1 {to} 10 - {print} i * número 12: story_text: | En este nivel puedes hacer una calculadora que funcione para números decimales. @@ -640,7 +622,6 @@ adventures: respuesta = _ {print} número1 ' más ' número2 ' es ' respuesta ``` - start_code: '# pon tu código aquí' 13: story_text: | ### Ejercicio 1 @@ -657,7 +638,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Escribe tu código aquí' 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. @@ -682,11 +662,7 @@ adventures: 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 @@ -718,7 +694,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# pon tu código aquí' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -767,17 +742,6 @@ adventures: {clear} {print} '¡SORPRESA!' ``` - start_code: | - {print} '3' - {sleep} - {clear} - {print} '2' - {sleep} - {clear} - {print} '1' - {sleep} - {clear} - {print} '¡SORPRESA!' debugging: name: depurando default_save_name: depurando @@ -800,8 +764,7 @@ adventures: {print} ¿Cuáles son tus aficiones? {echo} Tus aficiones son ``` - start_code: | - {print} Me encanta programar + ¿A ti también te gusta programar? {echo} {print} ¿Cuáles son tus aficiones? @@ -854,10 +817,7 @@ adventures: pelicula_mañana {is} opciones_peliculas {at} {random} ¡Voy a por las palomitas! {print} ``` - start_code: | - opciones_peliculas {is} Dracula, Fast and furious, Solo en casa, Barbie - pelicula_escogida {is} opciones_peliculas {at} {random} - {print} Esta noche veremos pelicula _escogida + gustar {ask} ¿Te gusta esa película? {print} Mañana veremos otra. {add} pelicula_escogida {to} opciones_peliculas @@ -878,8 +838,7 @@ adventures: {print} 'autor es tu autor favorito' {print} Hmmm... creo que deberías probar... libros {at} {random} ``` - start_code: | - {print} '¡Bienvenido a la biblioteca en línea! + {ask} ¿Qué género de libros te gusta? {print} Te gusta el género autor {is} {ask} '¿Quién es tu autor favorito?' @@ -907,17 +866,7 @@ adventures: {else} 'Serán $5,50' {print} '¡Buen baño!' ``` - 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' @@ -944,19 +893,7 @@ adventures: 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: @@ -972,11 +909,6 @@ adventures: 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 @@ -1001,10 +933,7 @@ adventures: {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} @@ -1041,19 +970,7 @@ adventures: 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: @@ -1068,11 +985,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1112,26 +1024,6 @@ adventures: 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 @@ -1160,27 +1052,6 @@ adventures: 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 @@ -1213,31 +1084,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1267,9 +1113,7 @@ adventures: 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?' @@ -1326,36 +1170,6 @@ adventures: 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 @@ -1527,14 +1341,12 @@ adventures: Esos cambios en el nivel 2. En el nivel 2 aprenderás a trabajar con variables, que te permiten guardar varias partes de información e imprimirlas donde quieras. ¡Así que vayamos a la siguiente pestaña! - start_code: '{print} hola mundo!' 3: story_text: | En el nivel anterior has aprendido lo que es una variable y como puedes usarla para hacer tus aventuras más interactivas. Pero... ¡eso no es lo único que puedes hacer con las variables! También puedes usar variables para hacer listas. Incluso puedes dejar que Hedy elija una palabra al azar de una lista, ¡lo que te permite hacer juegos de verdad! ¡Echa un vistazo a la siguiente pestaña! - start_code: '{print} hola mundo!' 4: story_text: | En los niveles anteriores has estado practicando con las variables, pero es posible que te hayas encontrado con este problema. @@ -1554,9 +1366,6 @@ adventures: nombre {is} Sofia {print} Mi nombre es nombre ``` - start_code: | - Mi nombre {is} Sophie - {print} Mi nombre es nombre 5: story_text: | En los niveles anteriores ya has aprendido a usar `{at} {random}` lo que hizo tus juegos distintos cada vez que ejecutaste el código. @@ -1594,7 +1403,6 @@ adventures: precio_total {is} precio_comida + precio_bebida {print} 'Serán ' precio_total ' dólares, por favor' ``` - start_code: '# pon tu código aquí' 7: story_text: | ¡Gran trabajo! Has alcanzado el siguiente nivel, lo que significa que has practicado con `{if}` and `{else}`. Te habrás dado cuenta de que tus códigos son cada vez más extensos. @@ -1608,11 +1416,6 @@ adventures: {print} 'cumpleaños feliz querido Hedy' {print} 'cumpleaños feliz' ``` - start_code: | - {print} 'cumpleaños feliz' - {print} 'cumpleaños feliz' - {print} 'cumpleaños feliz querido Hedy' - {print} 'cumpleaños feliz' 8: story_text: | Ahora has aprendido a como repetir una única línea de código. Esto es útil, pero no siempre es suficiente. A veces quieres repetir varias líneas de una vez. @@ -1652,12 +1455,10 @@ adventures: {print} 'si eres feliz y lo sabes y realmente quieres mostrarlo' {print} 'si eres feliz y lo sabes aplaude con tus manos' ``` - start_code: '{print} ''!Vayamos a la siguiente pestaña!''' 11: story_text: | Has alcanzado el nivel 11, ¡lo estás haciendo genial! En los niveles superiores, Hedy se centra más y más en enseñarte el lenguaje de programación Python. En Python no hay comando `{repeat}`, pero hay un comando que funciona como {repeat}.¿Tienes curiosidad de saber cómo se llama `{repeat}` en el idioma Python? Averígualo rápidamente. - start_code: '{print} ''!Vayamos a la siguiente pestaña!''' 12: story_text: | Quizá hayas intentado usar números decimales en aventura del restaurante. Si lo hiciste, te habrás dado cuenta que Hedy no todavía los entendía y siempre los redondeaba. @@ -1791,9 +1592,6 @@ adventures: ``` opciones {is} _ ``` - start_code: | - opciones {is} 1, 2, 3, 4, 5, lombriz de tierra - {print} ¡Lanzaste _ {at} {random}! 4: story_text: | En este nivel podemos crear dados. Pero en esta ocasión puedes intentarlo por ti mismo, sin un código de ejemplo! @@ -1856,7 +1654,6 @@ adventures: {print} jugador ' tiró un ' opciones {at} {random} {sleep} ``` - start_code: '# Coloca tu código aquí' 15: story_text: | ### Exercise @@ -1881,7 +1678,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# pon tú código aquí' dishes: name: ¿Platos? default_save_name: Platos @@ -1972,11 +1768,6 @@ adventures: {for} día {in} días {print} nombres {at} {random} ' Hará los platos el ' día ``` - start_code: | - días = lunes, martes, miércoles, jueves, viernes, sábado, domingo - nombres = mamá, papá, Emma, Sophie - {for} día {in} días - {print} nombres {at} {random} ' lava los platos el ' día elif_command: name: '{elif}' default_save_name: sinosi @@ -2024,10 +1815,6 @@ adventures: {for} animal {in} animales {print} 'Yo amo ' animal ``` - start_code: |- - animales {is} perro, gato, pez globo - {for} animal {in} animales - {print} 'Yo amo ' animal 11: story_text: |- En este nivel, añadimos una nueva forma del `{for}`. En niveles anteriores, usamos `{for}` con una lista, pero también podemos usar `{for}` con números. @@ -2040,10 +1827,6 @@ adventures: {print} contador {print} 'Listos o no, allí voy.' ``` - start_code: |- - {for} contador {in} {range} 1 {to} 10 - {print} contador - {print} 'Listo o no. ¡Allá voy!' 17: story_text: | Ahora vamos a cambiar la sangría un poco. Cada vez que necesitemos una sangría, necesitamos `:` en la línea antes de la sangría. @@ -2082,7 +1865,6 @@ adventures: ### Ejercicio Copia el código de ejemplo en tu pantalla de entrada y rellena los espacios en blanco para hacer que tu código funcione. **Extra** Cambia el código y deja que el adivino no sólo prediga tu nombre, sino también tu edad, tu equipo favorito de deporte o cualquier otra cosa sobre ti mismo. - start_code: '# pon tu código aquí' 3: story_text: | En los niveles anteriores has creado tu primera máquina de la fortuna, pero Hedy realmente no podía predecir nada, sólo `{echo}`. @@ -2100,7 +1882,6 @@ adventures: story_text_2: | ### Ejercicio Ahora Hedy sólo puede responder si, no o quizás. ¿Puedes darle más opciones a Hedy, como 'sin duda' o 'pregunta de nuevo'. - start_code: '# pon tu código aquí' 4: story_text: | Este nivel no tiene funciones nuevas, pero te permite practicar usando las comillas. @@ -2125,7 +1906,6 @@ adventures: {sleep} 2 {print} respuesta {at} {random} ``` - start_code: '# pon tu código aquí' 5: story_text: | ### Ejercicio @@ -2149,7 +1929,6 @@ adventures: {if} persona {in} amigos {print} respuesta_buena {at} {random} {else} {print} respuesta_mala {at} {random} ``` - start_code: '# pon tu código aquí' 6: story_text: | En este nivel puedes usar matemáticas para en tus predicciones de adivino. Esto te permite crear fórmulas (bobas) para calcular el futuro. @@ -2172,7 +1951,6 @@ adventures: {sleep} {print} niños ' niños!' ``` - start_code: '# pon tu código aquí' 7: story_text: | ### Ejercicio @@ -2185,7 +1963,6 @@ adventures: opciones = te quiere, no te quiere _ _ _ _ opciones {at} {random} ``` - start_code: '# pon tu código aquí' 8: story_text: | !En el siguiente ejemplo puedes hacer que tu adivino haga varias preguntas y también que las imprima! @@ -2203,7 +1980,6 @@ adventures: {sleep} {print} 'Mi bola de cristal dice...' respuestas {at} {random} ``` - start_code: '# pon tu código aquí' 10: story_text: | En este nivel aprenderás a programar el juego MACC (mansión, apartamento, cabaña, casa). En este juego puedes predecir para todos los jugadores a la vez, cuál será su futuro. @@ -2222,7 +1998,6 @@ adventures: {print} nombre ' tendrá un ' mascotas {at} {random} ' como su mascota.' {sleep} ``` - start_code: '# Escribe tu código aquí' 12: story_text: "Desde el nivel 12, tendrás que usar comillas en las listas, antes y después de cada elemento.\n\n### Ejercicio \nAñade dos predicciones a la lista" example_code: | @@ -2233,7 +2008,6 @@ adventures: {sleep} {print} tu fortuna {at} {random} ``` - start_code: '# pon tu código aquí' functions: name: functions default_save_name: functions @@ -2273,21 +2047,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2316,13 +2075,6 @@ adventures: {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. @@ -2346,17 +2098,6 @@ adventures: 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 @@ -2385,7 +2126,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2407,7 +2147,6 @@ adventures: _ {print} nombre ' es mejor en ' asignaturas {at} {random} _ {print} nombre ' su gran miedo es ' miedos {at} {random} ``` - start_code: '# pon tu código aquí' haunted: name: La Casa Embrujada default_save_name: La Casa Embrujada @@ -2494,7 +2233,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# pon tu código aquí' 4: story_text: | En este nivel vas a aprender como usar comillas en tus juegos. @@ -2516,7 +2254,6 @@ adventures: {sleep} {print} monstruo {at} {random} ``` - start_code: '# pon tú código aquí' 5: story_text: | Hasta este nivel el juego de la casa encantada siempre preguntaba al jugador que eligiera una puerta, pero como puede que te hayas dado cuenta los jugadores no necesitaban responder correctamente. @@ -2538,7 +2275,6 @@ adventures: _ _ _ _ {print} '¡Genial! ¡Has escapado!' {else} {print} '¡O no! Te ha comido un...' monstruos {at} {random} ``` - start_code: '# pon tu código aquí' 9: story_text: | En este nivel puedes usar anidaciones, ¡lo que te permite hacer tu casa encantada incluso más interactiva! @@ -2611,7 +2347,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2645,7 +2380,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2676,18 +2410,7 @@ adventures: {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?' @@ -2726,10 +2449,6 @@ adventures: _ _ _ 4 _ '¡Gran trabajo!' _ _ 'No 2 + 2 = 4' ``` - start_code: |- - nombre {is} {ask} '¡cuál es tu nombre?' - {if} nombre {is} Hedy {print} 'genial' - {else} {print} 'boo!' 8: story_text: | ## Si… Sino… @@ -2793,8 +2512,7 @@ adventures: _ respuesta _ animales _ '¡También el mío!' _ _ 'Mis animales preferidos son perros, vacas y ovejas' ``` - start_code: |- - colores_bonitos {is} verde, amarillo + color_favorito {is} {ask} '¿Cuál es tu color preferido?' {if} color_favorito {in} colores_bonitos {print} '¡bonito!' {else} {print} 'meh' @@ -2823,10 +2541,6 @@ adventures: animales_favoritos {is} _ {print} me gusta animales_favoritos ``` - start_code: |- - nombre {is} Hedy - edad {is} 15 - {print} nombre tiene edad años 6: story_text: | ¡También hacemos un cambio al almacenar una palabra en una variable! Ahora se puede utilizar `=` en lugar de `{is}` cuando almacenamos un nombre o un número en una variable, así: @@ -2835,8 +2549,7 @@ adventures: nombre = Hedy respuesta = 20 + 4 ``` - start_code: | - nombre = Hedy + respuesta = 20 + 4 14: story_text: | @@ -2896,7 +2609,6 @@ adventures: {if} rana {is} granillo {print} '¡Guau! ¡Genial!' {else} {print} 'No, rana es granillo' ``` - start_code: '# pon tu código aquí' 16: story_text: | ### Exercise @@ -2917,7 +2629,6 @@ adventures: {print} 'No, ' palabras_francesas[i] ' significa ' traducción[i] {print} 'Tuviste ' puntuación ' respuestas correctas.' ``` - start_code: '# pon tu código aquí' maths: name: cálculos default_save_name: cálculos @@ -2962,8 +2673,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'los números decimales ahora tienen que usar un punto' + {print} 2.5 + 2.5 parrot: name: Loro @@ -2991,8 +2701,7 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Soy Hedy el loro + {ask} ¿Cómo te llamas? {echo} {echo} @@ -3031,7 +2740,6 @@ adventures: {print} 🧒 Di nueva_palabra, Hedy! {print} 🦜 palabras {at} {random} ``` - start_code: '# pon tu código aquí' 4: story_text: | En este nivel, tenemos que usar comillas con los comandos `{ask}` y`{print}`. @@ -3046,7 +2754,6 @@ adventures: {print} _ 🧒 ¡Di _ nueva_palabra _, Hedy!_ {print} _ 🦜 _ palabras {at} {random} ``` - start_code: '# Escribe tu código aquí' 5: story_text: | ¡Recompensa tu loro si dice la ¡palabra correcta! @@ -3065,7 +2772,6 @@ adventures: _ palabra_dicha {is} nueva_palabra _ '🧒 ¡Gran trabajo, Hedy!🍪' _ _ '🧒 No, Hedy, di ' nueva_palabra ``` - start_code: '# pon tu código aquí' piggybank: name: Cerdito hucha default_save_name: Cerdito hucha @@ -3089,7 +2795,6 @@ adventures: semanas = a_ahorrar / paga {print} 'Podrás comprar un ' _ ' en ' _ ' semanas.' ``` - start_code: '# pon tu código aquí' 14: story_text: | ### Exercise @@ -3113,7 +2818,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Presiónalo default_save_name: Presionado @@ -3142,7 +2846,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# pon tu código aquí' 7: story_text: | Ahora que ya has aprendido acerca de `{repeat}`, podemos presionar las teclas múltiples veces. @@ -3155,7 +2858,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# pon tu código aquí' 9: story_text: | Ahora que sabes como combinar sentencias, puedes crear una herramienta de mecanografía con `{pressed}` @@ -3175,7 +2877,6 @@ adventures: _ _ ``` - start_code: '# pon tu código aquí' print_command: name: '{print}' default_save_name: imprimir @@ -3201,8 +2902,6 @@ adventures: ``` _ ¡Hola! ``` - start_code: | - {print} ¡Bienvenido a Hedy! 18: story_text: |- ¡Hemos llegado a código real de Python! Eso significa que tendremos que usar paréntesis con `{print}` y `{range}` de ahora en adelante. @@ -3219,8 +2918,7 @@ adventures: temperatura = 25 {print}('Hay ', temperatura, ' grados fuera') ``` - start_code: |- - nombre = 'Hedy' + {print}('Mi nombre es ', nombre) quizmaster: name: Presentador @@ -3251,7 +2949,6 @@ adventures: {if} puntos_b > puntos_a {print} '¡Perteneces al club B!' ``` - start_code: '# pon tu código aquí' quotation_marks: name: '''comillas''' default_save_name: comillas @@ -3281,8 +2978,7 @@ adventures: {print} 'I'm babysitting my sister's kids' {print} 'What's more fun than that?' ``` - start_code: |- - {print} '¡Debes usar comillas a partir de ahora!' + answer {is} {ask} '¿Qué tenemos que usar a partir de ahora?' {print} 'Necesitamos usar ' answer 'de ahora en adelante' 12: @@ -3356,9 +3052,6 @@ adventures: premios {is} _ _ ``` - start_code: | - animales {is} perro, gato, canguro - {print} animales {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. @@ -3408,11 +3101,6 @@ adventures: ``` {repeat} 3 {times} {print} '¡Hedy es divertido!' ``` - start_code: | - {print} 'cumpleaños feliz' - {print} 'cumpleaños feliz' - {print} 'cumpleaños feliz querido Hedy' - {print} 'cumpleaños feliz' 8: story_text: | ### Repetir comandos y sangría @@ -3426,10 +3114,6 @@ adventures: {print} 'Hola a todos' {print} 'Todo esto se repite 5 veces' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hola a todos' - {print} 'Esto se imprimirá 5 veces' 9: story_text: | En este nivel no puedes usar varias líneas sólo con `{if}` y `{repeat}`, ¡pero si puedes juntarlas! @@ -3444,8 +3128,7 @@ adventures: {else} {print} 'la pizza es mejor' ``` - start_code: |- - {repeat} 3 {times} + comida = {ask} '¿Qué quieres?' {if} comida {is} pizza {print} '¡genial!' @@ -3497,11 +3180,6 @@ adventures: _ {print} 'El hombre magdalena' _ {print} '¿Conoces al hombre magdalena, que vive en la Calle Drury?' ``` - start_code: |- - {repeat} 3 {times} - {print} 'Esta línea se repetirá...' - {print} 'Esta también...' - {print} '¡pero esta no!' restaurant: name: Restaurante default_save_name: Restaurante @@ -3525,7 +3203,6 @@ adventures: Después añade al menos 4 líneas más de código al programa del restaurante. Pregunta a los clientes qué les gustaría beber y pregunta si quieren pagar en efectivo o con tarjeta. Por último, piensa una manera adecuada de despedirte de tus clientes. - start_code: '# pon tu código aquí' 2: story_text: | En el nivel 2 puedes ampliar su restaurante usando variables. En el nivel 1 Hedy sólo podía `{echo}` la orden una vez y sólo podía recordar lo último que se le pidió. @@ -3550,7 +3227,6 @@ adventures: Ahora añade tu propio resumen de la comida y las bebidas pedidas por el cliente. **Extra** Ahora que has aprendido a usar variables, puedes usar tantas variables como quieras en una línea de código. ¿Puedes añadir más variables a tu código, como comer aquí o para llevar, efectivo o tarjeta, con o sin pajita etc.? - start_code: '# pon tu código aquí' 3: story_text: | ¿Tienes problemas para decidir qué quieres cenar? ¡Puedes dejar que Hedy elija por ti! @@ -3578,7 +3254,6 @@ adventures: precios {is} _ _ ``` - start_code: '# pon tu código aquí' 4: story_text: | En este nivel tienes que usar comillas cuando uses los comandos `{print}` o `{ask}`. @@ -3602,7 +3277,6 @@ adventures: {print} Gracias por tu orden. {print} Tu comida y bebidas ya van a estar! ``` - start_code: '# pon tu código aquí' 5: story_text: | ### Ejercicio @@ -3619,7 +3293,6 @@ adventures: {if} bebida {in} bebidas_disponibles {print} '¡Una ' bebida 'de camino!' {else} {print} 'Lo siento, no servimos eso' ``` - start_code: '# pon tu código aquí' 6: story_text: | En este nivel puedes usar las matemáticas para calcular el precio total del pedido de tus clientes, que puede hacer tu restaurante virtual más realista. @@ -3647,7 +3320,6 @@ adventures: {print} 'Eso será ' precio ' dólares, por favor' {print} '¡Gracias, que aproveche!' ``` - start_code: '# pon tú código aquí' 7: story_text: | En este nivel aprendiste a usar el comando `{repeat}` para repetir una línea de código un número de veces @@ -3661,7 +3333,6 @@ adventures: {print} '¡Bienvenido al restaurante Hedys!' personas = {ask} '¿Cuántas personas se unen a nosotros hoy?' ``` - start_code: '# pon tú código aquí' 8: story_text: | En este nivel puedes hacer tu restaurant más complejo repitiendo múltiples líneas de código. Así: @@ -3680,7 +3351,6 @@ adventures: ### Ejercicio Este código puede ampliarse con más cosas en el menú, por ejemplo ofreciendo bebidas, y/o varios platos o postres. Añade al menos una cosa más. **Extra** Añade incluso más cosas, ¡tantas opciones como quieras! - start_code: '# pon tú código aquí' 9: story_text: "¡En este nivel puedes usar anidación para hacer tu restaurant más realista y divertido!\n\n### Ejercicio\nSe ha eliminado la sangría en el código de ejemplo. \n¿Puedes averiguar cuánta sangría necesita cada línea para que el código funcione correctamente?\nSi el cliente pide\ \ pizza, Hedy no debería preguntarle al cliente qué salsa quiere.\n\n**Extra** Un restaurante no almacena todas las salsas. Haz una lista de las salsas disponibles y da una respuesta con cada pedido si lo vendes.
\n**Extra** Las pizzas tienen ingredientes. Pregunta al cliente cuál\ @@ -3707,7 +3377,6 @@ adventures: {print} 'Serán ' precio ' dólares' {print} '¡Disfruta tu comida!' ``` - start_code: '# pon tu código aquí' 10: story_text: | En este nivel aprenderás cómo preguntar los pedidos fácilmente para los diferentes platos. @@ -3746,7 +3415,6 @@ adventures: {print} 'Así que quieres pedir para ' personas ' personas.' {print} "¡Vamos!" ``` - start_code: '# pon tu código aquí' 12: story_text: | A partir de este nivel puedes usar números decimales para hacer que tu menú sea más realista. @@ -3768,7 +3436,6 @@ adventures: precio = precio + 2.35 {print} 'Serán ' precio ' dólares, por favor' ``` - start_code: '# pon tu código aquí' 13: story_text: | En este nivel aprenderás nuevos comandos para ampliar tu código mucho más. @@ -3792,7 +3459,6 @@ adventures: {print} 'Esa es una opción saludable' {print} 'Eso será ' precio ' dólares' ``` - start_code: '# pon tú código aquí' 15: story_text: | Con el comando `{while}` puedes asegurarte que tus clientes sigan agregando ordenes hasta que gusten. @@ -3809,7 +3475,6 @@ adventures: más = {ask} '¿Te gustaría pedir algo más?' {print} '¡Gracias!' ``` - start_code: '# pon tu código' rock: name: Piedra, papel o tijera default_save_name: Piedra_2 @@ -3836,9 +3501,6 @@ adventures: {ask} escoge _ {echo} tu elección fue ``` - start_code: | - {print} ¡Bienvenido a tu propio piedra, papel o tijera! - {ask} ?Que escoges? 2: story_text: | En este nivel puedes practicar usando las variables, ¡así puedes hacer un juego de piedra, papel o tijeras en el próximo nivel! @@ -3850,7 +3512,6 @@ adventures: opción {is} piedra {print} Yo elijo _ ``` - start_code: '# pon tu código aquí' 3: story_text: | ¡Puedes usar el comando `{at} {random}` para dejar que el ordenador elija piedra, papel o tijeras! @@ -3876,7 +3537,6 @@ adventures: En este nivel podemos programar el juego de piedra, papel, tijera. Pero si quieres añadir texto, aquí también tienes que usar comillas. ### Ejercicio Copia el código del nivel anterior y haz que funcione usando comillas después de cada comando `{print}` o `{ask}`. - start_code: '{print} ''Bienvenido a tu propio piedra, papel o tijera!''' 5: story_text: | En este nivel podemos determinar si es un empate o no. Para ello necesitas el nuevo código `{if}`. @@ -3898,7 +3558,6 @@ adventures: ``` Rellena el código correcto en los huecos en blanco para ver si es un empate. - start_code: '{print} ''Bienvenido a tu propio piedra, papel o tijera!''' 9: story_text: "En este nivel puedes programar el juego completo de piedra, papel, tijeras anidando los comandos `{if}`. \n\n### Ejercicio\n¿Puedes completar el código? El programa debe decir quien ha ganado para cada combinación.\n \n**Extra** ¿Quieres jugar más de una partida? Amplia el\ \ código para que puedas jugar varias rondas. Incluso puedes usar un `{ask}` para preguntar al usuario cuantas rondas quieren jugar.\n" @@ -3918,7 +3577,6 @@ adventures: {print} '¡Perdiste!' # termina este código ``` - start_code: '# pon tu código aquí' 10: story_text: | ### Ejercicio @@ -3929,7 +3587,6 @@ adventures: jugadores = _ {for} _ ``` - start_code: '# pon tu código aquí' 13: story_text: | ¡Con el comando `{and}` puedes reducir tu código del juego de piedra, papel o tijera! Mira el ejemplo de abajo e intenta terminarlo. @@ -3951,7 +3608,6 @@ adventures: {print} '¡La computadora ganó!' _ ``` - start_code: '# pon tú código aquí' 15: story_text: | ### Ejercicio @@ -3974,7 +3630,6 @@ adventures: ganó = 'sí' _ ``` - start_code: '# pon tu código aquí' rock_2: name: Piedra, papel, tijeras 2 default_save_name: piedra_2 @@ -3991,7 +3646,6 @@ adventures: opción {is} _ {print} Yo elijo opción ``` - start_code: '# pon tu código aquí' secret: name: Super Espía default_save_name: Super Espía @@ -4021,7 +3675,6 @@ adventures: b = 'hoy a las 10.00' {print} _ _ _ ``` - start_code: '# pon tu código aquí' 13: story_text: | Podemos simplificar el código superespía con `{and}`, entonces sólo necesitamos un `{if}`. @@ -4040,7 +3693,6 @@ adventures: {else} {print} 'Ve a la estación de tren a las 10.00' ``` - start_code: '# pon tu código aquí' sleep_command: name: '{sleep}' default_save_name: comando_dormir @@ -4058,10 +3710,6 @@ adventures: {sleep} 2 {print} ¡verde! ``` - start_code: |- - {print} Mi color favorito es... - {sleep} 2 - {print} ¡verde! songs: name: ¡Canta una canción! default_save_name: Canción @@ -4118,7 +3766,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: story_text: | En un nivel anterior programamos la canción de los elefantes. Pero sin el comando `{repeat}` tuvimos que copiar los versos muchas veces. @@ -4136,7 +3783,6 @@ adventures: verso = verso - 1 {print} verso 'botellas de cerveza en la pared' ``` - start_code: '# pon tu código aquí' 10: story_text: | Con `{for}` puedes hacer la canción completa de baby shark (incluyendo a todos los tiburones de la familia) en solo 6 líneas! @@ -4153,7 +3799,6 @@ adventures: ``` monos = 5, 4, 3, 2, 1 ``` - start_code: '# pon tu código aquí' 11: story_text: | En este nivel, podrás usar el comando `{for}` con `{range}` para crear canciones que utilizan cuentas, como cinco pequeños monitos. @@ -4169,7 +3814,6 @@ adventures: {print} i ' pequeños monitos saltando en la cama' _ ``` - start_code: '# pon tu código aquí' 12: story_text: | En esta canción podemos hacer aún más fácil programar 'si eres feliz y lo sabes, aplaude'. Porque podemos poner todas las acciones en una variable, compruébalo: @@ -4188,7 +3832,6 @@ adventures: _ {print} 'si estás feliz y lo sabes' _ {print} acción ``` - start_code: '# pon tu código aquí' 13: 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? @@ -4205,16 +3848,6 @@ adventures: {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: | En este nivel puedes programar una canción como la del Viejo McDonald incluso más rápido. Puedes conectar el animal con el sonido correcto simplemente poniéndolos en el mismo lugar en la lista. @@ -4247,7 +3880,6 @@ adventures: {print} 'Ella se levanta de un camino de heno' {print} 'pronto por la mañana' ``` - start_code: '# pon tu código aquí' 18: story_text: | En el nivel 16 hicimos canciones usando listas. Sin embargo estos programas no funcionan bien en este nivel. Los dos puntos del nivel 17 y los paréntesis del nivel 18 aún se tienen que ser añadir. @@ -4260,7 +3892,6 @@ adventures: Ahora también busca tu canción de Old MacDonald del nivel 16, y corrígela. example_code: "```\nlíneas = ['Qué haremos con el marinero borracho', 'Afeitarle el vientre con una navaja oxidada', 'Meterlo en un barco largo hasta que esté sobrio']\n{for} línea {in} líneas _ \n {for} i {in} {range} 1 {to} 3 _ \n {print} _ línea _ \n {print} 'pronto por\ \ la mañana'\n {for} i {in} {range} 1 {to} 3\n {print} 'Ella se levanta de un camino de heno'\n {print} 'pronto por la mañana'\n```\n" - start_code: '# pon tu código aquí' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4282,15 +3913,6 @@ adventures: {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: Tres en raya default_save_name: Tres en raya @@ -4326,7 +3948,6 @@ adventures: {else} player = 'x' ``` - start_code: '# pon tu código aquí' 14: story_text: | En los niveles anteriores has hecho un juego de tres en raya. Ahora hemos aprendido como usar los símbolos =, == y !=. @@ -4389,7 +4010,6 @@ adventures: {else} símbolo = 'x' ``` - start_code: '# pon tu código aquí' 15: story_text: | En este nivel puedes mejorar tu juego de tres en raya con el bucle {while}. Con este bucle puedes combinar el juego `{if} game != 'over'` y el `{for} i {in} {range} 1 {to} 9` en una sola línea. @@ -4451,7 +4071,6 @@ adventures: {else} símbolo = 'x' ``` - start_code: '# pon tu código aquí' 17: story_text: | En los niveles anteriores el juego Tres en raya tenía un comportamiento algo molesto. Después de cada movimiento, tenías que decidir tú mismo si habías ganado o no. @@ -4538,7 +4157,6 @@ adventures: {else}: símbolo = 'x' ``` - start_code: '# pon tu código aquí' turtle: name: La tortuga default_save_name: Tortuga @@ -4562,9 +4180,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | En este nivel puedes utilizar variables para hacer tu tortuga interactiva. Por ejemplo, puedes preguntar al jugador cuantos pasos dará la tortuga. @@ -4590,11 +4205,6 @@ adventures: {turn} ángulo {forward} 25 ``` - start_code: |- - {print} ¡Carrera de tortugas! - ángulo {is} 90 - {turn} ángulo - {forward} 25 3: story_text: | En este nivel, puedes utilizar `{at} {random}` con la tortuga que dibuja. Una elección aleatoria hace que la tortuga camine por un camino diferente cada vez. @@ -4607,10 +4217,6 @@ adventures: {turn} ángulos {at} {random} {forward} 25 ``` - start_code: |- - angulo {is} 10, 50, 90, 150, 250 - {turn} angulo {at} {random} - {forward} 25 4: story_text: | En nivel 3 tienes que usar comillas con `{print}` y `{ask}`. ¡También al dibujar! @@ -4637,11 +4243,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Dibujando figuras' - ángulo {is} 90 - {turn} ángulo - {forward} 25 5: story_text: | En nivel 5 puede elegir con `{if}`. Por ejemplo, entre diferentes tipos de figuras. @@ -4674,8 +4275,7 @@ adventures: {if} dirección {is} izquierda {turn} _ {forward} 100 ``` - start_code: |- - {print} 'Dibujando figuras' + figura {is} {ask} '¿Quieres un cuadrado o un triángulo?' {if} figura {is} triángulo ángulo {is} 120 {else} ángulo {is} 90 {turn} ángulo @@ -4703,7 +4303,6 @@ adventures: {forward} 50 {turn} ángulo ``` - start_code: '{print} ''Dibujando figuras''' 8: story_text: | Ahora que podemos repetir varias líneas, podemos hacer figuras mas fácil. @@ -4746,7 +4345,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# pon tu código aquí' 10: story_text: | En este nivel puedes hacer que la tortuga dibuje una figura. @@ -4763,7 +4361,6 @@ adventures: distancias = 10, 20, 30, 40, 50, 60 {for} distancia {in} distancias {forward} distancia - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4788,16 +4385,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4813,7 +4400,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4824,7 +4410,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4835,7 +4420,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4853,7 +4437,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4872,7 +4455,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4892,7 +4474,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4903,7 +4484,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4916,7 +4496,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4947,7 +4526,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4988,7 +4566,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5011,7 +4588,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5040,7 +4616,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5064,7 +4639,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5092,7 +4666,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5126,7 +4699,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: comando_mientras @@ -5146,9 +4718,7 @@ adventures: respuesta = {ask} '¿Cuánto es 5 veces 5?' {print} 'La respuesta es correcta' ``` - start_code: |- - respuesta = 0 - {while} respuesta != 25 + respuesta = {ask} '¿Cuánto es 5 veces 5?' {print} 'La respuesta es correcta' years: @@ -5168,4 +4738,3 @@ adventures: {print} numero {print} 'Feliz año nuevo! ``` - start_code: '# ponga su código aquí' diff --git a/content/adventures/et.yaml b/content/adventures/et.yaml index 089f3aac2f3..72709b6b868 100644 --- a/content/adventures/et.yaml +++ b/content/adventures/et.yaml @@ -27,7 +27,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -53,7 +52,6 @@ adventures: 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: @@ -82,7 +80,6 @@ adventures: 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? @@ -97,7 +94,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -120,7 +116,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -131,7 +126,6 @@ adventures: {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! @@ -149,7 +143,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -168,7 +161,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -185,7 +177,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -193,7 +184,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -223,7 +213,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -246,7 +235,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -267,7 +255,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -307,13 +294,6 @@ adventures: _ {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 @@ -331,11 +311,6 @@ adventures: {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 @@ -368,10 +343,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -399,11 +370,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -515,7 +481,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -554,7 +519,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -573,7 +537,6 @@ adventures: 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! @@ -590,7 +553,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -606,7 +568,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -617,7 +578,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -634,7 +594,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -659,11 +618,7 @@ adventures: 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 @@ -695,7 +650,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -744,17 +698,6 @@ adventures: 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 @@ -777,12 +720,6 @@ adventures: {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. @@ -802,14 +739,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -831,16 +760,6 @@ adventures: 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 @@ -855,13 +774,6 @@ adventures: {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 @@ -884,17 +796,7 @@ adventures: {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' @@ -921,19 +823,7 @@ adventures: 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: @@ -949,11 +839,6 @@ adventures: 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 @@ -978,10 +863,7 @@ adventures: {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} @@ -1018,19 +900,7 @@ adventures: 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: @@ -1045,11 +915,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1089,26 +954,6 @@ adventures: 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 @@ -1137,27 +982,6 @@ adventures: 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 @@ -1190,31 +1014,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1244,9 +1043,7 @@ adventures: 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?' @@ -1303,36 +1100,6 @@ adventures: 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 @@ -1482,7 +1249,6 @@ adventures: Käivita kood kasutades rohelist 'Käivita kood' nuppu programmeerimisvälja all. `{print}` käsk kuvab teksti ekraanile. - start_code: '{print} tere maailm!' 2: story_text: | Teisel tasemel õpime kahte uut käsku: `{is}` ja `{sleep}`. @@ -1497,11 +1263,9 @@ adventures: ``` story_text_2: | `{print}` töötab ikka samat moodi, aga `{ask}` käsk on muutunud. Sa pead `{ask}` käsus ka muutujat kasutama. See näeb niimoodi välja: - start_code: '{print} tere maailm!' 3: story_text: | Kolmandal tasemel saad sa listi koostada. Sa saad lasta arvutil juhusliku elemendi listist välja valida. Seda saad sa teha kasutades `{at} {random}`. - start_code: '{print} tere maailm!' 4: story_text: | Neljandal tasemel muutuvad käsud `{ask}` ja `{print}`. @@ -1517,7 +1281,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Tere maailm''' 5: story_text: | 5. tasemel leiame midagi uut: `{if}`! `{if}` abil saad valida kahe vóimaluse vahel. @@ -1528,9 +1291,6 @@ adventures: nimi {is} {ask} 'Mis su nimi on?' {if} nimi {is} Hedy {print} 'lahe' {else} {print} 'buu!' ``` - start_code: |- - nimi {is} {ask} 'Mis su nimi on?' - {if} nimi {is} Hedy {print} 'lahe!' {else} {print} 'mhh' 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. @@ -1553,7 +1313,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}` and `{repeat}` have changed! @@ -1577,10 +1336,6 @@ adventures: {print} 'SISSETUNGIJA!' {print} 'Sa ei saa seda arvutit kasutada!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1595,13 +1350,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1612,17 +1360,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1632,8 +1373,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1645,11 +1385,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1664,8 +1399,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1684,11 +1418,6 @@ adventures: 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' 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. @@ -1718,9 +1447,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dice @@ -1748,12 +1476,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1767,7 +1493,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1785,7 +1510,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1797,7 +1521,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1809,7 +1532,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1834,7 +1556,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1852,7 +1573,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1868,7 +1588,6 @@ adventures: {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. @@ -1881,7 +1600,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1914,7 +1632,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1923,7 +1640,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1934,7 +1650,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1982,10 +1697,6 @@ adventures: {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: |- 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. @@ -1997,10 +1708,6 @@ adventures: {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: 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. @@ -2040,7 +1747,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2059,7 +1765,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2080,7 +1785,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2093,7 +1797,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2124,7 +1827,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2136,7 +1838,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2153,7 +1854,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2169,7 +1869,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2181,7 +1880,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2221,21 +1919,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2264,13 +1947,6 @@ adventures: {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. @@ -2294,17 +1970,6 @@ adventures: 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 @@ -2333,7 +1998,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2355,7 +2019,6 @@ adventures: _ {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 @@ -2385,7 +2048,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2432,7 +2094,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2448,7 +2109,6 @@ adventures: {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. @@ -2467,7 +2127,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2496,7 +2155,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2522,7 +2180,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2551,7 +2208,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2585,7 +2241,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2616,18 +2271,7 @@ adventures: {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?' @@ -2666,10 +2310,6 @@ adventures: _ _ _ 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... @@ -2686,11 +2326,6 @@ adventures: {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. @@ -2706,16 +2341,6 @@ adventures: {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 @@ -2744,11 +2369,6 @@ adventures: _ 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 @@ -2774,10 +2394,6 @@ adventures: 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: @@ -2786,8 +2402,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2819,8 +2434,7 @@ adventures: {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} @@ -2843,7 +2457,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2864,7 +2477,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2904,8 +2516,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2931,7 +2542,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2939,7 +2549,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2952,7 +2561,6 @@ adventures: {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}`. @@ -2966,7 +2574,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Premeeri oma papagoid, {if} ta ütleb õige sõna! @@ -2982,7 +2589,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3002,7 +2608,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3026,7 +2631,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3055,7 +2659,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3068,7 +2671,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3088,7 +2690,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3114,8 +2715,6 @@ adventures: ``` _ 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. @@ -3132,8 +2731,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3165,7 +2763,6 @@ adventures: {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 @@ -3195,10 +2792,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3233,10 +2826,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3270,9 +2859,6 @@ adventures: 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. @@ -3321,11 +2907,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3339,10 +2920,6 @@ adventures: {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! @@ -3357,13 +2934,6 @@ adventures: {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 @@ -3389,10 +2959,6 @@ adventures: 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? @@ -3410,11 +2976,6 @@ adventures: _ {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 @@ -3434,7 +2995,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3454,7 +3014,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3486,7 +3045,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3506,7 +3064,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3527,7 +3084,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3546,7 +3102,6 @@ adventures: {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. @@ -3558,7 +3113,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3576,7 +3130,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3604,7 +3157,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3646,7 +3198,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3665,7 +3216,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3680,7 +3230,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3697,7 +3246,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3724,7 +3272,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3733,7 +3280,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3755,12 +3301,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3780,7 +3324,6 @@ 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. Can you finish the code? @@ -3800,7 +3343,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3811,7 +3353,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3829,7 +3370,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3851,7 +3391,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3868,7 +3407,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3892,7 +3430,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3905,7 +3442,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3921,10 +3457,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3958,7 +3490,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3976,7 +3507,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3990,7 +3520,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4042,7 +3571,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4057,7 +3585,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4072,7 +3599,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4089,16 +3615,6 @@ adventures: {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. @@ -4134,7 +3650,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4156,7 +3671,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4178,15 +3692,6 @@ adventures: {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 @@ -4254,7 +3759,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4317,7 +3821,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4379,7 +3882,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4466,7 +3968,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4488,9 +3989,6 @@ adventures: {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. @@ -4514,11 +4012,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4529,10 +4022,6 @@ adventures: {turn} nurgad {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! @@ -4559,11 +4048,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4596,12 +4080,6 @@ adventures: 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. @@ -4625,7 +4103,6 @@ adventures: {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. @@ -4668,7 +4145,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4686,7 +4162,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4711,16 +4186,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4736,7 +4201,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4747,7 +4211,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4758,7 +4221,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4776,7 +4238,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4795,7 +4256,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4815,7 +4275,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4826,7 +4285,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4839,7 +4297,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4870,7 +4327,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4911,7 +4367,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4934,7 +4389,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4963,7 +4417,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4987,7 +4440,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5015,7 +4467,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5049,7 +4500,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5069,11 +4519,6 @@ adventures: 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 @@ -5091,4 +4536,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/fa.yaml b/content/adventures/fa.yaml index ffe3fe05c33..23a2a4393c8 100644 --- a/content/adventures/fa.yaml +++ b/content/adventures/fa.yaml @@ -22,7 +22,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -48,7 +47,6 @@ adventures: 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: @@ -77,7 +75,6 @@ adventures: 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? @@ -92,7 +89,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -115,7 +111,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -126,7 +121,6 @@ adventures: {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! @@ -144,7 +138,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -163,7 +156,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -180,7 +172,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +515,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -569,7 +533,6 @@ adventures: 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! @@ -586,7 +549,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -602,7 +564,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -613,7 +574,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -630,7 +590,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -655,11 +614,7 @@ adventures: 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 @@ -691,7 +646,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -740,17 +694,6 @@ adventures: 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 @@ -773,12 +716,6 @@ adventures: {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. @@ -798,14 +735,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -827,16 +756,6 @@ adventures: 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 @@ -851,13 +770,6 @@ adventures: {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 @@ -880,17 +792,7 @@ adventures: {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' @@ -917,19 +819,7 @@ adventures: 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: @@ -945,11 +835,6 @@ adventures: 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 @@ -974,10 +859,7 @@ adventures: {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} @@ -1014,19 +896,7 @@ adventures: 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: @@ -1041,11 +911,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1085,26 +950,6 @@ adventures: 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 @@ -1133,27 +978,6 @@ adventures: 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 @@ -1186,31 +1010,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1240,9 +1039,7 @@ adventures: 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?' @@ -1299,36 +1096,6 @@ adventures: 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 @@ -1478,7 +1245,6 @@ adventures: خودت، کدت رو با فشردن دکمه «اجرای کد»، زیر بخش «برنامه‌نویسی» اجرا کن. می‌تونی با دستور `{print}` یک متن رو روی صفحه چاپ کنی. - start_code: '{print} دنیا سلام!' 2: story_text: | در مرحله دوم ما دو تا دستور جدید یاد می‌گیریم: `{is}` و `{sleep}`. @@ -1493,11 +1259,9 @@ adventures: ``` story_text_2: | دستور `{print}` همچنان مثل قبل کار می‌کنه، اما دستور `{ask}` تغییر کرده. تو نیاز داری توی دستور `{ask}` از یک متغیر استفاده کنی. مثل این: - start_code: '{print} سلام دنیا!' 3: story_text: | در سطح 3 شما میتوانید یک لیست بسازید. . می توانید اجازه بدهید که کامپیوتر برای شما یک لیست بسازد شما این کا را با`{at} {random}`انجام می دهید. - start_code: '{print}سلام دنیا!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1513,7 +1277,6 @@ adventures: answer is ask 'What do we need to use from now on?' print 'We need to use ' answer ``` - start_code: '{print} ''سلام دنیا''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1524,9 +1287,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - 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. @@ -1549,7 +1309,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` {and} `{print}` still work as you know them. But `{if}` {and} `{repeat}` have changed! @@ -1561,10 +1320,6 @@ adventures: {print} 'Hello everyone' {print} 'This is all repeated 5 times' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1579,13 +1334,6 @@ adventures: 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' 10: story_text: | In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1596,17 +1344,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: | **Decimal numbers** @@ -1616,8 +1357,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 13: story_text: | @@ -1629,11 +1369,6 @@ adventures: 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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1648,8 +1383,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' else @@ -1668,11 +1402,6 @@ adventures: 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' 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. @@ -1713,8 +1442,7 @@ adventures: naam = 'Hedy' {print}('my name is ', naam) ``` - start_code: |- - naam = 'Hedy' + {print}('My name is ', naam) dice: name: Dice @@ -1742,12 +1470,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1761,7 +1487,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1779,7 +1504,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1791,7 +1515,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1803,7 +1526,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1828,7 +1550,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1846,7 +1567,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1862,7 +1582,6 @@ adventures: {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. @@ -1875,7 +1594,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1908,7 +1626,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1917,7 +1634,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1928,7 +1644,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1976,10 +1691,6 @@ adventures: {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: |- 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. @@ -1991,10 +1702,6 @@ adventures: {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: 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. @@ -2034,7 +1741,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2053,7 +1759,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2074,7 +1779,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2087,7 +1791,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2118,7 +1821,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2130,7 +1832,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2147,7 +1848,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2163,7 +1863,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2175,7 +1874,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2215,21 +1913,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2258,13 +1941,6 @@ adventures: {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. @@ -2288,17 +1964,6 @@ adventures: 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 @@ -2327,7 +1992,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2349,7 +2013,6 @@ adventures: _ {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 @@ -2379,7 +2042,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2426,7 +2088,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2442,7 +2103,6 @@ adventures: {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. @@ -2461,7 +2121,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2490,7 +2149,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2516,7 +2174,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2545,7 +2202,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2579,7 +2235,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2610,18 +2265,7 @@ adventures: {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?' @@ -2660,10 +2304,6 @@ adventures: _ _ _ 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... @@ -2680,11 +2320,6 @@ adventures: {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. @@ -2700,16 +2335,6 @@ adventures: {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 @@ -2738,11 +2363,6 @@ adventures: _ 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 @@ -2768,10 +2388,6 @@ adventures: 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: @@ -2780,8 +2396,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2813,8 +2428,7 @@ adventures: {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} @@ -2837,7 +2451,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2858,7 +2471,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2898,8 +2510,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2925,7 +2536,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2942,7 +2552,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2955,7 +2564,6 @@ adventures: {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}`. @@ -2969,7 +2577,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -2985,7 +2592,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3005,7 +2611,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3029,7 +2634,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3058,7 +2662,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3071,7 +2674,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3091,7 +2693,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3117,8 +2718,6 @@ adventures: ``` _ 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. @@ -3135,8 +2734,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3168,7 +2766,6 @@ adventures: {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 @@ -3198,10 +2795,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3236,10 +2829,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3273,9 +2862,6 @@ adventures: 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. @@ -3324,11 +2910,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3342,10 +2923,6 @@ adventures: {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! @@ -3360,13 +2937,6 @@ adventures: {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 @@ -3392,10 +2962,6 @@ adventures: 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? @@ -3413,11 +2979,6 @@ adventures: _ {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 @@ -3437,7 +2998,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3457,7 +3017,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3489,7 +3048,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3509,7 +3067,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3530,7 +3087,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3549,7 +3105,6 @@ adventures: {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. @@ -3561,7 +3116,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3579,7 +3133,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3607,7 +3160,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3649,7 +3201,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3668,7 +3219,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3683,7 +3233,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3700,7 +3249,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3727,7 +3275,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3736,7 +3283,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3758,12 +3304,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3783,7 +3327,6 @@ 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. Can you finish the code? @@ -3802,7 +3345,6 @@ adventures: {if} your_choice {is} scissors {print} 'You lose!' ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3813,7 +3355,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3831,7 +3372,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3853,7 +3393,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3870,7 +3409,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3894,7 +3432,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3907,7 +3444,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3923,10 +3459,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3960,7 +3492,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3978,7 +3509,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3992,7 +3522,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4044,7 +3573,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4059,7 +3587,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4074,7 +3601,6 @@ adventures: {print} '{if} youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4091,16 +3617,6 @@ adventures: {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. @@ -4136,7 +3652,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4158,7 +3673,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4180,15 +3694,6 @@ adventures: {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 @@ -4257,7 +3762,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4320,7 +3824,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4382,7 +3885,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4469,7 +3971,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: turtle @@ -4490,9 +3991,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | In level 1 the turtle could only turn left or right. That is a bit boring! @@ -4520,11 +4018,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: | - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4535,10 +4028,6 @@ adventures: {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! @@ -4565,11 +4054,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: | - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4602,12 +4086,6 @@ adventures: 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. @@ -4631,8 +4109,6 @@ adventures: {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. @@ -4655,8 +4131,6 @@ adventures: {turn} _ {forward} _ ``` - start_code: | - hoeken = {ask} 'How many angles should I draw?' 9: story_text: | Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures. @@ -4676,7 +4150,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4694,7 +4167,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4719,16 +4191,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4744,7 +4206,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4755,7 +4216,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4766,7 +4226,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4784,7 +4243,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4803,7 +4261,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4823,7 +4280,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4834,7 +4290,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4847,7 +4302,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4878,7 +4332,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4919,7 +4372,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4942,7 +4394,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4971,7 +4422,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4995,7 +4445,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5023,7 +4472,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5057,7 +4505,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5077,11 +4524,6 @@ adventures: 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 @@ -5099,4 +4541,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/fi.yaml b/content/adventures/fi.yaml index cd7e59c1b3b..aef1c310602 100644 --- a/content/adventures/fi.yaml +++ b/content/adventures/fi.yaml @@ -27,7 +27,6 @@ adventures: Käytä ainakin yden kerran `{ask}` ja `{echo}` komentoja. Tarinan aiheena voi olla mitä vain. Jos et keksi tarinalle aihetta, käytä vaikka jotain näistä: menossa elokuviin, urheiluottelu, tai päivä eläintarhassa. - start_code: '{print} Tarinasi alkaa tästä' 2: story_text: | Tasolla 2 voit tehdä tarinastasi vieläkin hauskemman. Päähahmosi nimi voi nyt olla missä tahansa kohtaa lausetta. @@ -54,7 +53,6 @@ adventures: Muuta `{ask}` komennot ja `{echo}` komennot koodissasi oikeaan muotoon, jonka olet oppinut tällä tasolla. **Lisätehtävä** Lisää `{sleep}` komento koodiin lisätäksesi jännitystä tarinaasi. - start_code: '{print} Sinun tarinasi' 3: story_text: | Tasolla 3 voit tehdä tarinastasi vieläkin hauskemman. Voit käyttää satunnaisuutta mille tahansa hirviölle, eläimelle tai muulle esteelle, tällä tavalla: @@ -88,7 +86,6 @@ adventures: poista {is} {ask} Mikä esine hänen kannattaisi poistaa? {remove} poista {from} laukku ``` - start_code: '{print} Sinun tarinasi' 4: story_text: | Saatoit muokata, että aiemmissa tasoissa on edelleen ongelma. Yrititkö tulostaa lauseen, joka sisälsi sanan nimi? Eli `{print}` minun nimi on nimi. @@ -113,7 +110,6 @@ adventures: {print} _ Hän kuulee _ eläimet {at} {random} _ äänen _ {print} nimi _ pelkää, että metsässä kummittelee _ ``` - start_code: '{print} ''Tarinasi tulostetaan tänne!''' 5: story_text: | Tällä tasolla voit ohjelmoita erilaisia loppuja, jotka tekevät tarinastasi vieläkin hauskemman. @@ -139,7 +135,6 @@ adventures: {if} loppu {is} hyvä {print} nimi 'tarttuu miekkaan ja hirviö juoksee vikkelään pois' {else} {print} nimi 'joutuu hirviön syömäksi' ``` - start_code: '{print} ''Tästä tarinasi alkaa!''' 7: story_text: | Tarinassa joku sanoo sanan monta kertaa. Esimerkiksi, kun joku huutaa apua tai laulaa laulun. @@ -153,7 +148,6 @@ adventures: {repeat} 5 {times} {print} 'Apua!' {print} 'Miksei kukaan auta minua?' ``` - start_code: '{repeat} 5 {times} {print} ''Apua!''' 8: story_text: | Tällä tasolla voit käyttää useita rivejä `{if}` komennoissasi, tällä tavoin voit päivittää hyvän tai huonon loppusi! @@ -177,7 +171,6 @@ adventures: {print} 'Voi ei! Riku on liian hidas...' {print} _ ``` - start_code: '# kirjoita koodisi tähän' 9: story_text: | Tällä tasolla voit käyttää `{if}` ja `{repeat}` komentoja muiden `{if}` ja `{repeat}` komentojen sisällä. @@ -206,7 +199,6 @@ adventures: {else} {print} 'Roosa lähtee kotiin' ``` - start_code: '# kirjoita koodisi tähän' 10: story_text: | Tällä tasolla voit käyttää `{for}` komentoa tarinassasi. Tällä tavalla pystyt helposti ohjelmoimaan lasten kirjan 'Brown bear, Brown bear, what do you see'. @@ -215,7 +207,6 @@ adventures: Vilkaise tarinaa jos et tunne sitä, ja varmista, että tulostat sen kuten se on kirjassa. example_code: "```\neläimet = _ , _ , _ \n{print} 'Brown bear, Brown bear'\n{print} 'What do you see?'\n```\n" - start_code: '# kirjoita koodisi tähän' 12: story_text: |- Tällä tasolla lainausmerkkejä tarvitaan tallentamaan useita sanoja muuttujaan. @@ -228,7 +219,6 @@ adventures: nimi = 'Englannin kuningatar' {print} nimi ' söi palan kakkua, kun yhtäkkiä...' ``` - start_code: '# kirjoita koodisi tähän' 13: story_text: | Käyttämällä `{and}` ja `{or}` komentoja voit tehdä tarinoistasi monipuolisempia. Voit kysyä kaksi kysymystä ja reagoida vastausyhdistelmään. @@ -247,7 +237,6 @@ adventures: {if} polku {is} 'vasen' {and} ase {is} 'miekka' _ ``` - start_code: '# kirjoita koodisi tähän' 15: story_text: | Jos käytät `{while}` looppia voit tehdä tarinoistasi mielenkiintoisempia. Esimerkiksi, voit käyttää `{while} game == 'on'` jolloin voit pelata kunnes peli päättyy. @@ -269,7 +258,6 @@ adventures: {print} sijainti ' - Ne eivät olleet siellä.' {print} 'Nyt voit mennä taloon!' ``` - start_code: '# kirjoita koodisi tähän' 18: story_text: | Nyt tulostamme uuden tarinan, mutta tällä kertaa meidän täytyy käyttää sulkeita `{print}` komennon kanssa. @@ -290,7 +278,6 @@ adventures: nimi = {input}("Mikä on nimesi?") {print}('Tervetuloa tähän tarinaan!') ``` - start_code: '# kirjoita koodisi tähän' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -330,13 +317,6 @@ adventures: _ {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 @@ -354,11 +334,6 @@ adventures: {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 @@ -391,10 +366,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -422,11 +393,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -538,7 +504,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -575,7 +540,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. @@ -596,7 +560,6 @@ adventures: 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! @@ -614,7 +577,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -630,7 +592,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -641,7 +602,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -658,7 +618,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -683,11 +642,7 @@ adventures: 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 @@ -719,7 +674,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -768,17 +722,6 @@ adventures: 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 @@ -801,12 +744,6 @@ adventures: {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. @@ -826,14 +763,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -855,16 +784,6 @@ adventures: 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 @@ -879,13 +798,6 @@ adventures: {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 @@ -908,17 +820,7 @@ adventures: {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' @@ -945,19 +847,7 @@ adventures: 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: @@ -973,11 +863,6 @@ adventures: 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 @@ -1002,10 +887,7 @@ adventures: {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} @@ -1042,19 +924,7 @@ adventures: 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: @@ -1069,11 +939,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1113,26 +978,6 @@ adventures: 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 @@ -1161,27 +1006,6 @@ adventures: 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 @@ -1214,31 +1038,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1268,9 +1067,7 @@ adventures: 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?' @@ -1327,36 +1124,6 @@ adventures: 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 @@ -1502,7 +1269,6 @@ adventures: 1: story_text: "Tasolla 1 voit käyttää komentoja `{print}`, `{ask}` ja `{echo}`.\n Kirjoita koodisi ohjelmointikenttään. Voit myös painaa vihreää painiketta esimerkkikoodilohkossa, niin koodi kirjoitetaan puolestasi!\nKokeile koodia itse ohjelmointikentän alla olevalla vihreällä \"Suorita\ \ koodi\" -painikkeella.\n \nVoit tulostaa tekstiä näytölle komennolla `{print}`. \n" - start_code: '{print} Hei maailma!' 2: story_text: | Tasolla 2 opimme kaksi uutta komentoa: `{is}` ja `{sleep}`. @@ -1517,11 +1283,9 @@ adventures: ``` story_text_2: | `{print}` toimii edelleen samalla tavalla, mutta `{ask}` -komento on muuttunut. Sinun on käytettävä muuttujaa myös komennossa `{ask}`. Se näyttää tältä: - start_code: '{print} Hei maailma!' 3: story_text: | Tasolla 3 voit tehdä listan. Voit antaa tietokoneen valita satunnaisen asian listalta. Voit tehdä sen komennolla `{at} {random}`. - start_code: '{print} Hei maailma!' 4: story_text: | Tasolla 4 `{ask}` ja `{print}` ovat muuttuneet. @@ -1537,7 +1301,6 @@ adventures: vastaus {is} {ask} 'Mitä meidän on käytettävä tästä lähtien?' {print} "Meidän on käytettävä " vastaus ``` - start_code: '{print} ''Hei maailma!''' 5: story_text: | Tasolla 5 on jotain uutta, komento `{if}`! Komennon `{if}` avulla voit valita kahden eri vaihtoehdon välillä. @@ -1548,9 +1311,6 @@ adventures: name {is} {ask} 'mikä on nimesi?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - start_code: |- - nimi {is} {ask} 'Mikä on nimesi?' - {if} nimi {is} Hedy {print} 'hienoa!' {else} {print} 'plääh' 6: story_text: | Tällä tasolla opit jotain uutta: voit nyt myös suorittaa laskutoimituksia. @@ -1573,7 +1333,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy on hauskaa!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy on hauskaa!''' 8: story_text: | `{ask}` ja `{print}` toimivat edelleen sellaisina kuin ne tunnet. Mutta `{if}`, `{else}` ja `{repeat}` ovat muuttuneet! @@ -1597,10 +1356,6 @@ adventures: {print} "TUNKEILIJA!" {print} "Et voi käyttää tätä tietokonetta!" ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hei ihmiset' - {print} 'Tämä tulostetaan 5 kertaa' 9: story_text: | Tällä tasolla voit edelleen käyttää useita rivejä `{if}` ja `{repeat}` komentojen kanssa, mutta voit myös liittää ne yhteen! @@ -1615,13 +1370,6 @@ adventures: {else} {print} 'pitsa on parempi' ``` - start_code: |- - {repeat} 3 {times} - ruoka = {ask} 'Mitä ruokaa haluat?' - {if} ruoka {is} pizzaa - {print} 'kiva!' - {else} - {print} 'pizza on parempaa' 10: story_text: |- Tällä tasolla opimme uuden koodin kohteelle `{for}`. Koodilla `{for}` voit tehdä luettelon ja käyttää kaikkia elementtejä. @@ -1632,17 +1380,10 @@ adventures: {for} elukka {in} elukat {print} 'Rakastan ' elukka ``` - start_code: |- - animals {is} dog, cat, blobfish - {for} animal {in} animals - {print} 'Rakastan ' 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. 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: |- - {for} laskin {in} {range} 1 {to} 5 - {print} laskin 12: story_text: |- **Desimaaliluvut** @@ -1652,8 +1393,7 @@ adventures: {print} 'Kaksi ja puoli plus kaksi ja puoli on...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'desimaalinumeroissa on nyt käytettävä pistettä' + {print} 2.5 + 2.5 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 @@ -1665,11 +1405,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1684,8 +1419,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1704,11 +1438,6 @@ adventures: 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' 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. @@ -1738,9 +1467,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1768,12 +1496,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1787,7 +1513,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1807,7 +1532,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1819,7 +1543,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1832,7 +1555,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1857,7 +1579,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1875,7 +1596,6 @@ adventures: ``` story_text_2: | 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: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1891,7 +1611,6 @@ adventures: {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. @@ -1899,7 +1618,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1932,7 +1650,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1941,7 +1658,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1952,7 +1668,6 @@ adventures: _ day _ days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -2000,10 +1715,6 @@ adventures: {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: |- Tällä tasolla lisäämme uuden muodon kohteelle `{for}`. Aikaisemmilla tasoilla käytimme `{for} luetteloiden kanssa, mutta voimme käyttää `{for}` myös numeroiden kanssa. @@ -2016,10 +1727,6 @@ adventures: {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: 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. @@ -2059,7 +1766,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2077,7 +1783,6 @@ adventures: 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. @@ -2102,7 +1807,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2115,7 +1819,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2150,7 +1853,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2162,7 +1864,6 @@ adventures: options = they love you, they love you not _ _ _ _ options {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2182,7 +1883,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2198,7 +1898,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2210,7 +1909,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2250,21 +1948,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2293,13 +1976,6 @@ adventures: {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. @@ -2323,17 +1999,6 @@ adventures: 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 @@ -2362,7 +2027,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2384,7 +2048,6 @@ adventures: _ {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 @@ -2414,7 +2077,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2461,7 +2123,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2477,7 +2138,6 @@ adventures: {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. @@ -2499,7 +2159,6 @@ adventures: _ _ _ _ {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! @@ -2528,7 +2187,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2557,7 +2215,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2586,7 +2243,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2620,7 +2276,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2651,18 +2306,7 @@ adventures: {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?' @@ -2701,10 +2345,6 @@ adventures: _ _ _ 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... @@ -2721,11 +2361,6 @@ adventures: {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. @@ -2741,16 +2376,6 @@ adventures: {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 @@ -2779,11 +2404,6 @@ adventures: _ 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 @@ -2809,10 +2429,6 @@ adventures: 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: @@ -2821,8 +2437,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2854,8 +2469,7 @@ adventures: {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} @@ -2881,7 +2495,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2902,7 +2515,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2942,8 +2554,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2969,7 +2580,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2986,7 +2596,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3001,7 +2610,6 @@ adventures: {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}`. @@ -3015,7 +2623,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3032,7 +2639,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3053,7 +2659,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3077,7 +2682,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3106,7 +2710,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3119,7 +2722,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3139,7 +2741,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3165,8 +2766,6 @@ adventures: ``` _ 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. @@ -3183,8 +2782,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3216,7 +2814,6 @@ adventures: {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 @@ -3246,10 +2843,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3284,10 +2877,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3321,9 +2910,6 @@ adventures: 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. @@ -3372,11 +2958,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3390,10 +2971,6 @@ adventures: {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! @@ -3408,13 +2985,6 @@ adventures: {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 @@ -3440,10 +3010,6 @@ adventures: 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? @@ -3461,11 +3027,6 @@ adventures: _ {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 @@ -3485,7 +3046,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3502,7 +3062,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3536,7 +3095,6 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - 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. @@ -3556,7 +3114,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3577,7 +3134,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3596,7 +3152,6 @@ adventures: {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. @@ -3611,7 +3166,6 @@ adventures: {repeat} _ {times} food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3629,7 +3183,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3662,7 +3215,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3710,7 +3262,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3732,7 +3283,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3747,7 +3297,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3764,7 +3313,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3791,7 +3339,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3800,7 +3347,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3822,12 +3368,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3847,7 +3391,6 @@ 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. Can you finish the code? @@ -3867,7 +3410,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3879,7 +3421,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3898,7 +3439,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3921,7 +3461,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3938,7 +3477,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3965,7 +3503,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3978,7 +3515,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3994,10 +3530,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4035,7 +3567,6 @@ adventures: 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: @@ -4053,7 +3584,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In this level you can repeat the song 99 times, just by adding one simple line! @@ -4068,7 +3598,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4129,7 +3658,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting, like the 5 little monkeys. @@ -4147,7 +3675,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4166,7 +3693,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4183,16 +3709,6 @@ adventures: {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. @@ -4228,7 +3744,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4250,7 +3765,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4272,15 +3786,6 @@ adventures: {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 @@ -4348,7 +3853,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4411,7 +3915,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4473,7 +3976,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4560,7 +4062,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4584,9 +4085,6 @@ adventures: {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. @@ -4612,11 +4110,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4629,10 +4122,6 @@ adventures: {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! @@ -4659,11 +4148,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4696,12 +4180,6 @@ adventures: 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. @@ -4725,7 +4203,6 @@ adventures: {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. @@ -4768,7 +4245,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4786,7 +4262,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4811,16 +4286,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4836,7 +4301,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4847,7 +4311,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4858,7 +4321,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4876,7 +4338,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4895,7 +4356,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4915,7 +4375,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4926,7 +4385,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4939,7 +4397,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4970,7 +4427,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5011,7 +4467,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5034,7 +4489,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5063,7 +4517,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5087,7 +4540,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5115,7 +4567,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5149,7 +4600,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5169,11 +4619,6 @@ adventures: 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 @@ -5191,4 +4636,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/fr.yaml b/content/adventures/fr.yaml index 3e76e62fd6d..06a18114a8b 100644 --- a/content/adventures/fr.yaml +++ b/content/adventures/fr.yaml @@ -27,7 +27,6 @@ adventures: Utilise au moins une commande `{ask}` et une commande `{echo}`. Tu peux choisir n'importe quel sujet. Si tu n'as pas d'idée, tu peux parler de l'un des sujets suivants : un film, un match ou une journée au zoo. - start_code: '{print} Ton histoire commence ici' 2: story_text: | Dans le niveau 2 tu peux créer une histoire plus drôle. Le nom de ton personnage principal peut être à n'importe quel endroit de la phrase @@ -53,7 +52,6 @@ adventures: En utilisant la forme adéquate apprise dans ce niveau, modifiez les commandes `{ask}` et `{echo}` de ton code. **Défi supplémentaire** Pour ajouter du suspens à ton histoire, ajoute une commande `{sleep}`. - start_code: '{print} Ton histoire' 3: story_text: | Au niveau 3, tu peux rendre ton histoire plus amusante. Tu peux tirer au hasard un monstre, un animal ou un autre obstacle, comme ceci : @@ -87,7 +85,6 @@ adventures: jeté {is} {ask} Quel objet devrions-nous jeter ? {remove} jeté {from} sac_à_dos ``` - start_code: '{print} Ton histoire' 4: story_text: | Comme nous le disions en introduction, le niveau précédent avait un problème avec les variables. Avais-tu essayé d'afficher une phrase contenant la variable « nom » ? Par exemple : `{print} mon nom est nom`. @@ -153,7 +150,6 @@ adventures: {repeat} 5 {times} {print} "Au secours !" {print} "Pourquoi personne ne vient m'aider ?" ``` - start_code: '{repeat} 5 {times} {print} ''Au secours !''' 8: story_text: | À ce niveau tu peux utiliser plusieurs lignes dans une commande `{if}`, ainsi tu peux améliorer la fin heureuse et la fin triste ! @@ -176,7 +172,6 @@ adventures: {print} "Oh non ! Richard est trop lent…" {print} _ ``` - start_code: '# écris ton code ici' 9: story_text: | À ce niveau tu peux utiliser les commandes `{if}` et `{repeat}` à l'intérieur d'autres commandes `{if}`et `{repeat}`. @@ -205,12 +200,10 @@ adventures: {else} {print} "Robin rentre à la maison" ``` - start_code: '# écris ton code ici' 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'. example_code: "```\nanimaux = _ , _ , _ \n{print} 'Ours brun, Ours brun'\n {print} 'Que vois-tu?'\n```\n" - start_code: '# écris ton code ici' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -218,7 +211,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# écris ton code ici' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -231,7 +223,6 @@ adventures: {if} chemin {is} "gauche" {and} arme {is} "épée" _ ``` - start_code: '# place ton code ici' 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. @@ -254,7 +245,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# écris ton code ici' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -275,7 +265,6 @@ adventures: naam = {input}("Quel est votre nom?") {print}('Bienvenue dans cette histoire!') ``` - start_code: '# écris ton code ici' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -315,10 +304,7 @@ adventures: _ {print} Voici un milkshake parfums {at} {random} ``` - start_code: |- - animaux {is} chien, chat, kangourou - préféré {is} {ask} Quel est ton animal préféré ? - {add} préféré {to_list} animaux + mal_aimé {is} {ask} Quel animal n'aimes-tu pas ? {remove} mal_aimé {from} animaux {print} Je choisis animaux {at} {random} @@ -376,10 +362,6 @@ adventures: _ Comment vas-tu ? _ ``` - start_code: | - {print} Salut ! - {ask} Quel est ton nom ? - {echo} salut 2: story_text: | ## La commande `{ask}` @@ -407,9 +389,7 @@ adventures: animaux_préférés {is} {ask} Quel est ton animal préféré ? {print} J'aime les animaux_préférés ``` - start_code: |- - nom {is} {ask} Quel est ton nom ? - {print} Bonjour nom + âge {is} {ask} Quel âge as-tu ? {print} nom a âge ans. 18: @@ -523,7 +503,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# écris ton code ici' calculator: name: Calculatrice default_save_name: Calculator @@ -608,7 +587,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# écris ton code ici' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -624,10 +602,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: | - nombre = 10 - {for} i {in} {range} 1 {to} 10 - {print} i * nombre 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -638,7 +612,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# écris ton code ici' 13: story_text: | ### Exercise 1 @@ -655,7 +628,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 14: story_text: | In this level you can programm the game 'Guess which number' @@ -676,7 +648,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# écris ton code ici' 15: story_text: | You can add the `{while}` loop to the calculator game you've learned to make in a previous level. @@ -703,7 +674,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# écris ton code ici' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -785,8 +755,7 @@ adventures: {print} Quels sont tes loisirs ? {echo} Tes loisirs sont ``` - start_code: | - {print} J'aime la programmation + Aimes-tu la programmation aussi ? {echo} {print} Quels sont tes loisirs ? @@ -839,10 +808,7 @@ adventures: film_pour_demain {is} choix_films {at} {random} Je vais chercher le popcorn ! {print} ``` - start_code: | - choix_films {is} dracula, fast and furious, maman j'ai raté l'avion, barbie - film_choisi {is} films {at} {random} - {print} Ce soir nous allons regarder _films + aime {ask} aimes-tu ce film ? {print} Demain, nous regarderons autre chose. {add} film_choisi {to} choix_films @@ -892,8 +858,7 @@ adventures: {else} "Ça fera 5,50 €" {print} "Bonne baignade !" ``` - start_code: | - {print} Bienvenue à la piscine Hedy ! + cours {is} {ask} "Es-tu ici pour un cours de natation ?" {if} cours oui {print} "Génial ! Tu as cours !" @@ -957,8 +922,7 @@ adventures: Sonnez les matines ! Ding, daing, dong ! ``` - start_code: | - Frère Jacques, + Dormez-vous ? Sonnez les matines ! Ding, daing, dong ! @@ -1054,11 +1018,6 @@ adventures: {for} nom {is} noms {print} À la plage nom aime activités {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: story_text: |- ### Exercise @@ -1098,26 +1057,6 @@ adventures: 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 @@ -1146,27 +1085,6 @@ adventures: 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 @@ -1199,31 +1117,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1253,9 +1146,7 @@ adventures: 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?' @@ -1312,36 +1203,6 @@ adventures: 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 @@ -1491,7 +1352,6 @@ adventures: Essaye toi-même le code ci-dessous avec le bouton vert « Exécuter le code » en-dessous de la zone de programmation. On y va ? Rends-toi à l'onglet suivant pour apprendre ta première commande ! - start_code: '{print} bonjour le monde !' 2: story_text: | Félicitations ! Tu as atteint le niveau 2. Avec un peu de chance, tu as déjà écrit des super codes ! @@ -1513,14 +1373,12 @@ adventures: À partir du niveau 2, ça change. Au niveau 2, tu vas apprendre à travailler avec des variables, ce qui te permet de mémoriser plusieurs réponses et les afficher où tu veux. Pour découvrir tout ça, allons à l'onglet suivant ! - start_code: '{print} bonjour le monde !' 3: story_text: | Au niveau précédent, tu as appris ce qu'est une variable et comment tu peux l'utiliser pour rendre tes aventures plus interactives. Mais… ce n'est pas la seule chose que tu peux faire avec des variables ! Tu peux aussi utiliser des variables pour faire des listes. Et tu peux même demander à Hedy de tirer un mot au hasard dans la liste, ce qui te permet de faire des vrais jeux ! Ça commence à l'onglet suivant ! - start_code: '{print} bonjour le monde !' 4: story_text: | Aux niveaux précédents, tu t'es entrainé à utiliser les variables, mais tu as peut-être rencontré le problème suivant. @@ -1541,9 +1399,6 @@ adventures: nom {is} Sophie {print} Mon nom est nom ``` - start_code: | - nom {is} Sophie - {print} Mon nom est nom 5: story_text: | Aux niveaux précédents tu as appris à utiliser `{at} {random}` pour rendre tes jeux différents à chaque exécution. @@ -1581,7 +1436,6 @@ adventures: prix_total {is} prix_plat + prix_boisson {print} "Ça fera " prix_total " euros, s'il vous plait" ``` - start_code: '# écris ton code ici' 7: story_text: | Bon travail ! Tu as atteint le niveau suivant, ce qui signifie que tu t'es entrainé à utiliser `{if}` et `{else}`. Tu as probablement remarqué que tes codes deviennent de plus en plus longs. @@ -1772,9 +1626,6 @@ adventures: ``` choix {is} _ ``` - start_code: | - choix {is} 1, 2, 3, 4, 5, ver de terre - {print} Tu as obtenu un _ {at} {random} 4: story_text: | À ce niveau, tu peux aussi créer un dé. Mais cette fois, tu peux essayer par toi-même sans exemple de code ! @@ -1841,7 +1692,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# écris ton code ici' 15: story_text: | ### Exercise @@ -1866,7 +1716,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# écris ton code ici' dishes: name: Vaisselle ? default_save_name: Dishes @@ -1887,7 +1736,6 @@ adventures: Ensuite, pense à une tâche qui doit être faite, et demande à l'ordinateur de décider qui doit faire la tâche avec la commande `{at} {random}`. **Bonus** Pas envie de faire la vaisselle ? Hack le programme en retirant ton nom de la liste avec la commande `{remove}` `{from}`. - start_code: '{print} Qui fait la vaisselle ?' 4: story_text: | Avec les guillemets, tu peux rendre le programme de la vaisselle encore mieux. @@ -1971,11 +1819,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: | - jours = lundi, mardi, mercredi, jeudi, vendredi, samedi, dimanche - nom = maman, papa, Emma, Sophie - {for} jour {in} jours - {print} nom {at} {random} " fait la vaisselle le " jour elif_command: name: '{elif}' default_save_name: elif @@ -2023,10 +1866,6 @@ adventures: {for} animal {in} animaux {print} "J'aime les " animal ``` - start_code: |- - animaux {is} chiens, chats, méduses - {for} animal {in} animaux - {print} "J'aime les " animal 11: story_text: |- À ce niveau, nous ajoutons une nouvelle forme pour le `{for}`. Aux niveaux précédents, nous avons utilisé `{for}`avec une liste, mais nous pouvons aussi utiliser `{for}` avec des nombres. @@ -2037,9 +1876,7 @@ adventures: {for} compteur {in} {range} 1 {to} 10 {print} compteur {print} "Caché ou pas, j'arrive !" - start_code: |- - {for} compteur {in} {range} 1 {to} 10 - {print} compteur + {print} "Caché ou pas, j'arrive !" 17: story_text: | @@ -2079,7 +1916,6 @@ adventures: ### Exercice Copie l'exemple de code dans la zone de programmation et complète les espaces vides pour faire marcher le code. **Bonus** Change le code pour que la voyante prédise non seulement ton nom, mais aussi ton âge, ton équipe de sport favorite ou quelque chose d'autre à ton sujet. - start_code: '# écris ton code ici' 3: story_text: | Au niveau précédent, tu as créé ta première machine de voyance, mais Hedy ne pouvait pas vraiment prédire quelque chose, seulement répéter avec la commande `{echo}`. @@ -2097,7 +1933,6 @@ adventures: story_text_2: | ### Exercice Bon, Hedy peut seulement répondre oui, non ou peut-être. Peux-tu donner à Hedy plus de réponses possibles, comme « certainement », ou « peux-tu répéter la question ? ». - start_code: '# écris ton code ici' 4: story_text: | Ce niveau n'ajoute pas de nouvelles fonctions, mais te permet de t'entrainer à utiliser les guillemets. @@ -2122,7 +1957,6 @@ adventures: {sleep} 2 {print} réponses {at} {random} ``` - start_code: '# écris ton code ici' 5: story_text: | ### Exercice @@ -2146,7 +1980,6 @@ adventures: {if} personne {in} amis {print} bonnes_réponses {at} {random} {else} {print} mauvaises_réponses {at} {random} ``` - start_code: '# écris ton code ici' 6: story_text: | À ce niveau tu peux utiliser les maths dans tes prédictions en tant que voyante. Cela te permettra de fabriquer de (folles) formules pour calculer le futur. @@ -2169,7 +2002,6 @@ adventures: {sleep} {print} enfants " enfants !" ``` - start_code: '# écris ton code ici' 7: story_text: | ### Exercice @@ -2182,7 +2014,6 @@ adventures: réponses = elle t'aime, elle ne t'aime pas _ _ _ _ réponses {at} {random} ``` - start_code: '# écris ton code ici' 8: story_text: | Avec l'exemple suivant, tu peux faire demander à la voyante plusieurs questions et les afficher ! @@ -2200,7 +2031,6 @@ adventures: {sleep} {print} "Ma boule de cristal dit… " réponses {at} {random} ``` - start_code: '# écris ton code ici' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2216,7 +2046,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: |- A partir du niveau 12, vous devrez également utiliser les guillemets dans les listes, avant et après chaque élément. @@ -2231,7 +2060,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# écris ton code ici' functions: name: functions default_save_name: functions @@ -2271,21 +2099,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2314,13 +2127,6 @@ adventures: {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. @@ -2344,17 +2150,6 @@ adventures: 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 @@ -2383,7 +2178,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2405,7 +2199,6 @@ adventures: _ {print} name ' is great at ' subjects {at} {random} _ {print} name 's greatest fear is ' fears {at} {random} ``` - start_code: '# écris ton code ici' haunted: name: La maison hantée default_save_name: La maison hantée @@ -2492,7 +2285,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# écris ton code ici' 4: story_text: | Dans ce niveau, tu vas apprendre comment utiliser les guillemets dans tes jeux. @@ -2514,7 +2306,6 @@ adventures: {sleep} {print} monstres {at} {random} ``` - start_code: '# écris ton code ici' 5: story_text: | Jusqu'à ce niveau, le jeu de la maison hantée demandait au joueur de choisir une porte, mais, comme tu l'as peut-être remarqué, il n'était pas vraiment obligé de répondre correctement. @@ -2533,7 +2324,6 @@ adventures: _ _ _ _ {print} "Bravo ! Tu t'échappes" {else} {print} "Tu as été mangé par… " monstre {at} {random} ``` - start_code: '# écris ton code ici' 9: story_text: | À ce niveau tu peux utiliser l'imbrication, ce qui te permet de rendre la maison hantée encore plus interactive ! @@ -2589,7 +2379,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2618,7 +2407,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2652,7 +2440,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2683,18 +2470,7 @@ adventures: {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?' @@ -2812,8 +2588,7 @@ adventures: _ réponse _ animaux _ "c'est aussi le mien !" _ _ "mes animaux préférés sont chien, vache et mouton" ``` - start_code: |- - jolies_couleurs {is} vert, jaune + couleur_préférée {is} {ask} "Quelle est ta couleur préférée ?" {if} couleur_préférée {in} jolies_couleurs {print} "jolie !" {else} {print} "bof" @@ -2842,10 +2617,6 @@ adventures: animaux_préférés {is} _ {print} J'aime les animaux_préférés ``` - start_code: |- - nom {is} Hedy - âge {is} 15 - {print} nom a âge ans 6: story_text: | Nous avons aussi un changement pour l'enregistrement dans une variable ! Tu peux maintenant utiliser `=` à la place de `{is}` quand tu enregistres un mot ou nombre dans une variable, comme ceci : @@ -2854,8 +2625,7 @@ adventures: nom = Hedy réponse = 20 + 4 ``` - start_code: | - nom = Hedy + réponse = 20 + 4 14: story_text: | @@ -2916,7 +2686,6 @@ adventures: {if} réponse2 {is} frog {print} "Super !" {else} {print} "Non, grenouille se dit frog" ``` - start_code: '# écris ton code ici' 16: story_text: | ### Exercise @@ -2937,7 +2706,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# écris ton code ici' maths: name: maths default_save_name: maths @@ -3012,11 +2780,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Je suis Hedy le perroquet - {ask} Quel est ton nom ? - {echo} - {echo} 2: story_text: | Au niveau précédent, tu as fait un perroquet qui te répétait. À ce niveau, nous allons faire un perroquet interactif, en utilisant une variable et la commande `{ask}`. @@ -3037,7 +2800,6 @@ adventures: Ensuite, écrit une commande `{sleep}` aux lignes 4 et 6 pour que le perroquet se calme un petit peu. **Bonus** Peux-tu faire que le perroquet demande plus que ton nom, en ajoutant des lignes de code ? - start_code: '{print} Je suis Hedy le perroquet !' 3: story_text: | Apprend à ton perroquet un nouveau mot avec `{add} {to}`. @@ -3052,7 +2814,6 @@ adventures: {print} 🧒 Dit nouveau_mot, Hedy ! {print} 🦜 mots {at} {random} ``` - start_code: '# écris ton code ici' 4: story_text: | À ce niveau nous devons utiliser les guillemets avec les commandes `{ask}` et `{print}`. @@ -3067,7 +2828,6 @@ adventures: {print} _ 🧒 Dis _ nouveau_mot _, Hedy !_ {print} _ 🦜 _ mots {at} {random} ``` - start_code: '# écris ton code ici' 5: story_text: | Récompense ton perroquet s'il dit le bon mot ! @@ -3086,7 +2846,6 @@ adventures: _ mot_dit {is} nouveau_mot _ "🧒 Bien joué, Hedy ! 🍪" _ _ "🧒 Non, Hedy ! Dis " nouveau_mot ``` - start_code: '# écris ton code ici' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3106,7 +2865,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# écris ton code ici' 14: story_text: | ### Exercise @@ -3130,7 +2888,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Presse une touche default_save_name: Pressed @@ -3159,7 +2916,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# écris ton code ici' 7: story_text: | Maintenant que tu sais tout sur le `{repeat}`, nous pouvons appuyer sur les touches plusieurs fois. @@ -3170,7 +2926,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# écris ton code ici' 9: story_text: | Maintenant que tu sais comment combiner les éléments, tu peux créer un jeu tactile avec `{pressed}`. @@ -3190,7 +2945,6 @@ adventures: _ _ ``` - start_code: '# écris ton code ici' print_command: name: '{print}' default_save_name: affiche @@ -3216,8 +2970,6 @@ adventures: ``` _ Salut ! ``` - start_code: | - {print} Bienvenue chez Hedy ! 18: story_text: |- Nous sommes arrivés à du code Python réel ! Cela signifie qu'à partir de maintenant, nous devons utiliser les parenthèses avec `{print}` et `{range}` @@ -3267,7 +3019,6 @@ adventures: {if} points_b > points_a {print} 'You belong to the B club' ``` - start_code: '# écris ton code ici' quotation_marks: name: '"Les guillemets"' default_save_name: quotation_marks @@ -3374,9 +3125,6 @@ adventures: les_prix {is} _ _ ``` - start_code: | - animaux {is} chien, chat, kangourou - {print} animaux {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. @@ -3444,8 +3192,7 @@ adventures: {print} "Salut tout le monde" {print}"Tout ceci sera répété 5 fois" ``` - start_code: |- - {repeat} 5 {times} + {print} "Bonjour tout le monde" {print} "Ceci sera écrit 5 fois" 9: @@ -3462,8 +3209,7 @@ adventures: {else} {print} "La pizza c'est meilleur" ``` - start_code: |- - {repeat} 3 {times} + nourriture = {ask} "Que veux-tu ?" {if} nourriture {is} pizza {print} "parfait !" @@ -3517,8 +3263,7 @@ adventures: _ {print} "Qui s'en va sifflant, soufflant" _ {print} "Dans les grands sapins verts, oh !" ``` - start_code: |- - {repeat} 3 {times} + {print} "Cette ligne sera répétée…" {print} "Cette ligne aussi…" {print} "mais celle-ci ne le sera pas !" @@ -3545,7 +3290,6 @@ adventures: Ensuite, ajoute au moins 4 lignes de code supplémentaires au programme du restaurant. Demande au client ce qu'il désire boire et demande-lui s'il veut payer en liquide ou avec la carte. Enfin, pense à une façon sympa de dire au revoir à ton client. - start_code: '# écris ton code ici' 2: story_text: | Au niveau 2 tu pourrais étendre ton restaurant en utilisant des variables. Au niveau 1, Hedy pouvait seulement `{echo}` les commandes et seulement retenir la dernière chose commandée. @@ -3570,7 +3314,6 @@ adventures: Maintenant ajoute ton propre résumé de la nourriture et de la boisson commandé par le client. **Bonus** Maintenant que tu as appris comment utiliser les variables, tu peux utiliser autant de variables sur une ligne que tu le désires. Peux-tu ajouter plus de variables dans ton code, pour demander « sur place » ou « à emporter », « en liquide » ou « en carte », « avec ou sans paille », etc. ? - start_code: '# écris ton code ici' 3: story_text: | As-tu du mal à décider ce que tu voudrais manger pour dîner ? Tu peux laisser Hedy décider pour toi ! @@ -3598,7 +3341,6 @@ adventures: prix {is} _ _ ``` - start_code: '# écris ton code ici' 4: story_text: | À ce niveau, tu dois utiliser les guillemets avec les commandes `{print}` ou `{ask}`. @@ -3622,7 +3364,6 @@ adventures: {print} Merci pour ta commande. {print} Tes plat et boisson vont être servis ! ``` - start_code: '# écris ton code ici' 5: story_text: | ### Exercice @@ -3638,7 +3379,6 @@ adventures: {if} choix {in} boisson_en_stock {print} choix " en préparation !" {else} {print} "Désolé, nous n'avons pas de " choix ``` - start_code: '# écris ton code ici' 6: story_text: | À ce niveau tu peux utiliser les maths pour calculer le prix total pour la commande de ton client, pour faire un restaurant plus réaliste. @@ -3666,7 +3406,6 @@ adventures: {print} "Ce sera " prix " euros, s'il vous plaît" {print} "Merci, bon appétit !" ``` - start_code: '# écris ton code ici' 7: story_text: | À ce niveau tu as appris comment utiliser la commande `{repeat}` pour répéter une ligne de code un certain nombre de fois. @@ -3680,7 +3419,6 @@ adventures: {print} "Bienvenu au restaurant Chez Hedy" personnes = {ask} "Combien de personnes vont nous rejoindre aujourd'hui ?" ``` - start_code: '# écris ton code ici' 8: story_text: | À ce niveau, tu peux rendre ton restaurant virtuel plus élaboré en répétant plusieurs lignes de code. Comme ceci : @@ -3699,7 +3437,6 @@ adventures: ### Exercice Ce code peut être complété avec d'autres éléments de menu, par exemple, proposer des boissons, et/ou plusieurs plats ou desserts. Ajoute au moins un autre élément. **Bonus** Ajoute encore plus d'éléments. Propose autant de choix que tu veux ! - start_code: '# écris ton code ici' 9: story_text: | À ce niveau tu peux utiliser l'imbrication pour rendre ton restaurant plus réaliste et plus amusant ! @@ -3734,7 +3471,6 @@ adventures: {print} "Cela fera " prix " euros" {print} "Bon appétit !" ``` - start_code: '# écris ton code ici' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3770,7 +3506,6 @@ adventures: {print} 'Vous voulez donc commander pour ' nombre_personnes ' personnes.' {print} "Allons-y !" ``` - start_code: '# écris ton code ici' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3789,7 +3524,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# écris ton code ici' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3804,7 +3538,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# écris ton code ici' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3821,7 +3554,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Pierre, papier, ciseaux default_save_name: Rock @@ -3862,7 +3594,6 @@ adventures: choix {is} pierre {print} Je choisis _ ``` - start_code: '# écris ton code ici' 3: story_text: | Tu peux utiliser la commande `{at} {random}` pour faire choisir à l'ordinateur la pierre, le papier ou les ciseaux ! @@ -3882,7 +3613,6 @@ adventures: joueur_1 {is} {ask} Nom du joueur 1 : _ ``` - start_code: '{print} Bienvenue à ton propre pierre papier ciseaux !' 4: story_text: | À ce niveau nous pouvons continuer le programme pierre, papier, ciseaux. Mais si tu veux ajouter du texte, tu dois utiliser les guillemets ici aussi. @@ -3935,7 +3665,6 @@ adventures: {print} "Tu as perdu !" # termine ce code ``` - start_code: '# écris ton code ici' 10: story_text: | ### Exercice @@ -3946,7 +3675,6 @@ adventures: joueurs = _ {for} _ ``` - start_code: '# écris ton code ici' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3964,7 +3692,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# écris ton code ici' 15: story_text: | ### Exercise @@ -3986,7 +3713,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# écris ton code ici' rock_2: name: Pierre, papier, ciseaux 2 default_save_name: rock_2 @@ -4003,7 +3729,6 @@ adventures: choix {is} _ {print} Je choisi choix ``` - start_code: '# écris ton code ici' secret: name: SuperEspion default_save_name: SuperSpy @@ -4027,7 +3752,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# écris ton code ici' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -4040,7 +3764,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# écris ton code ici' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -4099,7 +3822,6 @@ adventures: {print} "PLUS AUCUN SINGE SAUTANT SUR LE LIT !" {sleep} ``` - start_code: '{print} ''Chantons !''' 7: story_text: | Les chansons contiennent souvent beaucoup de répétitions. Par exemple… Baby Shark ! Si tu la chantes, tu ne fais que répéter la même chose. @@ -4137,7 +3859,6 @@ adventures: verset = verset - 1 {print} verset " bouteilles vertes posées sur le mur" ``` - start_code: '# écris ton code ici' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4153,7 +3874,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# écris ton code ici' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4168,7 +3888,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# écris ton code ici' 12: 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: @@ -4183,7 +3902,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# écris ton code ici' 13: 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? @@ -4200,16 +3918,6 @@ adventures: {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. @@ -4245,7 +3953,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# écris ton code ici' 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. @@ -4267,7 +3974,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# écris ton code ici' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4289,15 +3995,6 @@ adventures: {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 @@ -4365,7 +4062,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# écris ton code ici' 14: 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. @@ -4428,7 +4124,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# écris ton code ici' 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. @@ -4490,7 +4185,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# écris ton code ici' 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. @@ -4577,7 +4271,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# écris ton code ici' turtle: name: Tortue default_save_name: Tortue @@ -4601,9 +4294,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | À ce niveau, tu peux utiliser des variables pour rendre la tortue interactive. Par exemple, tu peux demander au joueur de combien de pas la tortue doit avancer. @@ -4629,11 +4319,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Course de la tortue ! - angle {is} 90 - {turn} angle - {forward} 25 3: story_text: | À ce niveau, tu peux utiliser `{at} {random}` avec la tortue dessinatrice. Un choix aléatoire permet à la tortue de suivre un chemin différent à chaque fois. @@ -4646,10 +4331,6 @@ adventures: {turn} angles {at} {random} {forward} 25 ``` - start_code: |- - angles {is} 10, 50, 90, 150, 250 - {turn} angles {at} {random} - {forward} 25 4: story_text: | Au niveau 4 tu dois utiliser les guillemets avec `{print}` et `{ask}`. Aussi quand tu dessines ! @@ -4792,7 +4473,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# écris ton code ici' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4810,7 +4490,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4835,16 +4514,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4860,7 +4529,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4871,7 +4539,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4882,7 +4549,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4900,7 +4566,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4919,7 +4584,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4939,7 +4603,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4950,7 +4613,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4963,7 +4625,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4994,7 +4655,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5035,7 +4695,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5058,7 +4717,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5087,7 +4745,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5111,7 +4768,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5139,7 +4795,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5173,7 +4828,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5193,9 +4847,7 @@ adventures: réponse = {ask} "Combien font 5 fois 5 ?" {print} "Une réponse correcte a été donnée" ``` - start_code: |- - réponse = 0 - {while} réponse != 25 + réponse = {ask} "Combien font 5 fois 5 ?" {print} "Une réponse correcte a été donnée" years: @@ -5215,4 +4867,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# écrit to code ici' diff --git a/content/adventures/fy.yaml b/content/adventures/fy.yaml index 721c046f32e..54e216e0f15 100644 --- a/content/adventures/fy.yaml +++ b/content/adventures/fy.yaml @@ -22,7 +22,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -48,7 +47,6 @@ adventures: 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: @@ -77,7 +75,6 @@ adventures: 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? @@ -92,7 +89,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -115,7 +111,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -126,7 +121,6 @@ adventures: {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! @@ -144,7 +138,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -163,7 +156,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -180,7 +172,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -241,7 +230,6 @@ adventures: {else} {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -262,7 +250,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -302,13 +289,6 @@ adventures: _ {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 @@ -326,11 +306,6 @@ adventures: {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 @@ -363,10 +338,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -394,11 +365,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -510,7 +476,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -549,7 +514,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -568,7 +532,6 @@ adventures: 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! @@ -585,7 +548,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -601,7 +563,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -611,7 +572,6 @@ adventures: number2 = {ask} 'What is the second number?' answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -628,7 +588,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -653,11 +612,7 @@ adventures: 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 @@ -689,7 +644,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -738,17 +692,6 @@ adventures: 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 @@ -771,12 +714,6 @@ adventures: {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. @@ -796,14 +733,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -825,16 +754,6 @@ adventures: 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 @@ -849,13 +768,6 @@ adventures: {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 @@ -878,17 +790,7 @@ adventures: {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' @@ -915,19 +817,7 @@ adventures: 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: @@ -943,11 +833,6 @@ adventures: 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 @@ -972,10 +857,7 @@ adventures: {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} @@ -1012,19 +894,7 @@ adventures: 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: @@ -1039,11 +909,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1083,26 +948,6 @@ adventures: 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 @@ -1131,27 +976,6 @@ adventures: 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 @@ -1184,31 +1008,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1238,9 +1037,7 @@ adventures: 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?' @@ -1297,36 +1094,6 @@ adventures: 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 @@ -1480,7 +1247,6 @@ adventures: Besykje de koade sels te draaien mei de griene 'Koade draaie'-knop ûnder it linker programmearfjild. Witst net watst meitsje silst? Yn de oare tabs stean wat ideeën. - start_code: print oant moarn! 2: story_text: | Yn level 2 leare wy wat nijs. Kinst in wurd in namme jaan mei `is`. Dernei kinst oeral yn dyn koade dy namme brûke. Hedy ferfangt dat dan. Dat giet sa: @@ -1504,7 +1270,6 @@ adventures: ``` story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: print oant moarn! 3: story_text: | Yn level 3 kinst ek in list meitsje. Ut de list kinst dan eat willekeurichs kieze. Dat dochst mei `at random` (sprek út: et ren-dum). @@ -1515,7 +1280,6 @@ adventures: ``` Alle koade fan level 3 stiet wer in de linkerbalke. Yn de tabkes stean wer opjeften. - start_code: print oant moarn! 4: story_text: | Yn level 4 binne `ask` en `print` feroare. @@ -1533,7 +1297,6 @@ adventures: answer is ask 'What do we need to use from now on?' print 'We need to use ' answer ``` - start_code: print 'oant moarn' 5: story_text: | `ask` en `print` wurkje noch lykas yn level 4. @@ -1561,9 +1324,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - start_code: |- - namme is ask 'Wat is dyn namme?' - if namme is Hedy print 'leuk' else print 'minder leuk!' 6: story_text: | `ask`, `print` en `if` wurkje noch lykas yn level 5. @@ -1593,7 +1353,6 @@ adventures: ``` repeat 3 times print 'Hedy is leuk!' ``` - start_code: repeat 3 times print 'Hedy is leuk!' 8: story_text: | `ask` en `print` wurkje noch as east, mar `if` en `repeat` binne no oars! @@ -1612,10 +1371,6 @@ adventures: {print} 'Hello everyone' {print} 'This is all repeated 5 times' ``` - start_code: |- - repeat 5 times - print 'Goeie allegearre' - print 'Dit wurdt allegearre 5 kear werhelle' 9: story_text: | In this level you can not only use multiple lines with `if` and `repeat`, but you can also put them together! @@ -1639,13 +1394,6 @@ adventures: 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' 10: story_text: | In dit level leren we een nieuwe code, de code `for`. Met `for` kun je alle dingen in een lijstje gebruiken. @@ -1662,18 +1410,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - dieren is hond, kat, papegaai - for dier in dieren - print dier ' is een leuk dier!' 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: |- - for i in range 1 to 10 - print i - print 'Wie niet weg is is gezien' 12: story_text: | So far, Hedy did not allow for decimal numbers like 1.5, but now we do allow that. Note that cmputers use the . for decimal numbers. @@ -1695,8 +1435,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - print 'decimal numbers now need to use a dot' + print 2.5 + 2.5 13: story_text: We sille no `and` en `or` brûke. Ast 2 dingen kontroleare wolst, hoechst net mear 2 `if`-kes yninoar te dwaan, mar kinst no `and` brûke. Beide dingen yn 'e if moeten waar zijn als je een `and` gebruikt. We kunnen ek `or` brûke. Daarbij moet er 1 fan de twa waar zijn. @@ -1707,11 +1446,6 @@ adventures: 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!' 14: story_text: |- We sille nije tekens leare, do kinst se miskien al fan rekkenjen as wiskunde: `<` en `>`. De `<` sjocht oft it earste getal @@ -1722,8 +1456,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - leeftyd = ask 'Hoe âld bisto?' + if leeftyd < 13 print 'Dan bist jonger as ik!' else @@ -1737,11 +1470,6 @@ adventures: answer = ask 'What is 5 times 5?' print 'A correct answer has been given' ``` - start_code: |- - antwoord = 0 - while antwoord != 25 - antwurd = ask 'Wat is 5 kear 5?' - print 'Dat wie it goede antwurd!' 16: story_text: No sette wy fjouwerkante heakjes om listen. We moatte no ek inkele oanhellingstekens (') om dingen in listen sette. example_code: | @@ -1767,9 +1495,8 @@ adventures: print i print 'Wie niet weg is is gezien' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dice @@ -1797,12 +1524,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1816,7 +1541,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1834,7 +1558,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1846,7 +1569,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1858,7 +1580,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1883,7 +1604,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1909,7 +1629,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1925,7 +1644,6 @@ adventures: {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. @@ -1938,7 +1656,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1971,7 +1688,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1980,7 +1696,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1991,7 +1706,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -2039,10 +1753,6 @@ adventures: {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: |- 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. @@ -2054,10 +1764,6 @@ adventures: {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: 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. @@ -2103,7 +1809,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2125,7 +1830,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2146,7 +1850,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2159,7 +1862,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2190,7 +1892,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2213,7 +1914,6 @@ adventures: Can you do it? In the upcoming levels the layout of {repeat} command will change, which enables you to repeat multiple lines at once. - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2230,7 +1930,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2246,7 +1945,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2258,7 +1956,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2298,21 +1995,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2341,13 +2023,6 @@ adventures: {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. @@ -2371,17 +2046,6 @@ adventures: 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 @@ -2410,7 +2074,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2432,7 +2095,6 @@ adventures: _ {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 @@ -2462,7 +2124,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2520,7 +2181,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2536,7 +2196,6 @@ adventures: {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. @@ -2555,7 +2214,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2583,7 +2241,6 @@ adventures: ### Exercise Now it's very hard to win this game, can you make it easier to win? For example by only having 1 wrong door and 2 correct doors instead of 1 correct door en 2 wrong ones? - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2609,7 +2266,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2638,7 +2294,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2672,7 +2327,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2703,18 +2357,7 @@ adventures: {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?' @@ -2753,10 +2396,6 @@ adventures: _ _ _ 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... @@ -2773,11 +2412,6 @@ adventures: {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. @@ -2793,16 +2427,6 @@ adventures: {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 @@ -2831,11 +2455,6 @@ adventures: _ 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 @@ -2861,10 +2480,6 @@ adventures: 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: @@ -2873,8 +2488,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2906,8 +2520,7 @@ adventures: {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} @@ -2940,7 +2553,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2961,7 +2573,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -3001,8 +2612,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -3028,7 +2638,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -3045,7 +2654,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3058,7 +2666,6 @@ adventures: {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}`. @@ -3072,7 +2679,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -3088,7 +2694,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3107,7 +2712,6 @@ adventures: to_save = price - saved weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3131,7 +2735,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3160,7 +2763,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3173,7 +2775,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3193,7 +2794,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3219,8 +2819,6 @@ adventures: ``` _ 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. @@ -3237,8 +2835,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3270,7 +2867,6 @@ adventures: {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 @@ -3300,10 +2896,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3338,10 +2930,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3375,9 +2963,6 @@ adventures: 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. @@ -3426,11 +3011,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3444,10 +3024,6 @@ adventures: {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! @@ -3462,13 +3038,6 @@ adventures: {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 @@ -3494,10 +3063,6 @@ adventures: 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? @@ -3515,11 +3080,6 @@ adventures: _ {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 @@ -3539,7 +3099,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3559,7 +3118,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3591,7 +3149,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: |- In this level you have to use quotation marks when using the `{print}` command. @@ -3611,7 +3168,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3635,7 +3191,6 @@ adventures: ### Exercise Can you think of more questions to {ask} the customers when they are ordering, and make up different responses to their answers by using the {if} command? - start_code: '# place your code here' 6: 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. @@ -3654,7 +3209,6 @@ adventures: {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. @@ -3673,7 +3227,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3694,7 +3247,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3722,7 +3274,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3764,7 +3315,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3783,7 +3333,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3798,7 +3347,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3815,7 +3363,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3842,7 +3389,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3851,7 +3397,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3873,12 +3418,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3898,7 +3441,6 @@ 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. Can you finish the code? @@ -3918,7 +3460,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3929,7 +3470,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3947,7 +3487,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3968,7 +3507,6 @@ adventures: {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 @@ -3985,7 +3523,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -4009,7 +3546,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -4022,7 +3558,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -4038,10 +3573,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4075,7 +3606,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -4093,7 +3623,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -4107,7 +3636,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4159,7 +3687,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4174,7 +3701,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4189,7 +3715,6 @@ adventures: {print} '{if} youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4206,16 +3731,6 @@ adventures: {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. @@ -4279,7 +3794,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4301,7 +3815,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4323,15 +3836,6 @@ adventures: {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 @@ -4400,7 +3904,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4463,7 +3966,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4525,7 +4027,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4612,7 +4113,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: turtle @@ -4632,9 +4132,6 @@ adventures: {turn} left {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} left 2: story_text: | In level 1 the turtle could only turn left or right. That is a bit boring! @@ -4662,11 +4159,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: | - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4677,10 +4169,6 @@ adventures: {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! @@ -4707,11 +4195,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: | - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4744,12 +4227,6 @@ adventures: 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. @@ -4773,8 +4250,6 @@ adventures: {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. @@ -4797,8 +4272,6 @@ adventures: {turn} _ {forward} _ ``` - start_code: | - hoeken = {ask} 'How many angles should I draw?' 9: story_text: | Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures. @@ -4818,7 +4291,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4836,7 +4308,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4861,16 +4332,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4886,7 +4347,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4897,7 +4357,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4908,7 +4367,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4926,7 +4384,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4945,7 +4402,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4965,7 +4421,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4976,7 +4431,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4989,7 +4443,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -5020,7 +4473,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5061,7 +4513,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5084,7 +4535,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5113,7 +4563,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5137,7 +4586,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5165,7 +4613,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5199,7 +4646,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5219,11 +4665,6 @@ adventures: 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 @@ -5241,4 +4682,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/he.yaml b/content/adventures/he.yaml index 9b565e61a1e..788e7d54ce8 100644 --- a/content/adventures/he.yaml +++ b/content/adventures/he.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -49,7 +48,6 @@ adventures: 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: @@ -78,7 +76,6 @@ adventures: 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? @@ -93,7 +90,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -116,7 +112,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -127,7 +122,6 @@ adventures: {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! @@ -145,7 +139,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -181,7 +173,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +515,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -569,7 +533,6 @@ adventures: 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! @@ -586,7 +549,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -602,7 +564,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -613,7 +574,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -630,7 +590,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -655,11 +614,7 @@ adventures: 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 @@ -691,7 +646,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -740,17 +694,6 @@ adventures: 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 @@ -773,12 +716,6 @@ adventures: {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. @@ -798,14 +735,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -827,16 +756,6 @@ adventures: 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 @@ -851,13 +770,6 @@ adventures: {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 @@ -880,17 +792,7 @@ adventures: {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' @@ -917,19 +819,7 @@ adventures: 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: @@ -945,11 +835,6 @@ adventures: 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 @@ -974,10 +859,7 @@ adventures: {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} @@ -1014,19 +896,7 @@ adventures: 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: @@ -1041,11 +911,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1085,26 +950,6 @@ adventures: 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 @@ -1133,27 +978,6 @@ adventures: 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 @@ -1186,31 +1010,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1240,9 +1039,7 @@ adventures: 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?' @@ -1299,36 +1096,6 @@ adventures: 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 @@ -1474,7 +1241,6 @@ adventures: 1: story_text: "בשלב 1 תוכלו להשתמש בפקודות `{print}`, `{ask}` ו-`{echo}`.\n הקלידו את הקוד שלכם בשדה התכנות. או לחצו על הכפתור הירוק בבלוק הקוד לדוגמה, והקוד יוקלד עבורכם!\nנסו את הקוד בעצמכם בעזרת הכפתור הירוק 'הרץ קוד' מתחת לשדה התכנות.\n\nתוכלו להדפיס טקסט למסך בעזרת הפקודה `{print}`.\ \ \n" - start_code: '{print} שלום עולם!' 2: story_text: | בשלב 2 נלמד שתי פקודות חדשות: `{is}` ו-`{sleep}`. @@ -1489,11 +1255,9 @@ adventures: ``` story_text_2: | הפקודה `{print}` עדיין עובדת אותו הדבר, אבל הפקודה `{ask}` השתנתה. תצטרכו להשתמש בְּמשתנה גם בפקודה `{ask}`. זה נראה כך: - start_code: '{print} שלום עולם!' 3: story_text: | בשלב 3 תוכלו ליצור רשימה. תוכלו לתת למחשב לבחור משהו באופן אקראי מתוך הרשימה. ניתן לעשות זאת בעזרת הפקודה `{at} {random}`. - start_code: '{print} שלום עולם!' 4: story_text: | בשלב 4 `{ask}` ו`{print}` השתנו. @@ -1509,7 +1273,6 @@ adventures: תשובה {is} {ask} 'במה עלינו להשתמש מעכשיו?' {print} 'עלינו להשתמש ב ' תשובה ``` - start_code: '{print} ''שלום עולם''' 5: story_text: | בשלב 5 מתווסף משהו חדש, ה `{if}`! עם `{if}` ביכולתנו לבחור בין שתי אפשרויות. @@ -1520,9 +1283,6 @@ adventures: שם {is} {ask} 'מה שמך?' {if} שם {is} הדי {print} 'נחמד' {else} {print} 'בוז!' ``` - start_code: |- - שם {is} {ask} 'מה שמך?' - {if} שם {is} הדי {print} 'קול!' {else} {print} 'שיהיה' 6: story_text: | בשלב הזה נלמד דבר חדש: מעכשיו תוכלו לבצע חישובים מתמטיים. @@ -1545,7 +1305,6 @@ adventures: ``` {repeat} 3 {times} {print} 'איזה כיף בהדי!' ``` - start_code: '{repeat} 3 {times} {print} ''איזה כיף בהדי!''' 8: story_text: | `{ask}` ו-`{print}` נשארות אותו הדבר. אבל `{if}`, `{else}` ו-`{repeat}` השתנו! @@ -1569,10 +1328,6 @@ adventures: {print} 'פולש!' {print} 'אסור לך להשתמש במחשב הזה!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'שלום חברים' - {print} 'השורה הזו תודפס 5 פעמים' 9: story_text: | בשלב הזה, לא רק שאתם יכולים לשים כמה שורות קוד בתוך `{if}` ו-`{repeat}`, אתם יכולים גם להשתמש בהם ביחד! @@ -1587,13 +1342,6 @@ adventures: {else} {print} 'עדיף פיצה' ``` - start_code: |- - {repeat} 3 {times} - אוכל = {ask} 'מה את רוצה לאכול?' - {if} אוכל {is} פיצה - {print} 'יופי!' - {else} - {print} 'עדיף פיצה' 10: story_text: |- בשלב הזה נלמד פקודה חדשה שנקראת `{for}`. בעזרת `{for}`, תוכלו ליצור רשימה ולהשתמש בכל האיברים שלה. @@ -1612,9 +1360,6 @@ adventures: 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: |- - {for} מספר {in} {range} 1 {to} 5 - {print} מספר 12: story_text: |- **מספרים עשרוניים** @@ -1624,8 +1369,7 @@ adventures: {print} 'שתיים וחצי ועוד שתיים וחצי שווה...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'מעכשיו צריך להשתמש בנקודה כדי לכתוב שברים עשרוניים' + {print} 2.5 + 2.5 13: story_text: הגיע המן ללמוד על `{and}` ו-`{or}`! כדי לבדוק שני ביטויים, כבר אין צורך להשתמש בשתי פקודות {if}. אפשר להשתמש ב-`{and}` ו-`{or}`. כשמשתמשים ב-`{and}`, הביטויים משני צידי ה-`{and}` צריכים להיות נכונים. כשמשתמשים ב-`{or}`, מספיק שאחד מהם יהיה נכון. @@ -1636,11 +1380,6 @@ adventures: {if} שם {is} 'הדי' {and} גיל {is} 2 {print} 'את הדי האמיתית!' ``` - start_code: |- - שם = {ask} 'איך קוראים לך?' - גיל = {ask} 'בת כמה את?' - {if} שם {is} 'הדי' {and} גיל {is} 2 - {print} 'את הדי האמיתית!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1655,8 +1394,7 @@ adventures: {if} גיל > 12 {print} 'את יותר מבוגרת ממני!' ``` - start_code: |- - גיל = {ask} 'בן כמה אתה?' + {if} גיל < 13 {print} 'אתה יותר צעיר ממני!' {else} @@ -1675,11 +1413,6 @@ adventures: תשובה = {ask} 'כמה זה 5 כפול 5?' {print} 'זו התשובה הנכונה' ``` - start_code: |- - תשובה = 0 - {while} תשובה != 25 - תשובה = {ask} 'כמה זה 5 כפול 5?' - {print} 'זו התשובה הנכונה' 16: story_text: |- מעכשיו ניצור רשימות כמו ב-Python, עם סוגריים מרובעים מסביב לרשימה! נמשיך גם להקיף כל איבר במירכאות, כמו בשלבים הקודמים. @@ -1706,9 +1439,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1736,12 +1468,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1755,7 +1485,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1773,7 +1502,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1785,7 +1513,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1797,7 +1524,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1822,7 +1548,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1840,7 +1565,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1856,7 +1580,6 @@ adventures: {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. @@ -1869,7 +1592,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1902,7 +1624,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1911,7 +1632,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1922,7 +1642,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1970,10 +1689,6 @@ adventures: {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: |- 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. @@ -1985,10 +1700,6 @@ adventures: {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: 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. @@ -2028,7 +1739,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2046,7 +1756,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2067,7 +1776,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2080,7 +1788,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2111,7 +1818,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2123,7 +1829,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2140,7 +1845,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2156,7 +1860,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2168,7 +1871,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2208,21 +1910,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2251,13 +1938,6 @@ adventures: {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. @@ -2281,17 +1961,6 @@ adventures: 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 @@ -2320,7 +1989,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2342,7 +2010,6 @@ adventures: _ {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 @@ -2372,7 +2039,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2419,7 +2085,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2435,7 +2100,6 @@ adventures: {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. @@ -2454,7 +2118,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2483,7 +2146,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2509,7 +2171,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2538,7 +2199,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2572,7 +2232,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2603,18 +2262,7 @@ adventures: {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?' @@ -2653,10 +2301,6 @@ adventures: _ _ _ 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... @@ -2673,11 +2317,6 @@ adventures: {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. @@ -2693,16 +2332,6 @@ adventures: {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 @@ -2731,11 +2360,6 @@ adventures: _ 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 @@ -2761,10 +2385,6 @@ adventures: 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: @@ -2773,8 +2393,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2806,8 +2425,7 @@ adventures: {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} @@ -2830,7 +2448,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2851,7 +2468,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2891,8 +2507,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: תוכי @@ -2948,7 +2563,6 @@ adventures: {print} 🧒 אמרי מילה_חדשה, הֶדִי! {print} 🦜 מילים {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}`. @@ -2962,7 +2576,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | תנו פרס לתוכי שלכם אם הוא אומר את המילה הנכונה! @@ -2978,7 +2591,6 @@ adventures: {if} מילה_שנאמרה {is} מילה_חדשה {print} '🧒עבודה טובה, הֶדִי! 🍪' {else} {print} '🧒 לא, הֶדִי! תגידי ' מילה_חדשה ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -2998,7 +2610,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3022,7 +2633,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3051,7 +2661,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3064,7 +2673,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3084,7 +2692,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3110,8 +2717,6 @@ adventures: ``` _ 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. @@ -3128,8 +2733,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3161,7 +2765,6 @@ adventures: {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 @@ -3191,10 +2794,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3229,10 +2828,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3266,9 +2861,6 @@ adventures: 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. @@ -3317,11 +2909,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3335,10 +2922,6 @@ adventures: {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! @@ -3353,13 +2936,6 @@ adventures: {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 @@ -3385,10 +2961,6 @@ adventures: 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? @@ -3406,11 +2978,6 @@ adventures: _ {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 @@ -3430,7 +2997,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3450,7 +3016,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3482,7 +3047,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3502,7 +3066,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3523,7 +3086,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3542,7 +3104,6 @@ adventures: {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. @@ -3554,7 +3115,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3572,7 +3132,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3600,7 +3159,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3645,7 +3203,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3664,7 +3221,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3679,7 +3235,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3696,7 +3251,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3724,7 +3278,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3733,7 +3286,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3755,12 +3307,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3780,7 +3330,6 @@ 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. Can you finish the code? @@ -3800,7 +3349,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3811,7 +3359,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3829,7 +3376,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3851,7 +3397,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3868,7 +3413,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3892,7 +3436,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3905,7 +3448,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3921,10 +3463,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3958,7 +3496,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3976,7 +3513,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3990,7 +3526,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4042,7 +3577,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4057,7 +3591,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4072,7 +3605,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4089,16 +3621,6 @@ adventures: {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. @@ -4134,7 +3656,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4156,7 +3677,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4178,15 +3698,6 @@ adventures: {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 @@ -4254,7 +3765,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4317,7 +3827,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4379,7 +3888,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4466,7 +3974,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4488,9 +3995,6 @@ adventures: {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. @@ -4514,11 +4018,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4529,10 +4028,6 @@ adventures: {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! @@ -4559,11 +4054,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4596,12 +4086,6 @@ adventures: 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. @@ -4625,7 +4109,6 @@ adventures: {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. @@ -4668,7 +4151,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4686,7 +4168,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4711,16 +4192,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4736,7 +4207,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4747,7 +4217,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4758,7 +4227,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4776,7 +4244,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4795,7 +4262,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4815,7 +4281,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4826,7 +4291,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4839,7 +4303,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4870,7 +4333,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4911,7 +4373,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4934,7 +4395,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4963,7 +4423,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4987,7 +4446,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5015,7 +4473,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5049,7 +4506,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5069,11 +4525,6 @@ adventures: 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 @@ -5091,4 +4542,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/hi.yaml b/content/adventures/hi.yaml index 8f6b217ea48..ab337c5420e 100644 --- a/content/adventures/hi.yaml +++ b/content/adventures/hi.yaml @@ -262,7 +262,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -302,13 +301,6 @@ adventures: _ {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 @@ -326,11 +318,6 @@ adventures: {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 @@ -363,10 +350,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -394,10 +377,7 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. @@ -510,7 +490,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -549,7 +528,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -568,7 +546,6 @@ adventures: 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! @@ -585,7 +562,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -601,7 +577,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -611,7 +586,6 @@ adventures: number2 = {ask} 'What is the second number?' answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -628,7 +602,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -653,11 +626,7 @@ adventures: 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 @@ -689,7 +658,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -738,17 +706,6 @@ adventures: 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 @@ -771,12 +728,6 @@ adventures: {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. @@ -796,14 +747,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -825,16 +768,6 @@ adventures: 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 @@ -849,13 +782,6 @@ adventures: {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 @@ -878,17 +804,7 @@ adventures: {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' @@ -915,19 +831,7 @@ adventures: 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: @@ -943,11 +847,6 @@ adventures: 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 @@ -972,10 +871,7 @@ adventures: {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} @@ -1012,19 +908,7 @@ adventures: 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: @@ -1039,11 +923,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1083,26 +962,6 @@ adventures: 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 @@ -1131,27 +990,6 @@ adventures: 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 @@ -1184,31 +1022,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1238,9 +1051,7 @@ adventures: 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?' @@ -1297,36 +1108,6 @@ adventures: 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 @@ -1582,8 +1363,7 @@ adventures: {print} 'सभी को नमस्कार' {print} 'यह सब 5 बार दोहराया जाता है' ``` - start_code: | - {repeat} 5 {times} + {print} 'हेलो दोस्तों' {print} 'ये सब ५ बार प्रिंट होंगे' 9: @@ -1600,8 +1380,7 @@ adventures: else {print} 'पिज़्ज़ा बेहतर है' ``` - start_code: |- - {repeat} 3 {times} + खाना = {ask} 'तुम क्या चाहते हो?' {if} खाना {is} 'पिज़्ज़ा' {print} 'अच्छा!' @@ -1719,9 +1498,8 @@ adventures: {print} इ {print} 'तैयार या नहीं, यहाँ मैं आया!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dice @@ -1749,12 +1527,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1768,7 +1544,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1786,7 +1561,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1798,7 +1572,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1810,7 +1583,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1835,7 +1607,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1861,7 +1632,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1877,7 +1647,6 @@ adventures: {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. @@ -1890,7 +1659,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1923,7 +1691,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1932,7 +1699,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1943,7 +1709,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1991,10 +1756,6 @@ adventures: {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: |- 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. @@ -2006,10 +1767,6 @@ adventures: {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: 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. @@ -2054,7 +1811,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2075,7 +1831,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2096,7 +1851,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2109,7 +1863,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2140,7 +1893,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2162,7 +1914,6 @@ adventures: Can you do it? In the upcoming levels the layout of {repeat} command will change, which enables you to repeat multiple lines at once. - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2179,7 +1930,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2195,7 +1945,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2207,7 +1956,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2247,21 +1995,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2290,13 +2023,6 @@ adventures: {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. @@ -2320,17 +2046,6 @@ adventures: 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 @@ -2359,7 +2074,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2381,7 +2095,6 @@ adventures: _ {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 @@ -2410,7 +2123,6 @@ adventures: ``` story_text_2: | Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2457,7 +2169,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2473,7 +2184,6 @@ adventures: {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. @@ -2492,7 +2202,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2520,7 +2229,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2546,7 +2254,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2575,7 +2282,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2609,7 +2315,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2640,18 +2345,7 @@ adventures: {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?' @@ -2690,10 +2384,6 @@ adventures: _ _ _ 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... @@ -2710,11 +2400,6 @@ adventures: {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. @@ -2730,16 +2415,6 @@ adventures: {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 @@ -2768,11 +2443,6 @@ adventures: _ 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 @@ -2798,10 +2468,6 @@ adventures: 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: @@ -2810,8 +2476,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2843,8 +2508,7 @@ adventures: {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} @@ -2867,7 +2531,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2888,7 +2551,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2928,8 +2590,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: तोता @@ -2955,7 +2616,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2972,7 +2632,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2985,7 +2644,6 @@ adventures: {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}`. @@ -2999,7 +2657,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -3015,7 +2672,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3034,7 +2690,6 @@ adventures: to_save = price - saved weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3058,7 +2713,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3087,7 +2741,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3100,7 +2753,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3120,7 +2772,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3146,8 +2797,6 @@ adventures: ``` _ 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. @@ -3164,8 +2813,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3197,7 +2845,6 @@ adventures: {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 @@ -3227,10 +2874,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3265,10 +2908,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3302,9 +2941,6 @@ adventures: 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. @@ -3353,11 +2989,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3371,10 +3002,6 @@ adventures: {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! @@ -3389,13 +3016,6 @@ adventures: {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 @@ -3421,10 +3041,6 @@ adventures: 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? @@ -3442,11 +3058,6 @@ adventures: _ {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 @@ -3465,7 +3076,6 @@ adventures: ``` story_text_2: | Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3485,7 +3095,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3517,7 +3126,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3537,7 +3145,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3558,7 +3165,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3577,7 +3183,6 @@ adventures: {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. @@ -3589,7 +3194,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3606,7 +3210,6 @@ adventures: ``` story_text_2: | Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3634,7 +3237,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3679,7 +3281,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3698,7 +3299,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3713,7 +3313,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3730,7 +3329,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3758,7 +3356,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3767,7 +3364,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3789,12 +3385,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3814,7 +3408,6 @@ 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. Can you finish the code? @@ -3834,7 +3427,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3845,7 +3437,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3863,7 +3454,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3884,7 +3474,6 @@ adventures: {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 @@ -3901,7 +3490,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3925,7 +3513,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3938,7 +3525,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3954,10 +3540,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3991,7 +3573,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -4009,7 +3590,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -4023,7 +3603,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4075,7 +3654,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4090,7 +3668,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4105,7 +3682,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4122,16 +3698,6 @@ adventures: {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. @@ -4167,7 +3733,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4189,7 +3754,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4211,15 +3775,6 @@ adventures: {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 @@ -4288,7 +3843,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4351,7 +3905,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4413,7 +3966,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4500,7 +4052,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: turtle @@ -4521,9 +4072,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 20 - {turn} left 2: story_text: | In level 1 the turtle could only turn left or right. That is a bit boring! @@ -4555,11 +4103,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: | - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4570,10 +4113,6 @@ adventures: {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! @@ -4600,11 +4139,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: | - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4637,12 +4171,6 @@ adventures: 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. @@ -4666,8 +4194,6 @@ adventures: {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. @@ -4690,8 +4216,6 @@ adventures: {turn} _ {forward} _ ``` - start_code: | - hoeken = {ask} 'How many angles should I draw?' 9: story_text: | Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures. @@ -4711,7 +4235,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4729,7 +4252,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4754,16 +4276,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4779,7 +4291,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4790,7 +4301,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4801,7 +4311,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4819,7 +4328,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4838,7 +4346,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4858,7 +4365,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4869,7 +4375,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4882,7 +4387,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4913,7 +4417,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4954,7 +4457,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4977,7 +4479,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5006,7 +4507,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5030,7 +4530,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5058,7 +4557,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5092,7 +4590,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5112,11 +4609,6 @@ adventures: 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 @@ -5134,4 +4626,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/hu.yaml b/content/adventures/hu.yaml index a1f5d0a5be6..79e48718d87 100644 --- a/content/adventures/hu.yaml +++ b/content/adventures/hu.yaml @@ -22,7 +22,6 @@ adventures: ``` story_text_2: | Tudsz saját történetet írni Hedy-ben a `{print}` , `{ask}` és `{echo}` használatával? - start_code: '{print} A történeted itt kezdődik' 2: story_text: |+ A 2. szinten szórakoztatóbbá teheted a történetedet. Fő karaktered neve mostantól @@ -49,7 +48,6 @@ adventures: 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 A te történeted 3: story_text: | In level 3 you can make your story more fun. Hozzáadhatsz valami véletlenszerűt is a történetéhez. Bármilyen szörnyet, állatot vagy más akadályt. @@ -78,7 +76,6 @@ adventures: dump {is} {ask} Which item should he dump? {remove} dump {from} bag ``` - start_code: print A te történeted 4: story_text: |- Lehet, hogy észrevetted, hogy még mindig van hiba a 2. szinten. @@ -96,7 +93,6 @@ adventures: print 'Hallja a következő állat hangját: ' allatok at random print nev ' fél, hogy ez egy kísértetjárta erdő' ``` - start_code: print 'A történeted ide lesz írva!' 5: story_text: |- Amit a 4. szinten megtehetsz, az még szórakoztatóbbá varázsolja történetedet. A 4. @@ -116,7 +112,6 @@ adventures: vege is ask ' Egy jó vagy rossz véget szeretnél?' if vege is jó print nev ' előveszi a kardot és a szörny gyorsan elszalad' else print 'A szörny megeszi ' nev '-t' ``` - start_code: print 'Itt lesz hamarosan a történeted!' 7: story_text: |- A történetben valaki bizonyos szavakat többször is elmond. Például, ha valaki segítséget kér vagy elénekel egy dalt. @@ -127,7 +122,6 @@ adventures: repeat 5 times print 'Segítség!' print 'Miért nem segít nekem senki?' ``` - start_code: repeat 5 times print 'Segítség!' 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! @@ -145,7 +139,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -181,7 +173,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -190,7 +181,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -220,7 +210,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {else} {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Számológép default_save_name: Számológép @@ -553,7 +518,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: print 'Üdvözlünk a számológépnél!' 9: story_text: A 6. szinten megtanultad a számológép készítését, a 7. szinten kibővítheted ezt a kódot, és egy kis matematikai játékot készíthetsz belőle. Mint ez... example_code: |- @@ -571,7 +535,6 @@ adventures: pontszam = pontszam + 1 print 'Szép munka! A pontszámod... ' pontszam ' a 10-ből!' ``` - start_code: print 'Üdvözölünk a számológépnél!' 10: story_text: | This calculator game helps you practise your tables of multiplication! @@ -588,7 +551,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -604,7 +566,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -614,7 +575,6 @@ adventures: number2 = {ask} 'What is the second number?' answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -631,7 +591,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -656,11 +615,7 @@ adventures: 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 @@ -692,7 +647,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -741,17 +695,6 @@ adventures: 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 @@ -774,12 +717,6 @@ adventures: {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. @@ -799,14 +736,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -828,16 +757,6 @@ adventures: 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 @@ -852,13 +771,6 @@ adventures: {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 @@ -881,17 +793,7 @@ adventures: {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' @@ -918,19 +820,7 @@ adventures: 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: @@ -946,11 +836,6 @@ adventures: 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 @@ -975,10 +860,7 @@ adventures: {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} @@ -1015,19 +897,7 @@ adventures: 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: @@ -1042,11 +912,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1086,26 +951,6 @@ adventures: 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 @@ -1134,27 +979,6 @@ adventures: 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 @@ -1187,31 +1011,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1241,9 +1040,7 @@ adventures: 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?' @@ -1300,36 +1097,6 @@ adventures: 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 @@ -1475,7 +1242,6 @@ adventures: 1: story_text: "Az első szinten a `{print}`, `{ask}` és `{echo}` parancsokat használhatod.\nÍrd a kódodat a programozási ablakba, vagy nyomd meg a gombot a példa programok mellett, hogy bemásold!\nPróbáld ki a kódot a zöld 'Kód futtatása' gomb megnyomásával a programozási ablak alatt!\n\n\ Szöveget írhatsz a képernyőre a `{print}` paranccsal. \n" - start_code: '{print} Helló világ!' 2: story_text: | A 2. szinten két új parancsot tanulunk: `{is}` és `{sleep}`. @@ -1490,11 +1256,9 @@ adventures: ``` story_text_2: | A `{print}` ugyanúgy működik, de a `{ask}` parancs megváltozott. Használnod kell egy változót a `{ask}` paranccsal is. Így néz ki: - start_code: '{print} Helló világ!' 3: story_text: | A 3. szinten készíthetsz listát is. Kérheted a számítógépet, hogy véletlenszerűen válasszon valamit a listából. Ezt a `{at} {random}` paranccsal teheted meg. - start_code: '{print} Helló világ!' 4: story_text: | A 4. szinten a `{ask}` és a `{print}` máshogy működik. @@ -1507,7 +1271,6 @@ adventures: válasz {is} {ask} "Miket kell mostantól használni?" {print} válasz " kell használni." ``` - start_code: '{print} ''Helló világ''' 5: story_text: | Az 5. szinten újdonság következik, a `{if}`! A `{if}` paranccsal két lehetőség közül választhatsz. @@ -1567,8 +1330,7 @@ adventures: {print} "BEHATOLÓ!" {print} "Nem használhatod ezt a gépet!" ``` - start_code: |- - {repeat} 5 {times} + {print} "Sziasztok" {print} "Ez 5-ször lett kiírva" 9: @@ -1585,8 +1347,7 @@ adventures: {else} {print} "a pizza finomabb" ``` - start_code: |- - {repeat} 3 {times} + étel = {ask} "Mit kérsz?" {if} étel {is} pizza {print} "fincsi!" @@ -1602,17 +1363,10 @@ adventures: {for} állat {in} állatok {print} 'Szép ' állat ``` - start_code: |- - állatok {is} kutya, cica, gömbhal - {for} állat {in} állatok - {print} 'Szép ' állat 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: |- - {for} számláló {in} {range} 1 {to} 10 - {print} számláló 12: story_text: |- **Tizedes törtek** @@ -1622,8 +1376,7 @@ adventures: {print} 'Két és fél plusz két fél egyenlő...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'a tizedes törtek pontot használnak' + {print} 2.5 + 2.5 13: story_text: Most megtanuljuk az `{and}` és `{or}` kifejezések használatát! Ha két állítást szeretnél ellenőrizni, akkor nem kell kettő {if} parancsot használnod, használhatod az `{and}` és `{or}` parancsokat. Ha az `{and}` parancsot használod, akkor az `{and}` bal és jobb oldalán mindkét @@ -1674,9 +1427,7 @@ adventures: válasz = {ask} "Mennyi 5-ször 5?" {print} "Ez a helyes válasz" ``` - start_code: |- - válasz = 0 - {while} válasz != 25 + válasz = {ask} "Mennyi 5-ször 5?" {print} "Ez a helyes válasz" 16: @@ -1740,12 +1491,10 @@ adventures: ``` choices {is} _ ``` - start_code: print Mit dobunk ezúttal? 4: story_text: |- A 3. szinten mondatokat készíthetünk a változó értékével, természetesen idézőjelekkel. Ezúttal a minta kód nem egészen teljes. Be tudod fejezni a kódot? - start_code: print 'Mit dobunk ezúttal?' 5: story_text: |- Ismét készíthetsz egy kockát a 4. szinten az `if` használatával. @@ -1760,7 +1509,6 @@ adventures: print 'Te' _ 'dobtál' if _ is giliszta print 'Megállhatsz.' _ print 'Dobj újra!' ``` - start_code: print 'Mit dobunk ezúttal?' 6: story_text: |- Azt is megteheted, hogy újra egy giliszta kockát csinálsz a 6. szinten, de most kiszámíthatod azt is, hogy hány pontot dobtál. @@ -1784,7 +1532,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: print 'Mit dobunk ezúttal?' 7: story_text: |- Az 5. szinten ismét készíthetsz kockát . A `repeat` kóddal könnyedén dobhatsz egy @@ -1797,7 +1544,6 @@ adventures: dobások is 1, 2, 3, 4, 5, giliszta repeat _ _ print _ _ ``` - start_code: print 'Mit dobunk ezúttal?' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1809,7 +1555,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1834,7 +1579,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Ki mosogat? default_save_name: mosogat @@ -1861,7 +1605,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: print Ki mosogat? 4: story_text: | Az idézőjelek segítségével szebbé teheted a mosogatás tervezését. @@ -1875,7 +1618,6 @@ adventures: print _ ő mosogat: _ print emberek at _ ``` - start_code: print 'Ki mosogat?' 5: story_text: |- Az `if` segítségével most szórakoztatóbbá teheted a választást a programban. @@ -1890,7 +1632,6 @@ adventures: if mosogato is Gizi print _ sajnos mosogatnom kell _ else print 'szerencsére nem én, mert' _ 'már mosogat' ``` - start_code: print 'Ki mosogat?' 6: story_text: |- Ki milyen gyakran mosogat? Ez igazságos? Ezt megszámolhatod a 5. szinten. @@ -1926,7 +1667,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: print 'Ki mosogat?' 7: story_text: |- Az `repeat` segítségével megismételheted a kódrészleteket. Ennek segítségével @@ -1936,7 +1676,6 @@ adventures: emberek is anya, apa, Edit, Gizi repeat _ _ print 'a mosogató:' _ ``` - start_code: print 'Ki mosogat?' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1947,7 +1686,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1995,10 +1733,6 @@ adventures: {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: |- 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. @@ -2010,10 +1744,6 @@ adventures: {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: 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. @@ -2057,7 +1787,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: |- Az 1. szinten megalkottad első jóslásgépedet, de Hedy nem tudott igazán megjósolni semmit, csak visszhangot. @@ -2076,7 +1805,6 @@ adventures: story_text_2: | ### Exercises Now, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or '{ask} again'. - start_code: print Szia Hedy a jósnő vagyok! 4: story_text: |- A 3. szint nem tartalmaz új funkciókat, de lehetővé teszi az idézőjelek használatának gyakorlását. @@ -2094,7 +1822,6 @@ adventures: valasz is igen, nem, talan print 'A kristálygömböm azt mondja... ' valasz at random ``` - start_code: '# place your code here' 5: story_text: |- A 4. szinten megtanulod (titokban) az esélyeket a magad javára billenteni a jósnő használata során! @@ -2116,7 +1843,6 @@ adventures: szemely is ask 'Ki vagy te?' if szemely is Hedy print 'Bizonyosan nyerni fogsz!' else print 'Balszerencse! Valaki más nyer!' ``` - start_code: '# place your code here' 6: story_text: |- A 5. szinten jövendőmondóként használhatod a matematikát előrejelzéseidben. Ez lehetővé teszi (buta) képletek kitalálását a jövő kiszámításához. @@ -2146,7 +1872,6 @@ adventures: eredmeny is eredmeny * foci print 'Te ' eredmeny ' százalék okos vagy.' ``` - start_code: '# place your code here' 7: story_text: |- Az 6. szinten a `repeat` paranccsal beállíthatod, hogy a gép egyszerre több jóslatot mondjon. @@ -2168,7 +1893,6 @@ adventures: valasz is igen, nem, talan repeat 3 times print 'A kristálygömböm azt mondja... ' valasz at random ``` - start_code: '# place your code here' 8: story_text: |- Az 5. szinten megtanultad, hogyan kell használni az ismétlést, hogy a jósnő 3 kérdésre válaszoljon egymás után, de problémánk adódott a kérdések kiíratásával. @@ -2184,7 +1908,6 @@ adventures: print kerdes print 'A kristálygömböm azt mondja...' valasz at random ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2200,7 +1923,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2212,7 +1934,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2252,21 +1973,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2295,13 +2001,6 @@ adventures: {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. @@ -2325,17 +2024,6 @@ adventures: 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 @@ -2364,7 +2052,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2386,7 +2073,6 @@ adventures: _ {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: Kísértetház default_save_name: Kísértetház @@ -2417,7 +2103,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - start_code: print Hogy kerültem ide? 2: story_text: | In this haunted house you can choose your monsters with emojis. Of course you could also use words. @@ -2471,7 +2156,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: |- A 3. szinten megtanulod használni az idézőjeleket a játékaidban. @@ -2487,7 +2171,6 @@ adventures: {sleep} {print} monsters {at} {random} ``` - start_code: '# place your code here' 5: story_text: |- Eddig a szintig a kísértetjárta ház játék mindig arra kérte a játékost, hogy válasszon egy ajtót, de ahogy észrevettétek, nem igazán kellett helyesen válaszolniuk. @@ -2505,7 +2188,6 @@ adventures: if valasztottajto is helyesajto print 'Nagyszerű! Kiszabadultál!' else print 'Jaj ne! Megevett a ...' szornyek 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! @@ -2533,7 +2215,6 @@ adventures: ### Exercise Now it's very hard to win this game, can you make it easier to win? For example by only having 1 wrong door and 2 correct doors instead of 1 correct door en 2 wrong ones? - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: A 8. szinten megváltoztattuk az ismétlés parancsot, és hozzáadtunk egy sort a kísértetjárta házunkhoz, amely megmondja a játékosnak, hogy melyik szobában vannak. example_code: | @@ -2557,7 +2238,6 @@ adventures: if jatekos is elo print 'Nagyszerű! Túlélted!' ``` - start_code: print 'Szabadulj ki a kísértetházból' 14: story_text: | ### Exercise @@ -2586,7 +2266,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2620,7 +2299,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2651,18 +2329,7 @@ adventures: {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?' @@ -2701,10 +2368,6 @@ adventures: _ _ _ 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... @@ -2721,11 +2384,6 @@ adventures: {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. @@ -2741,16 +2399,6 @@ adventures: {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 @@ -2779,11 +2427,6 @@ adventures: _ 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 @@ -2809,10 +2452,6 @@ adventures: 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: @@ -2821,8 +2460,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2854,8 +2492,7 @@ adventures: {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} @@ -2878,7 +2515,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2899,7 +2535,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2939,8 +2574,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2966,7 +2600,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2983,7 +2616,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2996,7 +2628,6 @@ adventures: {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}`. @@ -3010,7 +2641,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -3026,7 +2656,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3045,7 +2674,6 @@ adventures: to_save = price - saved weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3069,7 +2697,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3098,7 +2725,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3111,7 +2737,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3131,7 +2756,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3157,8 +2781,6 @@ adventures: ``` _ 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. @@ -3175,8 +2797,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3208,7 +2829,6 @@ adventures: {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 @@ -3238,10 +2858,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3276,10 +2892,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3313,9 +2925,6 @@ adventures: 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. @@ -3364,11 +2973,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3382,10 +2986,6 @@ adventures: {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! @@ -3400,13 +3000,6 @@ adventures: {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 @@ -3432,10 +3025,6 @@ adventures: 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? @@ -3453,11 +3042,6 @@ adventures: _ {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: Étterem default_save_name: Étterem @@ -3479,7 +3063,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - start_code: '# place your code here' 2: story_text: |- A 2. szinten változók segítségével bővítheted éttermedet. Az 1. szinten Hedy csak egyszer tudta visszhangozni a sorrendet, és csak az utolsó dologra emlékezett, amit rendeltek. @@ -3499,7 +3082,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: |- Nehezen tudod eldönteni, mit szeretnél vacsorázni? Engedheted, hogy Hedy válasszon neked! @@ -3531,7 +3113,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: "A 3. szinten idézőjeleket fogunk alkalmazni, amikor a `print` parancsot használjuk.\nTudod-e idézőjelek hozzáadásával működtetni a 2. szintű kódodat a 3. szinten?\n\nLégy óvatos! A 2. szinten aposztrófokat engedélyeztek a szövegben, de a 3. szinten Hedy összetéveszti őket\ \ idézőjelekkel, és a kód nem fog működni!\nTehát ahelyett, hogy beírnád a `print ma pizzát szolgálunk fel` kifejezést, írd be a `print` \n ma pizzát szolgálunk fel` parancsot." @@ -3547,7 +3128,6 @@ adventures: print 'Köszönjük a rendelésedet.' print 'A(z) ' etel ' és a(z) ' ital ' mindjárt itt lesz!' ``` - start_code: '# place your code here' 5: story_text: |- A 4. szinten az if parancs lehetővé teszi, hogy kérdéseket tegyél fel ügyfeleidnek, és különböző módon felelj a válaszaikra. @@ -3570,7 +3150,6 @@ adventures: ``` Tudnál még több kérdést feltenni az ügyfeleknek, amikor rendelnek, és különböző módon felelni a válaszaikra az if paranccsal? - start_code: '# place your code here' 6: story_text: |- A 6. szinten matematikai számításokkal kiszámíthatod az ügyfelek megrendelésének teljes árát, ami reálisabbá teheti a virtuális éttermet. @@ -3601,7 +3180,6 @@ adventures: - kedvezményt adsz az embereknek, amikor (titkos) kuponkódot adnak meg? - adsz hozzá gyermekmenüt? - gondolsz más szórakoztató dolgokra? - start_code: '# place your code here' 7: story_text: |- Az 6. szinten megtanultad, hogyan használhatod az ismétlés parancsot egy kódsor megismétlésére bizonyos számú alkalommal. @@ -3617,7 +3195,6 @@ adventures: repeat emberek times food is ask 'Mit szeretnél ennit?' print 'Köszönjük megrendelésedet! Mindjárt jön!' ``` - start_code: print 'Üdvözlünk a Hedy étteremben!' 8: story_text: | In this level you can make your virtual restaurant more elaborate by repeating multiple lines of code. Like this: @@ -3638,7 +3215,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add as many options as you like! - start_code: '# place your code here' 9: story_text: |- A 7. szinten több sor kód megismétlésével bonyolultabbá teheted virtuális éttermedet. Mint ez: @@ -3662,7 +3238,6 @@ adventures: print 'Ez ' ar ' forint lesz' print 'Köszönöm, jó étvágyat!!' ``` - start_code: print 'Üdvözlünk a Hedy étteremben!' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3703,7 +3278,6 @@ adventures: ar is 400 * emberek print 'Ez ' ar ' forint lesz, kérem' ``` - start_code: print 'Üdvözlünk a Hedy étteremben!' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3722,7 +3296,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3737,7 +3310,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3754,7 +3326,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Kő, papír, olló default_save_name: Kő @@ -3783,7 +3354,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: print Üdvözlünk saját kő, papír olló játékodon! 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! @@ -3792,7 +3362,6 @@ adventures: choice {is} _ {print} I choose choice ``` - start_code: '# place your code here' 3: story_text: | A 2. szinten listákat írhatunk be, és választhatunk belőlük dolgokat. @@ -3823,14 +3392,12 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: print Üdvözlünk saját kő papír olló játékodon! 4: story_text: | A 3. szinten tovább programozhatunk kő, papírt, ollót. De ha szöveget szeretnél hozzáadni, akkor itt is idézőjeleket kell használnod. Egészítsd ki a kódot úgy, hogy a helyes parancsokat vagy karaktereket írd be a aláhúzásokra? - start_code: print 'Üdvözlünk saját kő, papír olló játékodon!' 5: story_text: |- A 4. szinten meghatározhatjuk, hogy ki nyert. @@ -3851,7 +3418,6 @@ adventures: if _ is _ print 'döntetlen!' else print 'nem döntetlen' if valaszt is kő and szamitogepe is papír print 'számítógép nyert' ``` - start_code: print 'Üdvözlünk saját kő, papír olló játékodon!' 9: story_text: | In this level you can program the whole rock, paper, scissors game by nesting the {if}-commands. Can you finish the code? @@ -3871,7 +3437,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3882,7 +3447,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3900,7 +3464,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3921,7 +3484,6 @@ adventures: {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 @@ -3938,7 +3500,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3962,7 +3523,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3975,7 +3535,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3991,10 +3550,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Énekelj egy dalt! default_save_name: Dal @@ -4035,7 +3590,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: print 'Baby shark' 7: story_text: |- A dalok gyakran sok ismétlést tartalmaznak. Például... Baby Shark! Ha elénekled, ugyanazt énekled folyamatosan: @@ -4053,7 +3607,6 @@ adventures: repeat _ _ print 'Baby Shark tututudutudu' print 'Baby Shark' ``` - start_code: print 'Baby Shark' 8: story_text: A 6. szinten a "Üveg sör" dalt programoztad. Egy verset alkottál, majd 99 -szer kellett lemásolnod a verssorokat. A 7. szinten 99 alkalommal ismételheted meg a dalt, csak egy egyszerű sor hozzáadásával! example_code: | @@ -4065,7 +3618,6 @@ adventures: verssor = verssor - 1 print verssor 'üveg sör a falon' ``` - start_code: print 'Üveg sör' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4117,7 +3669,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4132,7 +3683,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4147,7 +3697,6 @@ adventures: {print} '{if} youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4164,16 +3713,6 @@ adventures: {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. @@ -4209,7 +3748,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4231,7 +3769,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4253,15 +3790,6 @@ adventures: {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 @@ -4330,7 +3858,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4393,7 +3920,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4455,7 +3981,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4542,7 +4067,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Teknős default_save_name: teknős @@ -4563,9 +4087,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - forward 50 - turn left 2: story_text: |- Az 1. szinten a teknős csak balra vagy jobbra tudott fordulni. Ez egy kicsit unalmas! @@ -4597,11 +4118,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - print Turtle race! - angle is 90 - turn angle - forward 25 3: story_text: |- Iin level 3 you can use use `random` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4612,10 +4128,6 @@ adventures: turn angles at random forward 25 ``` - start_code: |- - angles is 10, 50, 90, 150, 250 - turn angles at random - forward 25 4: story_text: A 3. szinten idézőjeleket kell használni a "print" és az "ask" szöveggel. A teknős használata közben is example_code: | @@ -4640,12 +4152,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - print 'Teknős verseny' - irany is ask 'Hány fokot forduljon?' - turn irany - tavolsag is ask 'Milyen messze menjen?' - forward tavolsag 5: story_text: A 4. szinten választást hozhatsz létre az `if` utasítással. Például választhatsz különböző típusú alakzatok között. example_code: |- @@ -4676,12 +4182,6 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: | - print 'Alakzatok rajzolása' - alakzat is ask 'Négyzetet vagy háromszöget akarsz rajzolni?' - if alakzat is háromszög szog is 120 else szog is 90 - turn szog - forward 25 6: story_text: |- Az 5. szinten számítások segítségével különböző alakzatokat rajzolhatsz. @@ -4705,7 +4205,6 @@ adventures: forward 50 turn szog ``` - start_code: print 'Alakzatok rajzolása' 8: story_text: |- Most, hogy több sort megismételhetünk, könnyebben készíthetünk alakzatokat. @@ -4745,7 +4244,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4763,7 +4261,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4788,16 +4285,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4813,7 +4300,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4824,7 +4310,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4835,7 +4320,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4853,7 +4337,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4872,7 +4355,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4892,7 +4374,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4903,7 +4384,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4916,7 +4396,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4947,7 +4426,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4988,7 +4466,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5011,7 +4488,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5040,7 +4516,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5064,7 +4539,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5092,7 +4566,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5126,7 +4599,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5146,11 +4618,6 @@ adventures: 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 @@ -5168,4 +4635,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/id.yaml b/content/adventures/id.yaml index 824c4158f84..0bafe35230d 100644 --- a/content/adventures/id.yaml +++ b/content/adventures/id.yaml @@ -20,7 +20,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Cerita kamu dimulai dari sini' 2: story_text: |- Pada level 2, kamu dapat membuat ceritanya lebih menyenangkan. Karakter utama kamu sekarang dapat muncul dimanapun pada kalimat-kalimatnya. @@ -45,7 +44,6 @@ adventures: Ubah perintah '{ask}' dan '{echo}' dalam kode Anda ke bentuk yang benar yang telah Anda pelajari di level ini. **Ekstra** Tambahkan perintah '{sleep}' ke kode Anda untuk membangun ketegangan dalam cerita Anda. - start_code: '{print} Cerita kamu' 3: story_text: |- Kamu dapat menambahkan sesuatu secara acak di cerita kamu. Monster, hewan, atau benda apapun. @@ -85,7 +83,6 @@ adventures: dump {is} {ask} Which item should he dump? {remove} dump {from} bag ``` - start_code: print Cerita kamu 4: story_text: | Anda mungkin memperhatikan bahwa masih ada masalah di level sebelumnya. Apakah Anda mencoba mencetak kalimat yang mengandung kata nama? yaitu `{print}` nama saya adalah nama. @@ -110,7 +107,6 @@ adventures: {print} _Dia mendengar suara _ binatang {at} {random} {print} nama _takut ini hutan angker _ ``` - start_code: print 'Cerita kamu akan ditampilkan disini!' 5: story_text: |- Apa yang kamu bisa lakukan di level 4 adalah membuat cerita kamu semakin menyenangkan. Pada level 4 kamu dapat membuat akhir cerita yang berbeda. @@ -133,7 +129,6 @@ adventures: {if} akhir {is} nama {print} nama 'yang bagus mengambil pedang dan monster itu segera lari' {else} {print} nama 'Monster itu memakan ' ``` - start_code: print 'Sekarang cerita kamu akan dimulai!' 7: story_text: | Dalam sebuah cerita, seseorang mengucapkan kata-kata beberapa kali. Misalnya saja ketika seseorang meminta bantuan atau menyanyikan sebuah lagu. @@ -148,7 +143,6 @@ adventures: repeat 5 times print 'Tolong!' print 'Kenapa tidak ada seorangpun yang menolongku?' ``` - start_code: repeat 5 times print 'Tolong!' 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! @@ -171,7 +165,6 @@ adventures: {print} 'Oh tidak! Richard terlalu lambat.' {print} _ ``` - start_code: '# letakkan kode Anda di sini' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -190,7 +183,6 @@ adventures: {else} {print} 'Robin pulang' ``` - start_code: '# letakkan kode Anda di sini' 10: story_text: | Pada level ini Anda dapat menggunakan perintah {for} dalam cerita Anda. Dengan cara ini Anda dapat dengan mudah memprogram buku anak-anak 'Beruang coklat, Beruang coklat, apa yang kamu lihat'. @@ -204,7 +196,6 @@ adventures: {print} 'Beruang coklat, Beruang coklat' {print} 'Apa yang kamu lihat?' ``` - start_code: '# letakkan kode Anda di sini' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -213,7 +204,6 @@ adventures: nama = 'Ratu Inggris' {print} nama ' sedang memakan sepotong kue, tiba-tiba...' ``` - start_code: '# letakkan kode Anda di sini' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -226,7 +216,6 @@ adventures: {if} jalur {is} 'kiri' {and} senjata {is} 'pedang' _ ``` - start_code: '# letakkan kode Anda di sini' 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. @@ -248,7 +237,6 @@ adventures: {else} {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' - start_code: '# letakkan kode Anda di sini' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -269,7 +257,6 @@ adventures: naam = {input}("Siapa namamu?") {print}('Selamat datang di cerita ini!') ``` - start_code: '# letakkan kode Anda di sini' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: tambahkan_perintah_hapus @@ -309,13 +296,6 @@ adventures: _ {print} Anda mendapatkan milkshake rasa {at} {random} ``` - start_code: |- - binatang {is} anjing, kucing, kanguru - seperti {is} {ask} Apa hewan favoritmu? - {add} seperti {to_list} binatang - tidak_suka {is} {ask} Hewan apa yang tidak kamu suka? - {remove} tidak_suka {from} binatang - {print} Saya memilih binatang {at} {random} and_or_command: name: '{and} & {or}' default_save_name: dan atau @@ -333,11 +313,6 @@ adventures: {if} nama {is} 'Hedy' {and} umur {is} 2 {print} 'Kamu adalah Hedy yang asli!' ``` - start_code: |- - nama = {ask} 'siapa namamu?' - umur = {ask} 'berapa umurmu?' - {if} nama {is} 'Hedy' {and} umur {is} 2 - {print} 'Kamu adalah Hedy yang asli!' ask_command: name: '{ask}' default_save_name: tanya_perintah @@ -370,10 +345,6 @@ adventures: _ Apa kabarmu? _ ``` - start_code: | - {print} Halo! - {ask} Siapa namamu? - {echo} halo 2: story_text: | ## Perintah tanya @@ -401,11 +372,6 @@ adventures: favorit_animals {is} {ask} Apa hewan favoritmu? {print} Saya suka binatang_favorit ``` - start_code: |- - nama {is} {ask} Siapa namamu? - {print} Halo nama - umur {is} {ask} Berapa umurmu? - {print} nama berumur tahun. 18: story_text: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -517,7 +483,6 @@ adventures: {elif} poin > poin_dealer {and} poin < 21: {print} 'Anda menang!' ``` - start_code: '# letakkan kode Anda di sini' calculator: name: Kalkulator default_save_name: kalkulator @@ -581,7 +546,6 @@ adventures: skor = skor + 1 {print} 'Kerja bagus! Skor Anda adalah... 'skor' dari 10!' ``` - start_code: print 'Selamat datang di kalkulator ini!' 10: story_text: | This calculator game helps you practise your tables of multiplication! @@ -598,7 +562,6 @@ adventures: {else} {print} 'Itu salah. Jawaban yang tepat adalah ' benar ``` - start_code: '# letakkan kode Anda di sini' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -614,10 +577,6 @@ adventures: {for} i {in} {range} 1 {to} 10 {print} i * nomor ``` - start_code: | - angka = 10 - {for} i {in} {range} 1 {to} 10 - {print} i * angka 12: story_text: | Di level ini, Anda bisa membuat kalkulator yang berfungsi untuk angka desimal. @@ -636,7 +595,6 @@ adventures: jawaban = _ {print} nomor1 ' ditambah ' nomor2 ' adalah ' _ ``` - start_code: '# letakkan kode Anda di sini' 13: story_text: | ### Latihan 1 @@ -653,7 +611,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Tulis kode Anda di sini' 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. @@ -678,11 +635,7 @@ adventures: 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 @@ -714,7 +667,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# letakkan kode Anda di sini' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -763,17 +715,6 @@ adventures: {clear} {print} 'KEJUTAN!' ``` - start_code: | - {print} '3' - {sleep} - {clear} - {print} '2' - {sleep} - {clear} - {print} '1' - {sleep} - {clear} - {print} 'KEJUTAN!' debugging: name: melakukan debug default_save_name: melakukan debug @@ -796,12 +737,6 @@ adventures: {print} Apa hobimu? {echo} Hobimu adalah ``` - start_code: | - {print} Saya suka pemrograman - Apakah Anda juga menyukai pemrograman? - {echo} - {print} Apa hobimu? - {echo} Hobimu adalah 2: story_text: |- Selamat datang di petualangan debugging. Men-debug suatu kode berarti menghilangkan kesalahan dalam kode. @@ -821,14 +756,6 @@ adventures: {sleep} Ini dia! Semoga perjalanan anda menyenangkan! ``` - start_code: | - tujuan {ask} Liburan kemana? - {print} Penerbangan menuju tujuan berangkat jam 3 sore. - {ask} Apakah Anda sudah mendaftarkan bagasi Anda? - {echo} - {print} Izinkan saya mencetak boarding pass Anda. - {sleep} - Ini dia! Semoga perjalanan anda menyenangkan! 3: story_text: |- Selamat datang di petualangan debugging. Men-debug suatu kode berarti menghilangkan kesalahan dalam kode. @@ -850,16 +777,6 @@ adventures: besok_film {is} pilihan_film {at} {random} Aku akan mengambil popcorn! {print} ``` - start_code: | - pilihan_film {is} drakula, cepat dan geram, sendirian di rumah, barbie - film_dipilih {is} film {at} {random} - {print} Malam ini kita akan menonton _film pilihan - seperti {ask} Apakah kamu suka film itu? - {print} Besok kita nonton yang lain. - {add} film_yang dipilih {to} pilihan_film - {print} Besok kita nonton besok_movie - besok_film {is} pilihan_film {at} {random} - Aku akan mengambil popcorn! {print} 4: story_text: |- ### Latihan @@ -874,13 +791,6 @@ adventures: {print} 'Penulis favoritmu adalah' {print} 'Hmm... aku pikir kamu sebaiknya mencoba... buku {at} {random}' ``` - start_code: | - {print} 'Selamat datang di perpustakaan online! - {ask} Genre buku apa yang kamu suka? - {print} Anda menyukai genre - author {is} {ask} 'Siapa penulis favoritmu?' - {print} 'penulis adalah penulis favoritmu' - {print} Hmm... Saya rasa Anda harus mencoba... buku {at} {random} 5: story_text: |- ### Latihan @@ -903,17 +813,7 @@ adventures: {else} 'Harganya $5,50' {print} 'Selamat berenang!' ``` - start_code: | - {print} Selamat datang di Kolam Renang Hedy! - kelas {is} {ask} 'Apakah Anda di sini untuk bergabung dengan kelas hari ini?' - {if} kelas ya - {print} 'Bagus! Anda bergabung dengan kelas!' - {print} {else} 'Anda tidak akan bergabung dengan kelas' - discount {is} {ask} 'Apakah Anda punya kode diskon?' - {if} diskon {is} ya - discount_answer {is} {ask} 'Apa kode diskon Anda?' - discount_codes = Senior4231, Student8786, NewMember6709 - {if} discount_answer {is} {in} kode_diskon + {print} 'Harganya $3,50' {else} 'Kode itu tidak valid' {else} 'Harganya $5,50' @@ -939,19 +839,7 @@ adventures: jumlah_produk = '{ask} Berapa banyak ' produk_terpilih ' yang ingin Anda beli?' total = harga + jumlah_produk {print} 'Totalnya akan menjadi $' harga 'silakan' - start_code: | - {print} 'Mesin penjual otomatis' - chosen_product = {ask} 'Silakan pilih produk' - produk_1_dolar = coke, jus jeruk, air - produk_2_dolar = cokelat, kue, bar museli - produk3_dolar = kentang goreng, dendeng sapi, roti pisang - {if} chosen {in} produk_1_dolar - harga = 1 - {if} chosen_product {is} produk_2_dolar - harga = 2 - {if} chosen_product {in} produk_3_dolar - harga = 3 - jumlah_produk = '{ask} Berapa banyak ' chosen_product ' yang ingin Anda beli?' + total = harga + jumlah_produk {print} 'Totalnya $' harga 'silakan' 7: @@ -967,11 +855,6 @@ adventures: Lonceng pagi berbunyi! Ding, dang, dong! ``` - start_code: | - Apa kau tidur? - Bang John! - Lonceng pagi berbunyi! - Ding, dang, dong! 8: story_text: |- ### Latihan @@ -996,10 +879,7 @@ adventures: {sleep} 5 {print} 'Semua selesai! Harganya $' harga ' tolong!' {print} 'Terima kasih! Selamat tinggal!' - start_code: | - {print} 'Selamat Datang di Manikur dan Pedikur oleh Hedy' - bagian tubuh = {ask} 'Apakah kuku jari tangan atau kaki Anda sudah selesai hari ini? Atau keduanya?' - {if} bagian tubuh {is} keduanya + {print} Harganya $25' harga = 25 {else} @@ -1036,19 +916,7 @@ adventures: harga = jumlah * 6 {print} 'Tolong, itu 'harga dolar'' ``` - start_code: | - {print} 'Selamat datang di toko sandwich kami' - jumlah 'Berapa banyak sandwich yang ingin Anda beli?' - {repeat} jumlah {times} - {ask} {is} {ask} 'Anda ingin sandwich jenis apa atau roti apa?' - jenis_roti {is} putih, gandum, gandum hitam, bawang putih, bebas gluten - {if} roti_dipilih dalam jenis_roti_roti - {print} 'Indah sekali!' - {else} - 'Maaf kami tidak menjualnya' - topping {is} {ask} 'Topping apa yang kamu mau?' - saus {is} {ask} 'Saus apa yang kamu mau?' - {print} Satu roti_pilihan dengan topping dan saus. + harga = jumlah * 6 {print} 'Tolong, itu 'harga dolar'' 10: @@ -1107,22 +975,6 @@ adventures: untuk i dalam rentang 1 hingga hari cetak bulan i ``` - start_code: | - print 'Kalender Hedy' - bulan_dengan_31 hari = Januari, Maret, Mei, Juli, September, Oktober, Desember - bulan_dengan_30_hari = April, Juni, Agustus, November - bulan = tanya 'Bulan apa yang ingin Anda lihat?' - jika bulan dalam bulan_dengan_31_hari - hari = 31 - jika bulan dalam bulan_dengan30_hari - hari = 30 - jika bulan = Februari - tahun_kabisat = 2020, 2024, 2028, 2036, 2040, 2044, 2028 - tahun = tanya 'Tahun berapa sekarang?' - jika tahun dalam tahun_kabisat - hari = 29 - kalau tidak - hari = 28 print 'Inilah hari-hari' ngengat untuk i dalam rentang 1 hingga hari @@ -1155,27 +1007,6 @@ adventures: untuk saya dalam rentang 0 hingga orang hubungi salam_pelanggan ``` - 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 @@ -1208,31 +1039,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1262,9 +1068,7 @@ adventures: 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?' @@ -1321,36 +1125,6 @@ adventures: 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 @@ -1496,7 +1270,6 @@ adventures: 1: story_text: "Pada level 1 kamu dapat menggunakan perintah `{print}`, `{ask}` dan `{echo}`.\nTulis kodingan kamu di bagian tampilan kode. Atau tekan tombol hijau di contoh kode, dan kode akan dituliskan sendiri!\nCoba jalankan kodenya dengan menekan tombol 'Run code' di bawah tampilan kode.\n\ \nAnda dapat print text di tampilan dengan menggunakan perintah `{print}` . \n" - start_code: '{print} hallo dunia!' 2: story_text: "Pada level 2 kita akan belajar perintah baru yaitu: `{is}` dan `{sleep}`.\nKamu bisa menamakan kata dengan `{is}`. Ini disebut dengan variabel. Dalam contoh variabel yang kami buat, variabel nama dan variabel umur. Kamu bisa gunakan kata nama dimana saja dalam kode kamu dan\ \ mengganti kata Hedy, seperti ini \n\nDisini kamu tidak perlu lagi menggunakan perintah `{echo}`\n" @@ -1508,7 +1281,6 @@ adventures: ``` story_text_2: | `{print}` masih berfungsi sama, tetapi perintah `{ask}` telah berubah. Kamu juga perlu menggunakan variabel dalam perintah `{ask}`. Maka akan terlihat seperti ini: - start_code: print halo dunia! 3: story_text: |- Pada level 3 kamu juga dapat membuat list. Kamu dapat meminta komputer memilih sesuatu secara acak dari list tersebut. Kamu dapat melakukan itu dengan `at random`. @@ -1519,7 +1291,6 @@ adventures: ``` Kamu bisa menemukan semua kode contoh level 3 pada bagian kiri. Ada juga diberikan latihan pada tab-tab diatas. - start_code: '{print} halo dunia!' 4: story_text: | Pada level 4 `{ask}` dan `{print}` sudah diubah. @@ -1535,7 +1306,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' print 'We need to use ' answer ``` - start_code: '{print} ''Halo dunia''' 5: story_text: "Perintah `ask` dan `print` tetap sama seperti pada level 4.\n \nPada level 5, ada hal baru, `if`! Dengan `if` kamu bisa memilih antara dua pilihan.\n\n```\nnama is ask 'siapa nama kamu?'\nif nama is Hedy print 'keren' else print 'boo'\n```\n\nKode ini menampilkan keren jika\ \ kamu memasukkan Hedy sebagai nama, dan boo jika kamu memasukkan yang lain.\n\nTerkadang kode dengan `if` bisa menjadi sangat panjang dan tidak cukup menggunakan satu baris
\nKamu dapat memisah kodenya menjadi dua baris; baris kedua dimulai dengan `else` seperti ini:\n```\nnama\ @@ -1544,9 +1314,6 @@ adventures: ``` password {is} {ask} 'Apa kata sandi yang benar?' ``` - start_code: |- - nama is ask 'siapa nama kamu?' - if nama is Hedy print 'keren' else print 'boo' 6: story_text: |- `ask`, `print`, dan `if` berfungsi sama persis dengan yang ada pada level 4 dan level 5. @@ -1583,7 +1350,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: repeat 3 times print 'Hedy itu menyenangkan!' 8: story_text: "`ask` dan `print` tetap berfungsi sama seperti sebelumnya. Tapi `if` dan `repeat` berubah. \nKamu sekarang dapat mengeksekusi kumpulan kode secara bersamaan, tapi kamu harus memberikan indentasi pada kode tersebut.\n Indentasi berarti memberikan empat spasi diawal baris. Ini\ \ juga berlaku ketika kamu hanya mau mengeksekusi satu baris kode saja.\n\n```\nrepeat 5 times\n print 'halo semua'\n print 'Ini akan ditampilkan lima kali'\n```" @@ -1605,10 +1371,6 @@ adventures: {print} 'PENGACAU!' {print} 'Kamu tidak bisa menggunakan komputer ini!' ``` - start_code: |- - repeat 5 times - print 'Halo semua' - print 'Ini akan ditampilkan lima kali' 9: story_text: |- Pada level ini kamu tidak hanya bisa menggunakan beberapa baris baru untuk `if` and `repeat`, namun juga dapat menggabungkan mereka! @@ -1632,13 +1394,6 @@ adventures: else {print} 'pizza is better' ``` - start_code: |- - {repeat} 3 {times} - makanan = {ask} 'Apa yang kamu inginkan?' - {if} makanan {is} pizza - {print} 'Bagus!' - {else} - {print} 'pizza lebih enak' 10: story_text: | Pada level ini kita akan belajar perintah `for`. Dengan `for` kamu dapat membuat sebuah daftar dan mengakses semua isinya. @@ -1655,17 +1410,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - hewanhewan is anjing, kucing, ikan - for hewan in hewanhewan - print 'Aku suka ' hewan 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: |- - for pembilang in range 1 to 5 - print pembilang 12: story_text: |- **Angka Desimal** @@ -1692,11 +1440,6 @@ adventures: 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!' 14: story_text: 'Kita akan mulai belajar untuk menggunakan banyak hal baru! Kamu mungkin sudah tahu hal-hal ini dari matematika: simbol `<` dan `>`. Simbol `<` mengecek apakah angka pertama lebih kecil daripada angka kedua, seperti `4 < 5`. Simbol `>` mengecek apakah angka pertama lebih besar daripada angka kedua, seperti `6 > 5`.' @@ -1706,8 +1449,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - umur = ask 'Berapa umur mu?' + if umur < 13 print 'Kamu lebih muda daripada aku!' else @@ -1722,11 +1464,6 @@ adventures: answer = ask 'What is 5 times 5?' print 'A correct answer has been given' ``` - start_code: |- - jawaban = 0 - while jawaban != 25 - jawaban = ask 'Apa hasil 5 kali 5?' - print 'Sebuah jawaban benar telah diberikan' 16: story_text: Kita akan menggunakan kurung siku untuk membungkus nilai-nilai didalam list! Kita juga akan membutuhkan tanda kutip satu (') untuk membungkus setiap nilai didalam list. example_code: | @@ -1750,9 +1487,8 @@ adventures: print i print 'Siap atau tidak, aku datang!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dadu @@ -1783,12 +1519,10 @@ adventures: ``` choices {is} _ ``` - start_code: print Apakah yang akan dihasilkan dari lemparan dadu kali ini? 4: story_text: |- Pada level 3 kita dapat membuat kalimat-kalimat dengan nilai dadu didalamnya, menggunakan tanda kutip satu tentunya. Kali ini kode contoh belum sempurna. Dapatkah kamu menyempurnakannya? - start_code: print 'Apakah yang akan dihasilkan dari lemparan dadu kali ini?' 5: story_text: |- Kamu juga dapat membuat dadu di level 4 dengan menggunakan `if` @@ -1803,7 +1537,6 @@ adventures: print 'kamu memiliki' _ 'lemparan' if _ is cacing print 'Kamu dapat berhenti melempar.' _ print 'Kamu harus mendengarnya sekali lagi!' ``` - start_code: print 'Apakah yang akan dihasilkan dari lemparan dadu kali ini?' 6: story_text: | Anda juga dapat membuat Cacing Tanah mati lagi di sini, tetapi sekarang Anda juga dapat menghitung berapa banyak poin yang telah diperoleh. @@ -1826,7 +1559,6 @@ adventures: Apakah kamu berhasil menghitung poin dari lemparan dadu 8 kali? Ini memerlukan banyak salinan kode, betul? Kita akan membuatnya lebih mudah pada level 7! example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: print 'Apakah yang akan dihasilkan dari lemparan dadu kali ini?' 7: story_text: |- Kamu juga dapat membuat dadu kembali di level 5. Dengan `repeat` kamu dapat dengan mudah melempar dadu beberapa kali. @@ -1838,7 +1570,6 @@ adventures: pilihan is 1, 2, 3, 4, 5, cacing repeat _ _ print _ _ _ ``` - start_code: print 'Apakah yang akan dihasilkan dari lemparan dadu kali ini?' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1850,7 +1581,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1875,7 +1605,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Cuci piring? default_save_name: Piring @@ -1895,7 +1624,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: print Siapa yang mencuci piring? 4: story_text: |- Dengan kutip satu, kamu dapat membuat rencana cuci piring kamu lebih cantik. @@ -1910,7 +1638,6 @@ adventures: print _ cuci piring akan dilakukan oleh _ print orang at _ ``` - start_code: print 'Siapa yang mencuci piring?' 5: story_text: "Dengan `if` kamu bisa melakukan banyak hal menyenangkan dalam pengambilan pilihan dalam program tersebut. Kamu dapat membuat program kamu merespon pilihan yang sudah diberikan oleh komputer.\n\nDapatkah kamu melengkapi kode ini agar menampilkan 'Yahh' ketika yang dipilih adalah\ \ giliranmu dan 'Yeah!' untuk yang lainnya. \nJangan lupakan tanda kutip satu!" @@ -1920,7 +1647,6 @@ adventures: pencucipirng is orang at random if pencucipiring is Sophie print _ Yahh aku harus mencuci piring _ else print 'untungnya tidak ada piring yang perlu dicuci karena' _ 'sudah mencucinya' ``` - start_code: print 'Siapa yang mencuci piring?' 6: story_text: Dengan `repeat`, kamu dapat mengulang bagian-bagian kode. Kamu dapat melakukan ini untuk menentukan siapa yang akan mencuci piring selama seminggu kedepan. example_code: | @@ -1945,7 +1671,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: print 'Siapa yang mencuci piring?' 7: story_text: Seberapa sering semua orang mencuci piring? Apakah adil? Kamu harus menghitungnya di level 6. example_code: | @@ -1960,7 +1685,6 @@ adventures: Sekarang kamu dapat menyalin baris 3 ke 5 beberapa kali (misal 7 kali untuk seminggu penuh) untuk menghitung jumlah jatah cuci piring selama seminggu. Apakah kamu mau membuat kodenya untuk seminggu penuh? - start_code: print 'Siapa yang mencuci piring?' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1971,7 +1695,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -2019,10 +1742,6 @@ adventures: {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: |- 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. @@ -2034,10 +1753,6 @@ adventures: {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: 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. @@ -2071,7 +1786,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: print Halo, aku Hedy sang peramal! 3: story_text: |- Pada level 1 kamu telah membuat mesin peramal pertama kamu, tapi Hedy tidak bisa benar-benar meramal, hanya mengulang. @@ -2090,7 +1804,6 @@ adventures: story_text_2: | ### Exercises Now, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or '{ask} again'. - start_code: print Halo aku Hedy sang peramal! 4: story_text: |- Level 3 tidak menambahkan fitur baru, namun memungkinkan kamu untuk berlatih menggunakan kutip satu. Kamu dapat membuat ulang kode level 2, dan memastikan untuk menggunakan kutip satu di tempat yang benar! @@ -2107,7 +1820,6 @@ adventures: jawaban is ya, tidak, mungkin print 'Bola kristal ku menyatakan.. ' jawaban at random ``` - start_code: print 'Halo, aku Hedy sang peramal!' 5: story_text: |- Pada level 4 kamu akan belajar untuk membuat kemungkinan jawabannya sesuai dengan keinginanmu, ketika menggunakan jasa sang peramal! @@ -2120,7 +1832,6 @@ adventures: orang is ask 'Siapa kamu?' if orang is Hedy print 'Kamu pasti menang!' else print 'Nasib buruk! Orang lain yang akan menang!' ``` - start_code: print 'Halo, aku Hedy sang peramal!' 6: story_text: |- Pada level 5 kamu dapat menggunakan matematika dalam ramalan sang peramal. Ini mengijinkan kamu untuk membuat formula (yang mungkin lucu) untuk meramal masa depan. @@ -2150,14 +1861,12 @@ adventures: hasil is hasil * sepakbola print 'Kamu ' hasil ' persen pintar.' ``` - start_code: print 'Halo, aku Hedy sang peramal!' 7: story_text: Pada level 6 kamu dapat menggunakan perintah `repeat` untuk membuat mesin kamu meramal beberapa kali example_code: "```\nprint 'Aku Hedy sang peramal!'\nprint 'Kamu dapat bertanya 3 pertanyaan!'\nrepeat 3 times pertanyaan is ask 'Apa yang ingin kamu tahu?'\njawaban {is} ya, tidak, mungkin\nrepeat 3 times print 'Bola kristal saya mengatakan... 'jawaban {at} {random}\n```\n\nSeperti yang\ \ kamu lihat, pertanyaan-pertanyaan yang diberikan tidak ditampilkan pada contoh. Ini karena variabel 'pertanyaan' telah diulang tiga kali.\nSetiap kali pemain memberikan pertanyaan baru, Hedy menimpa pertanyaan sebelumnya. \nArtinya kamu tidak bisa menanyakan dengan cara seperti ini.\n\ \nDengan menggunakan tiga variabel (misal 'pertanyaan1', 'pertanyaan2' dan 'pertanyaan3') kamu dapat memecahkan masalah ini dan menampilkan semua pertanyaan.\nIni berarti kamu hanya dapat menggunakan perintah `repeat` untuk jawaban. Kamu harus menanyakan dan menampilkan semua pertanyaan\ \ secara terpisah.\nDapatkah kamu melakukannya?\n\nPada level 7 tampilan perintah `repeat` akan berubah, memungkinkan kamu untuk mengulang beberapa baris sekaligus.\n" - start_code: print 'Halo, aku Hedy sang peramal!' 8: story_text: |- Pada level 5 kamu telah belajar bagaimana menggunakan perintah `repeat` untuk membuat sang peramal menjawab tiga pertanyaan sekaligus, namun kita masih tidak bisa menampilkan pertanyaan-pertanyaannya sekaligus. @@ -2173,7 +1882,6 @@ adventures: {print} pertanyaan {print} 'Bola kristal saya menyatakan...' jawaban {at} {random} ``` - start_code: print 'Halo, aku Hedy sang peramal!' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2189,7 +1897,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2201,7 +1908,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2241,21 +1947,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2284,13 +1975,6 @@ adventures: {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. @@ -2314,17 +1998,6 @@ adventures: 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 @@ -2353,7 +2026,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2375,7 +2047,6 @@ adventures: _ {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: Rumah berhantu default_save_name: rumahhantu @@ -2393,7 +2064,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - start_code: print Kenapa aku ada disini? 2: story_text: | In this haunted house you can choose your monsters with emojis. Of course you could also use words. @@ -2451,7 +2121,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: print Kenapa aku ada disini? 4: story_text: |- Pada level 3 kamu belajar bagaimana menggunakan tanda kutip satu di permainan kamu. @@ -2467,7 +2136,6 @@ adventures: {sleep} {print} monsters {at} {random} ``` - start_code: print 'Kenapa aku ada disini?' 5: story_text: |- Sampai pada level ini permainan rumah berhantu kamu pasti menanyakan ke pemain tentang pintu mana yang akan dipilih, namun seperti yang mungkin kamu sadari, mereka tidak harus menjawab dengan benar. @@ -2485,7 +2153,6 @@ adventures: if pintuterpilih is pintutepat print 'Bagus! Kamu berhasil kabur!' else print 'Oh tidak! Kamu dimakan oleh ... ' monster {at} {random} ``` - start_code: print 'Kenapa aku ada disini?' 9: story_text: Pada level 7 kamu bisa mengulangi beberapa baris kode, memungkinkan kamu untuk membuat permainan rumah berhantu kamu semakin interaktif. example_code: | @@ -2512,7 +2179,6 @@ adventures: Sekarang permainan ini jadi cukup sulit untuk dimenangkan. Dapatkah kamu membuat permainan ini lebih mudah? Sebagai contoh dengan hanya memiliki 1 pintu yang salah dan 2 pintu benar ketimbang 2 pintu salah dan 1 pintu benar? - start_code: print 'Kabur dari rumah berhantu!' 11: story_text: Pada level 8 kita telah mengubah perintah `repeat` dan menambahkan beberapa baris ke kode permainan rumah berhantu kita, yang menginformasikan ke pemain lokasi ruangan mereka. example_code: | @@ -2537,7 +2203,6 @@ adventures: if pemain is hidup print 'Bagus! Kamu berhasil bertahan hidup!' ``` - start_code: print 'Kabur dari rumah berhantu!' 14: story_text: | ### Exercise @@ -2566,7 +2231,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2600,7 +2264,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2631,18 +2294,7 @@ adventures: {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?' @@ -2681,10 +2333,6 @@ adventures: _ _ _ 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... @@ -2701,11 +2349,6 @@ adventures: {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. @@ -2721,16 +2364,6 @@ adventures: {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 @@ -2759,11 +2392,6 @@ adventures: _ 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 @@ -2789,10 +2417,6 @@ adventures: 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: @@ -2801,8 +2425,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2834,8 +2457,7 @@ adventures: {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} @@ -2868,7 +2490,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2889,7 +2510,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2929,8 +2549,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2956,7 +2575,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2973,7 +2591,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2986,7 +2603,6 @@ adventures: {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}`. @@ -3000,7 +2616,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -3016,7 +2631,6 @@ adventures: _ kata_kata {is} kata_baru _ '🧒 Kerja bagus, Hedy! 🍪' _ _ '🧒 Tidak, Hedy! Ucapkan 'kata_baru ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3035,7 +2649,6 @@ adventures: to_save = price - saved weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3059,7 +2672,6 @@ adventures: {call} _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3088,7 +2700,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3101,7 +2712,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3121,7 +2731,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3147,8 +2756,6 @@ adventures: ``` _ 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. @@ -3165,8 +2772,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3198,7 +2804,6 @@ adventures: {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 @@ -3228,10 +2833,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3266,10 +2867,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3303,9 +2900,6 @@ adventures: 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. @@ -3354,11 +2948,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3372,10 +2961,6 @@ adventures: {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! @@ -3390,13 +2975,6 @@ adventures: {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 @@ -3422,10 +3000,6 @@ adventures: 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? @@ -3443,11 +3017,6 @@ adventures: _ {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: Rumah makan default_save_name: rumahmakan @@ -3468,7 +3037,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - start_code: print Selamat datang di rumah makan Hedy 2: story_text: |- Pada level 2 kamu bisa mengembangkan kode rumah makan kamu dengan menggunakan variabel. Pada level 1 Hedy hanya dapat mengulang pesanan dan hanya mengingat pesanan terakhir. @@ -3488,7 +3056,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: print Selamat datang di rumah makan Hedy 3: story_text: |- Punya masalah untuk menentukan apa yang akan kamu makan untuk malam? Kamu dapat meminta Hedy untuk memilihkannya untukmu! @@ -3522,7 +3089,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: print Selamat datang di rumah makan Hedy 4: story_text: |- Pada level 3 kamu harus memakai tanda kutip satu ketika menggunakan perintah `print`. @@ -3541,7 +3107,6 @@ adventures: print 'Terima kasih atas pesanannya.' print makanan ' dan ' minuman ' kamu akan segera tersedia!' ``` - start_code: print 'Selamat datang di rumah makan Hedy' 5: story_text: |- Pada level 4 perintah `if` memungkinkan kamu untuk menanyakan pertanyaan ke pembeli dan memberi respon yang berbeda bergantung pada jawaban yang diberikan. @@ -3564,7 +3129,6 @@ adventures: ``` Dapatkah kamu memikirkan pertanyaan-pertanyaan lain untuk pembeli ketika mereka memesan makanan, dan membuat respon yang bervariasi bergantung dari jawaban mereka? - start_code: print 'Selamat datang di rumah makan Hedy' 6: story_text: Pada level 5 kamu dapat menggunakan matematika untuk menghitung total harga dari pesanan pembeli. Ini dapat membuat rumah makan virtual kamu semakin realistis. example_code: | @@ -3582,7 +3146,6 @@ adventures: print 'Itu akan seharga ' harga ' rupiah' print 'Terima kasih, selamat menikmati!' ``` - start_code: print 'Selamat datang di rumah makan Hedy' 7: story_text: |- Pada level 5 kamu telah belajar bagaimana menggunakan perintah `repeat` untuk mengulang satu baris kode beberapa kali. @@ -3604,7 +3167,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - start_code: print 'Selamat datang di rumah makan Hedy' 8: story_text: | In this level you can make your virtual restaurant more elaborate by repeating multiple lines of code. Like this: @@ -3625,7 +3187,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add as many options as you like! - start_code: '# place your code here' 9: story_text: |- Pada level 7 kamu bisa membuat rumah makan virtual kamu lebih detil dengan mengulang beberapa baris kode. Seperti ini: @@ -3671,7 +3232,6 @@ adventures: {print} 'Itu akan menjadi ' harga ' dolar' {print} 'Selamat menikmati makananmu!' ``` - start_code: print 'Selamat datang di rumah makan Hedy' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3719,7 +3279,6 @@ adventures: harga is 40000 * orang print 'Harganya akan menjadi ' harga ' rupiah!' ``` - start_code: print 'Selamat datang di rumah makan Hedy' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3738,7 +3297,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3753,7 +3311,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3770,7 +3327,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Batu, gunting, kertas default_save_name: Batu @@ -3792,7 +3348,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: print Selamat datang di permainan batu guning kertas mu sendiri! 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! @@ -3801,7 +3356,6 @@ adventures: choice {is} _ {print} I choose choice ``` - start_code: '# place your code here' 3: story_text: | Kamu bisa menggunakan `{at} {random}` perintah untuk membiarkan komputer mengambil batu, kertas atau gunting! @@ -3826,18 +3380,15 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: print Selamat datang di permainan batu guning kertas mu sendiri! 4: story_text: |- Pada level 3 kamu bisa memprogram permainan batu gunting kertas dengan lebih komprehensif. Tapi jika kamu mau menambahkan teks, kamu harus menggunakan tanda kutip satu disini. Apakah kamu bisa melengkapi kode berikut dengan memasukkan perintah atau karakter yang benar sebagai pengganti garis bawah? - start_code: print 'Selamat datang di permainan batu guning kertas mu sendiri!' 5: story_text: "Pada level 4 kamu bisa menentukan siapa yang menang. \nUntuk hal itu, kamu memerlukan perintah `if`\n\nSimpan pilihan kamu dengan sebuah nama favoritmu dan pilihan komputer dengan nama pilihan komputer.\nLalu kamu bisa menggunakan `if` untuk melihat apakah kedua pilihan tersebut\ \ sama atau berbeda.\nDapatkah kamu menyelesaikan kode ini?" example_code: "```\npilihan is batu, gunting, kertas\npil_komputer is _\n pil_kamu is ask Apa yang kamu pilih?\nprint 'kamu memilih ' _\nprint 'komputer memilih ' _\nif _ is _ print 'seri' else print 'tidak seri'\nif pil_kamu is batu and pil_komputer is kertas print 'komputer menang'\n\ ```\n\nPertama-tama, kamu perlu mengisi kotak kosong yang tersedia dengan kode yang benar untuk melihat apakah hasil permainan seri. \n" - start_code: print 'Selamat datang di permainan batu guning kertas mu sendiri!' 9: story_text: | In this level you can program the whole rock, paper, scissors game by nesting the {if}-commands. Can you finish the code? @@ -3857,7 +3408,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3868,7 +3418,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3886,7 +3435,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3907,7 +3455,6 @@ adventures: {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 @@ -3924,7 +3471,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3948,7 +3494,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3961,7 +3506,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3977,10 +3521,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Nyanyikan sebuah lagu! default_save_name: Lagu @@ -4016,7 +3556,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: print 'Baby Shark' 7: story_text: Lagu-lagu sering memiliki banyak pengulangan. Terkadang pengulangannya didasarkan dari perhitungan. Misal, di sebuah lagu 'Botol'. Kamu dapat membuat program untuk menyanyikan lagu tersebut dengan sedikit matematika. example_code: | @@ -4037,7 +3576,6 @@ adventures: ` repeat 3 times print 'Baby Shark Tutududududu` Tapi kamu akan lihat pada materi ini, terkadang kamu perlu untuk mengulang beberapa baris bersamaan. Ini bisa dilakukan dengan menyalin ulang, namun itu merepotkan. Pada level 7 kamu akan belajar bagaimana cara melakukannya dengan lebih mudah. - start_code: print 'Baby shark' 8: story_text: Pada level 6, kamu menuliskan lagu 'botol'. Kamu membuat sebuah reff lalu mengulangnya hingga 99 kali. Pada level 7, kamu dapat melakukannya hanya dengan menambahkan satu baris program. example_code: | @@ -4050,7 +3588,6 @@ adventures: reff is reff - 1 print reff ' botol di dinding' ``` - start_code: print 'Baby shark' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4071,7 +3608,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4086,7 +3622,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4101,7 +3636,6 @@ adventures: {print} '{if} youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4118,16 +3652,6 @@ adventures: {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: | Di level ini, Anda dapat memprogram lagu seperti OldMacDonald dengan lebih cepat. Anda dapat menghubungkan hewan yang tepat dengan suara yang tepat hanya dengan menempatkannya di tempat yang sama dalam daftar. @@ -4163,7 +3687,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4185,7 +3708,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4207,15 +3729,6 @@ adventures: {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 @@ -4284,7 +3797,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4347,7 +3859,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4409,7 +3920,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4496,7 +4006,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Kura-kura default_save_name: kurakura @@ -4517,9 +4026,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - forward 50 - turn left 2: story_text: |- Pada level 1 sang kura-kura hanya bisa menghadap kiri dan kanan. Itu cukup membosankan! @@ -4595,11 +4101,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Menggambar bentuk' - sudut {is} 90 - {turn} sudut - {forward} 25 5: story_text: 'Pada level 4 kita akan mengambil sebuah pilihan dengan `if`. Sebagai contoh: mengambil satu dari kumpulan bentuk.' example_code: | @@ -4629,12 +4130,6 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: |- - {print} 'Menggambar Bentuk' - bentuk {is} {ask} 'Apakah Anda ingin persegi atau segitiga?' - {if} bentuk {is} segitiga sudut {is} 120 {else} sudut {is} 90 - {turn} sudut - {forward} 25 6: story_text: |- Pada level 6 kamu dapat menggunakan perhitungan untuk menggambar bentuk-bentuk yang berbeda. @@ -4658,7 +4153,6 @@ adventures: forward 50 turn sudut ``` - start_code: print 'Menggambar bentuk' 8: story_text: |- Sekarang karena kita sudah bisa mengulang beberapa baris, kita bisa menggambar bentuk dengan lebih mudah. @@ -4692,7 +4186,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4710,7 +4203,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4735,16 +4227,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4760,7 +4242,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4771,7 +4252,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4782,7 +4262,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4800,7 +4279,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4819,7 +4297,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4839,7 +4316,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4850,7 +4326,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4863,7 +4338,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4894,7 +4368,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4935,7 +4408,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4958,7 +4430,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4987,7 +4458,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5011,7 +4481,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5039,7 +4508,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5073,7 +4541,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5093,11 +4560,6 @@ adventures: 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 @@ -5115,4 +4577,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/it.yaml b/content/adventures/it.yaml index b6ba282d10f..428b5b70731 100644 --- a/content/adventures/it.yaml +++ b/content/adventures/it.yaml @@ -27,7 +27,6 @@ adventures: Utilizza almeno un comando `{ask}` e un comando `{echo}`. Puoi farlo su qualsiasi argomento che ti piace. Se non riesci a pensare a un argomento, usa una delle nostre scelte: andare al cinema, una partita sportiva o una giornata allo zoo. - start_code: '{print} La tua storia inizia qui' 2: story_text: | Nel livello 2 puoi rendere la tua storia più divertente. Il nome del tuo personaggio principale ora può essere ovunque nella frase. @@ -53,7 +52,6 @@ adventures: Modifica i comandi `{ask}` e `{echo}` nel tuo codice nella forma corretta che hai imparato in questo livello. **Extra** Aggiungi un comando `{sleep}` al tuo codice per aumentare la tensione nella tua storia. - start_code: '{print} La tua storia' 3: story_text: | Nel livello 3 puoi rendere la tua storia più divertente. Puoi usare la casualità per qualsiasi mostro, animale o ostacolo, in questo modo: @@ -87,7 +85,6 @@ adventures: dump {is} {ask} Which item should he dump? {remove} dump {from} bag ``` - start_code: '{print} La tua storia' 4: story_text: | Potresti aver notato che c'è ancora un problema nei livelli precedenti. Hai provato a stampare una frase che conteneva la parola nome? cioè `{print}` il mio nome è nome. @@ -112,7 +109,6 @@ adventures: {print} _ Sente il suono di _ animali {at} {random} {print} nome _ ha paura che questa sia una foresta infestata _ ``` - start_code: '{print} ''La tua storia verrà stampata qui!''' 5: story_text: | In questo livello puoi programmare diversi finali, che renderanno la tua storia ancora più divertente. @@ -138,7 +134,6 @@ adventures: {if} fine {is} lieto {print} nome 'prende la spada e il mostro scappa velocemente' {else} {print} 'Il mostro mangia' nome ``` - start_code: '{print} ''La tua storia inizia qui!''' 7: story_text: | In una storia, qualcuno dice le parole più volte. Ad esempio, quando qualcuno chiede aiuto o canta una canzone. @@ -153,7 +148,6 @@ adventures: {repeat} 5 {times} {print} 'Help!' {print} 'Why is nobody helping me?' ``` - start_code: '{repeat} 5 {times} {print} ''Help!''' 8: story_text: | In questo livello puoi utilizzare più righe nei comandi `{if}`, in questo modo puoi migliorare il tuo lieto fine o il tuo triste finale! @@ -176,7 +170,6 @@ adventures: {print} 'Oh no! Richard è troppo lento...' {print}_ ``` - start_code: '# scrivi il tuo codice qui' 9: story_text: | In questo livello puoi utilizzare i comandi `{if}` e `{repeat}` all'interno di altri comandi `{if}` e `{repeat}`. @@ -205,7 +198,6 @@ adventures: {else} {print} 'Robin va a casa' ``` - start_code: '# scrivi il tuo codice qui' 10: story_text: | In questo livello puoi usare il comando {for} nella tua storia. In questo modo potrete facilmente programmare il libro per bambini 'Orso bruno, Orso bruno, cosa vedi'. @@ -219,7 +211,6 @@ adventures: {print} 'Orso bruno, orso bruno' {print} 'Cosa vedi?' ``` - start_code: '# scrivi il tuo codice qui' 12: story_text: |- In questo livello saranno necessarie le virgolette per salvare più parole in una variabile. @@ -232,7 +223,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# scrivi il tuo codice qui' 13: story_text: | Utilizzando i comandi `{and}` e `{or}` puoi rendere le tue storie più versatili. Puoi porre due domande e rispondere alla combinazione di risposte. @@ -251,7 +241,6 @@ adventures: {if} percorso {is} 'sinistra' {and} arma {is} 'spada' _ ``` - start_code: '# scrivi il tuo codice qui' 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. @@ -274,7 +263,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# scrivi il tuo codice qui' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -295,7 +283,6 @@ adventures: naam = {input}("Come ti chiami?") {print}('Benvenuti in questa storia!') ``` - start_code: '# inserisci qui il tuo codice' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: aggiungi_rimuovi_comando @@ -335,13 +322,6 @@ adventures: _ {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: e o @@ -359,11 +339,6 @@ adventures: {if} nome {is} 'Hedy' {and} età {is} 2 {print} 'Tu sei la vera 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 @@ -396,10 +371,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## Il comando chiedi @@ -427,11 +398,6 @@ adventures: favorite_animals {is} {ask} Qual è il tuo animale preferito? {print} Mi piacciono gli animali_preferiti ``` - start_code: |- - nome {is} {ask} Come ti chiami? - {print} Ciao nome - età {is} {ask} Quanti anni hai? - {print} Il nome di ha anni. 18: story_text: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -543,7 +509,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# scrivi il tuo codice qui' calculator: name: Calculator default_save_name: Calcolatrice @@ -609,7 +574,6 @@ adventures: punteggio = punteggio + 1 {print} 'Ottimo lavoro! Il tuo punteggio è... 'punteggio' su 10!' ``` - start_code: '{print} ''Benvenuti in questa calcolatrice!''' 10: story_text: | Questo gioco di calcolatrice ti aiuta a praticare le tue tabelline! @@ -627,7 +591,6 @@ adventures: {else} {print} 'Questo è sbagliato. La risposta giusta è ' corretto ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -643,10 +606,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: | - numero = 10 - {for} i {in} {range} 1 {to} 10 - {print} i * numero 12: story_text: | In questo livello puoi creare una calcolatrice che funzioni con i numeri decimali. @@ -665,7 +624,6 @@ adventures: risposta = _ {print} numero1' più 'numero2' è '_ ``` - start_code: '# inserisci qui il tuo codice' 13: story_text: | ### Exercise 1 @@ -682,7 +640,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -707,11 +664,7 @@ adventures: 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 @@ -743,7 +696,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# scrivi il tuo codice qui' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -792,17 +744,6 @@ adventures: {clear} {print} 'SORPRESA' ``` - start_code: | - {print} '3' - {sleep} - {clear} - {print} '2' - {sleep} - {clear} - {print} '1' - {sleep} - {clear} - {print} 'SORPRESA' debugging: name: debugging default_save_name: debugging @@ -825,12 +766,6 @@ adventures: {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. @@ -850,14 +785,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -879,16 +806,6 @@ adventures: 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 @@ -903,13 +820,6 @@ adventures: {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 @@ -932,17 +842,7 @@ adventures: {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' @@ -969,19 +869,7 @@ adventures: 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: @@ -997,11 +885,6 @@ adventures: 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 @@ -1026,10 +909,7 @@ adventures: {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} @@ -1066,19 +946,7 @@ adventures: 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: @@ -1093,11 +961,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1137,26 +1000,6 @@ adventures: 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 @@ -1185,27 +1028,6 @@ adventures: 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 @@ -1238,31 +1060,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1292,9 +1089,7 @@ adventures: 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?' @@ -1351,36 +1146,6 @@ adventures: 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 @@ -1530,7 +1295,6 @@ adventures: Prova tu stesso il codice con il pulsante verde "Esegui codice" sotto il campo di programmazione. Puoi stampare il testo sullo schermo usando il comando `{print}`. - start_code: '{print} ciao mondo!' 2: story_text: | Nel livello 2 impariamo due nuovi comandi: `{is}` e `{sleep}`. @@ -1545,11 +1309,9 @@ adventures: ``` story_text_2: | `{print}` funziona sempre nello stesso modo, ma il comando `{ask}` è cambiato. Devi usare anche una variabile nel comando `{ask}`. In questo modo: - start_code: '{print} ciao mondo!' 3: story_text: | Nel livello 3 puoi fare una lista. Puoi lasciare che il computer scelga una cosa a caso dalla lista. Lo fai con `{at} {random}` (dici: et ren-dom). - start_code: '{print} ciao mondo!' 4: story_text: | `{print}` e `{ask}` cambiano al livello 4. @@ -1561,7 +1323,6 @@ adventures: {print} "D'ora in poi dovrai usare le virgolette" risposta {is} {ask} "Cosa dobbiamo fare d'ora in poi?" {print} 'Dobbiamo usare ' risposta - start_code: '{print} ''Ciao mondo''' 5: story_text: | Nel livello 5 c'è qualcosa di nuovo, il `{if}`! Con il `{if}` puoi scegliere tra due diverse opzioni. @@ -1572,9 +1333,6 @@ adventures: nome {is} {ask} 'come ti chiami?' {if} nome {is} Hedy {print} 'carino' {else} {print} 'meno divertente!' ``` - start_code: |- - nome {is} {ask} 'Come ti chiami?' - {if} nome {is} Hedy {print} 'che bello!' {else} {print} 'mah' 6: story_text: | In questo livello imparerai qualcosa di nuovo: ora puoi anche calcolare. @@ -1599,7 +1357,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy è divertente!' ``` - start_code: repeat 3 times print 'Hedy è divertente!' 8: story_text: | `{ask}` e `{print}` funzionano ancora come prima. Ma `{if}`, `{else}`, {pressed} e `{repeat}` sono cambiati! @@ -1623,10 +1380,6 @@ adventures: {print} 'INTRUSO!' {print} 'Non puoi usare questo computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Ciao a tutti' - {print} 'Questo sarà scritto 5 volte' 9: story_text: | In this level you can not only use multiple lines with `{if}` and `{repeat}`, but you can also put them together! @@ -1641,7 +1394,6 @@ adventures: {else} {print} 'pizza is better' ``` - start_code: '{print} Andiamo alla scheda successiva!' 10: story_text: | Stai andando alla grande! Nei livelli precedenti abbiamo ancora dovuto affrontare un piccolo problema. Hai imparato a ripetere le righe, ma cosa succederebbe se volessi modificarle leggermente? @@ -1656,17 +1408,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animali {is} cane, gatto, salmone - {for} animale {in} animali - {print} 'Mi piace il ' animale 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: |- - {for} contatore {in} {range} 1 {to} 5 - {print} contatore 12: story_text: | Forse hai provato a utilizzare i numeri decimali nella tua avventura al ristorante. Se lo hai fatto, probabilmente avrai notato che Hedy non li capiva ancora e completava sempre. @@ -1676,8 +1421,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'I numeri decimali ora hanno bisogno di essere scritti con il punto' + {print} 2.5 + 2.5 13: story_text: | @@ -1693,11 +1437,6 @@ adventures: {if} name {is} 'Hedy' {and} age {is} 2 {print} 'You are the real Hedy!' ``` - start_code: |- - nome = {ask} 'come ti chiami?' - età = {ask} 'quanti anni hai?' - {if} nome {is} 'Hedy' {and} età {is} 2 - {print} 'Sei davvero Hedy!' 14: story_text: | Ora impareremo come usare dei nuovi elementi. Potresti già conoscerli dalla matematica, il `<` e il `>`. @@ -1712,8 +1451,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1731,11 +1469,6 @@ adventures: answer = {ask} 'What is 5 times 5?' {print} 'A correct answer has been given' ``` - start_code: |- - risposta = 0 - {while} risposta != 25 - risposta = {ask} 'Quanto fa 5 per 5?' - {print} 'È stata data la risposta esatta' 16: story_text: | In questo livello progrediremo un po' di più verso il vero codice Python. Imparerai anche come abbinare due elenchi insieme. @@ -1774,8 +1507,7 @@ adventures: story_text: | Congratulazioni! Hai raggiunto l'ultimo livello di Hedy! Il codice che hai creato qui può essere copiato in ambienti Python reali come replit o PyCharm e puoi continuare ad imparare lì! Tieni presente tuttavia che Python può leggere solo comandi inglesi, quindi se hai utilizzato altre lingue, ora dovrai passare all'inglese. - start_code: |- - nome = 'Hedy' + {print}('Mi chiamo ', nome) dice: name: Dice @@ -1803,9 +1535,6 @@ adventures: ``` choices {is} _ ``` - start_code: | - scelte {is} 1, 2, 3, 4, 5, lombrico - {print} Hai lanciato _ {at} {random}! 4: story_text: | In questo livello puoi anche creare dadi. Ma questa volta puoi provarlo tu stesso, senza un codice di esempio! @@ -1813,7 +1542,6 @@ adventures: ### Esercizio Crea i tuoi dadi in questo livello. Suggerimento: se non hai idea di come realizzare i dadi. Dai un'occhiata ai tuoi dadi del livello precedente, ma non dimenticare di aggiungere le virgolette. - start_code: '{print} ''Che cosa indicherà il dado questa volta?''' 5: story_text: | Aggiungeremo i comandi `{if}` e `{else}` ai nostri dadi! @@ -1828,7 +1556,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear it again!' ``` - start_code: '{print} ''What will the die indicate this time?''' 6: story_text: | In questo modo puoi anche far morire di nuovo un lombrico, ma ora puoi anche calcolare quanti punti sono stati ottenuti. @@ -1849,7 +1576,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1861,7 +1587,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1873,7 +1598,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# scrivi il tuo codice qui' 15: story_text: | ### Exercise @@ -1898,7 +1622,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Piatti? default_save_name: Piatti @@ -1919,7 +1642,6 @@ adventures: Quindi pensa a un'attività che deve essere eseguita e lascia che sia il computer a decidere chi deve eseguirla con il comando `{at} {random}`. **Extra** Non hai voglia di lavare i piatti da solo? Hackera il programma rimuovendo il tuo nome dall'elenco con il comando `{remove}` `{from}`. - start_code: '{print} Who does the dishes?' 4: story_text: | Con le virgolette puoi migliorare ulteriormente il tuo programma di lavaggio. @@ -1934,7 +1656,6 @@ adventures: {sleep} {print} people {at} _ ``` - start_code: '{print} ''Chi lava i piatti?''' 5: story_text: | Con `{if}` ora puoi divertirti di più con la scelta nel programma. Puoi fare in modo che il tuo programma risponda alla scelta fatta dal computer. @@ -1947,7 +1668,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1980,7 +1700,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1989,7 +1708,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -2000,7 +1718,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# scrivi il tuo codice qui' elif_command: name: '{elif}' default_save_name: elif @@ -2048,10 +1765,6 @@ adventures: {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: |- In questo livello aggiungiamo una nuova forma di `{for}`. Nei livelli precedenti usavamo `{for}` con un elenco, ma possiamo anche usare `{for}` con i numeri. @@ -2064,10 +1777,6 @@ adventures: {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: 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. @@ -2106,7 +1815,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2123,7 +1831,6 @@ adventures: ``` story_text_2: | Now, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or '{ask} again'. - start_code: '# scrivi il tuo codice qui' 4: story_text: | This level has no new functions, but allows you to practice with using the quotation marks. @@ -2144,7 +1851,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# scrivi il tuo codice qui' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2157,7 +1863,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# scrivi il tuo codice qui' 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. @@ -2188,7 +1893,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# scrivi il tuo codice qui' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2200,7 +1904,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# scrivi il tuo codice qui' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2217,7 +1920,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# scrivi il tuo codice qui' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2233,7 +1935,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2245,7 +1946,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2285,21 +1985,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2328,13 +2013,6 @@ adventures: {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. @@ -2358,17 +2036,6 @@ adventures: 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 @@ -2397,7 +2064,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2419,7 +2085,6 @@ adventures: _ {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: Casa stregata default_save_name: Casa stregata @@ -2448,7 +2113,6 @@ adventures: ``` story_text_2: | Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2495,7 +2159,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# scrivi il tuo codice qui' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2511,7 +2174,6 @@ adventures: {sleep} {print} monsters {at} {random} ``` - start_code: '# scrivi il tuo codice qui' 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. @@ -2530,7 +2192,6 @@ adventures: {if} chosen_door {is} correct_door {print} 'Great! Youve escaped!' {else} {print} 'Oh no! You are being eaten by a...' monsters {at} {random} ``` - start_code: '# scrivi il tuo codice qui' 9: story_text: | In this level you can use nesting, which allows you to make the haunted house even more interactive! @@ -2558,7 +2219,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2584,7 +2244,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Scappa dalla casa stregata!''' 14: story_text: | ### Exercise @@ -2613,7 +2272,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2647,7 +2305,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2678,18 +2335,7 @@ adventures: {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?' @@ -2728,10 +2374,6 @@ adventures: _ _ _ 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... @@ -2748,11 +2390,6 @@ adventures: {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. @@ -2768,16 +2405,6 @@ adventures: {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 @@ -2806,11 +2433,6 @@ adventures: _ 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 @@ -2836,10 +2458,6 @@ adventures: 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: @@ -2848,8 +2466,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2881,8 +2498,7 @@ adventures: {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} @@ -2905,7 +2521,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2926,7 +2541,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2966,8 +2580,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Pappagallo @@ -2993,7 +2606,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Sono Hedy il pappagallo' 2: story_text: | Crea il tuo amico pappagallo che ripeterà ciò che dici! @@ -3010,7 +2622,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Sono Hedy il pappagallo!' 3: story_text: | Insegna al tuo pappagallo una nuova parola con `{add}`. @@ -3023,7 +2634,6 @@ adventures: {print} 🧒 Dii parola_nuova , Hedy! {print} 🦜 parole {at} {random} ``` - start_code: '# scrivi il tuo codice qui' 4: story_text: | In this level we have to use quotation marks with the commands `{ask}` and `{print}`. @@ -3037,7 +2647,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Premia il tuo pappagallo se ({if}) dice la parola giusta. @@ -3053,7 +2662,6 @@ adventures: _ detto_parola {is} nuova_parola _ '🧒 Ottimo lavoro, Hedy! 🍪' _ _ '🧒 No, Hedy! Pronuncia "nuova_parola". ``` - start_code: '# scrivi il tuo codice qui' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3073,7 +2681,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# scrivi il tuo codice qui' 14: story_text: | ### Exercise @@ -3097,7 +2704,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3126,7 +2732,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3139,7 +2744,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3159,7 +2763,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3185,8 +2788,6 @@ adventures: ``` _ 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. @@ -3203,8 +2804,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3236,7 +2836,6 @@ adventures: {if} points_b > points_a {print} 'You belong to the B club' ``` - start_code: '# scrivi il tuo codice qui' quotation_marks: name: '''quotation marks''' default_save_name: quotation_marks @@ -3266,10 +2865,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3304,10 +2899,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3341,9 +2932,6 @@ adventures: 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. @@ -3392,11 +2980,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3410,10 +2993,6 @@ adventures: {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! @@ -3428,13 +3007,6 @@ adventures: {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 @@ -3460,10 +3032,6 @@ adventures: 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? @@ -3481,11 +3049,6 @@ adventures: _ {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: Ristorante @@ -3504,7 +3067,6 @@ adventures: ``` story_text_2: | Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3524,7 +3086,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3556,7 +3117,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3576,7 +3136,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# scrivi il tuo codice qui' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3597,7 +3156,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3616,7 +3174,6 @@ adventures: {print} 'That will be ' price ' dollars, please' {print} 'Thank you, enjoy your meal!' ``` - start_code: '# scrivi il tuo codice qui' 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. @@ -3628,7 +3185,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3645,7 +3201,6 @@ adventures: ``` story_text_2: | Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3673,7 +3228,6 @@ adventures: {print} 'Sarà il 'prezzo' in dollari' {print} 'Buon appetito!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3709,7 +3263,6 @@ adventures: {print} 'Quindi vuoi ordinare per ' persone ' persone.' {print} "Andiamo!" ``` - start_code: '# scrivi il tuo codice qui' 12: story_text: | Da questo livello in poi puoi usare i numeri decimali per rendere il tuo menu più realistico. @@ -3728,7 +3281,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# scrivi il tuo codice qui' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3743,7 +3295,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# scrivi il tuo codice qui' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3760,7 +3311,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Sasso, carta, forbice default_save_name: Rock @@ -3788,9 +3338,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: | - {print} Benvenuto nella tua carta forbici da sasso! - {ask} Cosa sceglierai? 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! @@ -3799,7 +3346,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3821,12 +3367,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3846,7 +3390,6 @@ 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. Can you finish the code? @@ -3866,7 +3409,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3877,7 +3419,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3895,7 +3436,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3917,7 +3457,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3934,7 +3473,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3958,7 +3496,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3971,7 +3508,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3987,10 +3523,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Canta una canzone! default_save_name: Song @@ -4024,7 +3556,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -4042,7 +3573,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -4056,7 +3586,6 @@ adventures: verso = verso - 1 {print} versetto 'bottiglie di birra sul muro' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4077,7 +3606,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4092,7 +3620,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4107,7 +3634,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# scrivi il tuo codice qui' 13: 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? @@ -4124,16 +3650,6 @@ adventures: {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. @@ -4169,7 +3685,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4191,7 +3706,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4213,15 +3727,6 @@ adventures: {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: Tris default_save_name: Tic @@ -4289,7 +3794,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# scrivi il tuo codice qui' 14: 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. @@ -4352,7 +3856,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4414,7 +3917,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# scrivi il tuo codice qui' 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. @@ -4501,7 +4003,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# scrivi il tuo codice qui' turtle: name: Turtle default_save_name: Tartaruga @@ -4523,9 +4024,6 @@ adventures: {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. @@ -4549,11 +4047,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In questo livello puoi usare `{at} {random}` con la tartaruga che disegna. Una scelta casuale fa sì che la tartaruga percorra ogni volta un percorso diverso. @@ -4566,10 +4059,6 @@ adventures: {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! @@ -4596,11 +4085,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4633,12 +4117,6 @@ adventures: 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. @@ -4662,7 +4140,6 @@ adventures: {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. @@ -4705,7 +4182,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# posiziona il tuo codice qui' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4723,7 +4199,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# posiziona il tuo codice qui' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4748,16 +4223,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4773,7 +4238,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4784,7 +4248,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4795,7 +4258,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4813,7 +4275,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4832,7 +4293,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4852,7 +4312,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4863,7 +4322,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4876,7 +4334,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4907,7 +4364,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4948,7 +4404,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4971,7 +4426,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5000,7 +4454,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5024,7 +4477,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5052,7 +4504,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5086,7 +4537,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5102,11 +4552,6 @@ adventures: risposta = {ask} 'Quanto fa 5 per 5?' {print} 'La risposta é corretta' ``` - start_code: |- - risposta = 0 - {while} risposta != 25 - risposta= {ask} 'Quanto fa 5 per 5?' - {print} 'La risposta é corretta' years: name: Anno nuovo default_save_name: Conto alla rovescia per il nuovo anno @@ -5124,4 +4569,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# posiziona il tuo codice qui' diff --git a/content/adventures/ja.yaml b/content/adventures/ja.yaml index e13eda3123a..65ff0e6a3ba 100644 --- a/content/adventures/ja.yaml +++ b/content/adventures/ja.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} ここであなたの物語が始まります' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -49,7 +48,6 @@ adventures: 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: @@ -78,7 +76,6 @@ adventures: 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? @@ -93,7 +90,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -116,7 +112,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -127,7 +122,6 @@ adventures: {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! @@ -145,7 +139,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# ここにコードを入れてください' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -181,7 +173,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# ここにコードを入れてください' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +515,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -569,7 +533,6 @@ adventures: 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! @@ -586,7 +549,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -602,7 +564,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -613,7 +574,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -630,7 +590,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -655,11 +614,7 @@ adventures: 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 @@ -691,7 +646,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -740,17 +694,6 @@ adventures: 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 @@ -773,12 +716,6 @@ adventures: {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. @@ -798,14 +735,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -827,16 +756,6 @@ adventures: 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 @@ -851,13 +770,6 @@ adventures: {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 @@ -880,17 +792,7 @@ adventures: {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' @@ -917,19 +819,7 @@ adventures: 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: @@ -945,11 +835,6 @@ adventures: 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 @@ -974,10 +859,7 @@ adventures: {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} @@ -1014,19 +896,7 @@ adventures: 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: @@ -1041,11 +911,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1085,26 +950,6 @@ adventures: 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 @@ -1133,27 +978,6 @@ adventures: 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 @@ -1186,31 +1010,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1240,9 +1039,7 @@ adventures: 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?' @@ -1299,36 +1096,6 @@ adventures: 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 @@ -1497,7 +1264,6 @@ adventures: 3: story_text: | In level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`. - start_code: '{print} hello world!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1513,7 +1279,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Hello world''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1524,9 +1289,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - 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. @@ -1549,7 +1311,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}` and `{repeat}` have changed! @@ -1561,10 +1322,6 @@ adventures: {print} 'Hello everyone' {print} 'This is all repeated 5 times' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1579,13 +1336,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1596,17 +1346,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1616,8 +1359,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1629,11 +1371,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1648,8 +1385,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1668,11 +1404,6 @@ adventures: 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' 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. @@ -1702,9 +1433,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dice @@ -1732,12 +1462,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1751,7 +1479,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1769,7 +1496,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1781,7 +1507,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1793,7 +1518,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1818,7 +1542,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1836,7 +1559,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1852,7 +1574,6 @@ adventures: {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. @@ -1865,7 +1586,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1898,7 +1618,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1907,7 +1626,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1918,7 +1636,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1966,10 +1683,6 @@ adventures: {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: |- 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. @@ -1981,10 +1694,6 @@ adventures: {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: 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. @@ -2024,7 +1733,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2042,7 +1750,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2063,7 +1770,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2076,7 +1782,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2107,7 +1812,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2119,7 +1823,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2136,7 +1839,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2152,7 +1854,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2164,7 +1865,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2204,21 +1904,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2247,13 +1932,6 @@ adventures: {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. @@ -2277,17 +1955,6 @@ adventures: 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 @@ -2316,7 +1983,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2338,7 +2004,6 @@ adventures: _ {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 @@ -2368,7 +2033,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2415,7 +2079,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2431,7 +2094,6 @@ adventures: {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. @@ -2450,7 +2112,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2479,7 +2140,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2505,7 +2165,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2534,7 +2193,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2568,7 +2226,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2599,18 +2256,7 @@ adventures: {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?' @@ -2649,10 +2295,6 @@ adventures: _ _ _ 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... @@ -2669,11 +2311,6 @@ adventures: {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. @@ -2689,16 +2326,6 @@ adventures: {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 @@ -2727,11 +2354,6 @@ adventures: _ 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 @@ -2757,10 +2379,6 @@ adventures: 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: @@ -2769,8 +2387,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2802,8 +2419,7 @@ adventures: {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} @@ -2826,7 +2442,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2847,7 +2462,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2887,8 +2501,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2915,7 +2528,6 @@ adventures: {echo} {echo} ``` - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2932,7 +2544,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2945,7 +2556,6 @@ adventures: {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}`. @@ -2959,7 +2569,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -2975,7 +2584,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -2995,7 +2603,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3019,7 +2626,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3048,7 +2654,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3061,7 +2666,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3081,7 +2685,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3107,8 +2710,6 @@ adventures: ``` _ 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. @@ -3125,8 +2726,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3158,7 +2758,6 @@ adventures: {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 @@ -3188,10 +2787,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3226,10 +2821,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3263,9 +2854,6 @@ adventures: 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. @@ -3314,11 +2902,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3332,10 +2915,6 @@ adventures: {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! @@ -3350,13 +2929,6 @@ adventures: {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 @@ -3382,10 +2954,6 @@ adventures: 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? @@ -3403,11 +2971,6 @@ adventures: _ {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 @@ -3427,7 +2990,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3447,7 +3009,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3479,7 +3040,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3499,7 +3059,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3520,7 +3079,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3539,7 +3097,6 @@ adventures: {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. @@ -3551,7 +3108,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3569,7 +3125,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3597,7 +3152,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3642,7 +3196,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3661,7 +3214,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3676,7 +3228,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3693,7 +3244,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3721,7 +3271,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3730,7 +3279,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3752,12 +3300,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3777,7 +3323,6 @@ 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. Can you finish the code? @@ -3797,7 +3342,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3808,7 +3352,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3826,7 +3369,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3848,7 +3390,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3865,7 +3406,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3889,7 +3429,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3902,7 +3441,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3918,10 +3456,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3955,7 +3489,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3973,7 +3506,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3987,7 +3519,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4039,7 +3570,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4054,7 +3584,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4069,7 +3598,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4086,16 +3614,6 @@ adventures: {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. @@ -4131,7 +3649,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4153,7 +3670,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4175,15 +3691,6 @@ adventures: {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 @@ -4251,7 +3758,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4314,7 +3820,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4376,7 +3881,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4463,7 +3967,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4485,9 +3988,6 @@ adventures: {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. @@ -4511,11 +4011,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4526,10 +4021,6 @@ adventures: {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! @@ -4556,11 +4047,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4593,12 +4079,6 @@ adventures: 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. @@ -4622,7 +4102,6 @@ adventures: {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. @@ -4665,7 +4144,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4683,7 +4161,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4708,16 +4185,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4733,7 +4200,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4744,7 +4210,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4755,7 +4220,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4773,7 +4237,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4792,7 +4255,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4812,7 +4274,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4823,7 +4284,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4836,7 +4296,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4867,7 +4326,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4908,7 +4366,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4931,7 +4388,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4960,7 +4416,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4984,7 +4439,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5012,7 +4466,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5046,7 +4499,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5066,11 +4518,6 @@ adventures: 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 @@ -5088,4 +4535,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/kmr.yaml b/content/adventures/kmr.yaml index 1be88c62b28..c12598643f3 100644 --- a/content/adventures/kmr.yaml +++ b/content/adventures/kmr.yaml @@ -27,7 +27,6 @@ adventures: 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: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -53,7 +52,6 @@ adventures: 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: @@ -87,7 +85,6 @@ adventures: 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. @@ -109,7 +106,6 @@ adventures: {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. @@ -135,7 +131,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -150,7 +145,6 @@ adventures: {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!\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\ @@ -166,7 +160,6 @@ adventures: {print} 'Oh no! Richard is too slow...' {print} _ ``` - 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" @@ -185,7 +178,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -194,7 +186,6 @@ adventures: 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' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -202,7 +193,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -235,7 +225,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -258,7 +247,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -279,7 +267,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -319,13 +306,6 @@ adventures: _ {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 @@ -343,11 +323,6 @@ adventures: {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 @@ -380,10 +355,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -411,11 +382,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -527,7 +493,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -564,7 +529,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In level 6 you created a calculator, in this level you can expand that code so it asks multiple questions. @@ -589,7 +553,6 @@ adventures: 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! @@ -607,7 +570,6 @@ adventures: {else} {print} 'That is wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -623,7 +585,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -634,7 +595,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -651,7 +611,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -676,11 +635,7 @@ adventures: 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 @@ -712,7 +667,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -761,17 +715,6 @@ adventures: 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 @@ -794,12 +737,6 @@ adventures: {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. @@ -819,14 +756,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -848,16 +777,6 @@ adventures: 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 @@ -872,13 +791,6 @@ adventures: {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 @@ -901,17 +813,7 @@ adventures: {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' @@ -938,19 +840,7 @@ adventures: 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: @@ -966,11 +856,6 @@ adventures: 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 @@ -995,10 +880,7 @@ adventures: {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} @@ -1035,19 +917,7 @@ adventures: 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: @@ -1062,11 +932,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1106,26 +971,6 @@ adventures: 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 @@ -1154,27 +999,6 @@ adventures: 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 @@ -1207,31 +1031,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1261,9 +1060,7 @@ adventures: 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?' @@ -1320,36 +1117,6 @@ adventures: 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 @@ -1500,7 +1267,6 @@ adventures: Bi bişkoja kesk 'Run code' di binê qada bernamekirinê de kodê biceribînin. Hûn dikarin nivîsê li ser ekranê bi karanîna `{print}` çap bikin Amade ne? Ew cax biçin tabloya din da ku emrê xweya yekem fêr bibin . ! - start_code: '{print} silav dinya!' 2: story_text: | In level 2 we learn two new commands: `{is}` and `{sleep}`. @@ -1515,11 +1281,9 @@ adventures: {echo} Ji ber vê yekê hûn dixwazin story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: '{print} silav dinya!' 3: story_text: | In level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`. - start_code: '{print} silav dinya!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1532,7 +1296,6 @@ adventures: bersiv {is} {ask} 'Ji niha û pê ve divê em çi bikar bînin?' {print} 'Divê em navê Sophie bikar bînin' {print} 'Navê min navê min' - start_code: '{print} ''Silav dinya''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1543,9 +1306,6 @@ adventures: nav {is} {ask} 'Navê te çi ye?' {if} nav {is} Hedy {print} 'xweşik' {else} {print} 'boo!' ``` - start_code: |- - nav {is} {ask} 'navê te çi ye?' - {if} nav {is} Hedy {print} 'xweş!' {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. @@ -1568,8 +1328,6 @@ adventures: {repeat} 3 {times} {print} 'Hedy kêfxweş e! {print} 'rojbûna te pîroz be' {repeat} 3 {times} {print} 'Hedy kêfxweş e!print!' ``` - start_code: | - {repeat} 3 {times} {print} 'Hedy xweş e!' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}`, `{else}`, {pressed} and `{repeat}` have changed! @@ -1593,10 +1351,6 @@ adventures: {print} 'INTRUDER!' {print} 'You cannot use this computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1611,13 +1365,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1628,17 +1375,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1648,8 +1388,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1661,11 +1400,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1680,8 +1414,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1700,11 +1433,6 @@ adventures: 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' 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. @@ -1737,8 +1465,7 @@ adventures: 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. - start_code: |- - name = 'Hedy' + {print}('My name is ', name) dice: name: Dice @@ -1766,7 +1493,6 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level you can also create dice. But this time you can try it yourself, without an example code! @@ -1774,7 +1500,6 @@ adventures: ### 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: | You can also make a die again in this level using the `{if}`. @@ -1788,7 +1513,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1808,7 +1532,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a dice again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1820,7 +1543,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the dice indicate this time?''' 10: story_text: "Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once!\n\n### Exercise \nChange the names into names of your friends or family, and finish the code so they each roll.\n" example_code: | @@ -1831,7 +1553,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1856,7 +1577,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1877,7 +1597,6 @@ adventures: 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: story_text: | With quotation marks you can make your dishwashing program even better. @@ -1892,7 +1611,6 @@ adventures: {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. @@ -1900,7 +1618,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1933,7 +1650,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 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! @@ -1945,7 +1661,6 @@ adventures: 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! @@ -1960,7 +1675,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -2008,10 +1722,6 @@ adventures: {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: |- 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. @@ -2023,10 +1733,6 @@ adventures: {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: 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. @@ -2065,7 +1771,6 @@ adventures: ### Exercise Copy the example code into your inputscreen 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: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2083,7 +1788,6 @@ adventures: 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. @@ -2108,7 +1812,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2121,7 +1824,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2156,7 +1858,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2168,7 +1869,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2188,7 +1888,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 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. @@ -2207,7 +1906,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2219,7 +1917,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2259,21 +1956,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2302,13 +1984,6 @@ adventures: {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. @@ -2332,17 +2007,6 @@ adventures: 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 @@ -2371,7 +2035,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2393,7 +2056,6 @@ adventures: _ {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 @@ -2425,7 +2087,6 @@ adventures: 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. @@ -2472,7 +2133,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2494,7 +2154,6 @@ adventures: {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. @@ -2516,7 +2175,6 @@ adventures: _ _ _ _ {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" @@ -2541,7 +2199,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - 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\ @@ -2554,7 +2211,6 @@ adventures: {print} 'Room ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2583,7 +2239,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2617,7 +2272,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2648,18 +2302,7 @@ adventures: {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?' @@ -2698,10 +2341,6 @@ adventures: _ _ _ 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... @@ -2718,11 +2357,6 @@ adventures: {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. @@ -2738,16 +2372,6 @@ adventures: {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 @@ -2776,11 +2400,6 @@ adventures: _ 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 @@ -2806,10 +2425,6 @@ adventures: 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: @@ -2818,8 +2433,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2851,8 +2465,7 @@ adventures: {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} @@ -2879,7 +2492,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2900,7 +2512,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2940,8 +2551,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2969,11 +2579,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Im Hedy the parrot - {ask} What is your name? - {echo} - {echo} 2: story_text: | Create your own online pet parrot that will copy you! @@ -2990,7 +2595,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3005,7 +2609,6 @@ adventures: {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}`. @@ -3020,7 +2623,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3037,7 +2639,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3058,7 +2659,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3082,7 +2682,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3111,7 +2710,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3124,7 +2722,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3144,7 +2741,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3170,8 +2766,6 @@ adventures: ``` _ 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. @@ -3188,8 +2782,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3221,7 +2814,6 @@ adventures: {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 @@ -3251,10 +2843,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3289,10 +2877,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3326,9 +2910,6 @@ adventures: 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. @@ -3377,11 +2958,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3395,10 +2971,6 @@ adventures: {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! @@ -3413,13 +2985,6 @@ adventures: {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 @@ -3445,10 +3010,6 @@ adventures: 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? @@ -3466,11 +3027,6 @@ adventures: _ {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 @@ -3494,7 +3050,6 @@ adventures: 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. @@ -3519,7 +3074,6 @@ adventures: 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: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3547,7 +3101,6 @@ adventures: 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. @@ -3570,7 +3123,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3591,7 +3143,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3610,7 +3161,6 @@ adventures: {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. @@ -3624,7 +3174,6 @@ adventures: {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: @@ -3643,7 +3192,6 @@ adventures: ### 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 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)**\ @@ -3670,7 +3218,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily ask orders for different courses. @@ -3709,7 +3256,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3731,7 +3277,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3751,7 +3296,6 @@ adventures: {print} 'What a healthy choice!' {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3768,7 +3312,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3795,9 +3338,6 @@ adventures: {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! @@ -3806,7 +3346,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3830,13 +3369,11 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. ### 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 who won. @@ -3856,7 +3393,6 @@ 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" @@ -3876,7 +3412,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3896,7 +3431,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3915,7 +3449,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3938,7 +3471,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3955,7 +3487,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3982,7 +3513,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3995,7 +3525,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -4011,10 +3540,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4052,7 +3577,6 @@ adventures: {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: @@ -4071,7 +3595,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: 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. @@ -4089,7 +3612,6 @@ adventures: 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! @@ -4106,7 +3628,6 @@ adventures: ``` 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. @@ -4122,7 +3643,6 @@ adventures: {print} monkeys ' little monkeys jumping on the bed' _ ``` - start_code: '# place your code here' 12: 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: @@ -4141,7 +3661,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4158,16 +3677,6 @@ adventures: {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. @@ -4203,7 +3712,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4225,7 +3733,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4247,15 +3754,6 @@ adventures: {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 @@ -4323,7 +3821,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4386,7 +3883,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4448,7 +3944,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4535,7 +4030,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4559,9 +4053,6 @@ adventures: {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. @@ -4587,11 +4078,6 @@ adventures: {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. @@ -4604,10 +4090,6 @@ adventures: {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! @@ -4634,11 +4116,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4671,12 +4148,6 @@ adventures: 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. @@ -4700,7 +4171,6 @@ adventures: {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" @@ -4741,7 +4211,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4759,7 +4228,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4784,16 +4252,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4809,7 +4267,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4820,7 +4277,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4831,7 +4287,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4849,7 +4304,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4868,7 +4322,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4888,7 +4341,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4899,7 +4351,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4912,7 +4363,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4943,7 +4393,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4984,7 +4433,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5007,7 +4455,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5036,7 +4483,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5060,7 +4506,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5088,7 +4533,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5122,7 +4566,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5142,11 +4585,6 @@ adventures: 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 @@ -5164,4 +4602,3 @@ adventures: {print} number {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/ko.yaml b/content/adventures/ko.yaml index c2a1b930e67..4b80aa66b0c 100644 --- a/content/adventures/ko.yaml +++ b/content/adventures/ko.yaml @@ -27,7 +27,6 @@ adventures: 적어도 하나의 `{ask}` 명령과 하나의 `{echo}` 명령을 사용합니다. 당신은 당신이 좋아하는 어떤 주제에 대해서도 그것을 만들 수 있다. 주제가 생각나지 않는다면, 우리가 선택한 것 중 하나를 이용해 보세요: 영화를 보러 가거나, 스포츠 경기를 하거나, 동물원에서 하루를 보내거나. - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -53,7 +52,6 @@ adventures: 코드에 있는 `{ask}`명령어와 `{echo}` 명령어를 이 수준에서 배운 올바른 형태로 변경합니다. **추가** 코드에 {sleep} 명령을 추가하여 스토리에 긴장감을 조성합니다. - start_code: '{print} Your story' 3: story_text: | 레벨 3 에서 더 재미있게 만들 수 있습니다.괴물, 동물 또는 다른 장애에 대한 랜덤성을 사용할 수 있습니다. @@ -87,7 +85,6 @@ adventures: dump {is} {ask} Which item should he dump? {remove} dump {from} bag ``` - start_code: '{print} 너의 스토리' 4: story_text: | 이전 레벨에서 여전히 문제가 있다는 것을 알아차렸을 수도 있다. 당신은 단어 이름을 포함하는 문장을 인쇄하려고 노력하였는가? 즉, `{print}` 내 이름은 name이다. @@ -112,7 +109,6 @@ adventures: {print} _ He hears the sound of a _ animals {at} {random} {print} name _ is afraid this is a haunted forest _ ``` - start_code: '{print} ''너의 스토리는 여기에 출력될거야''' 5: story_text: | 이 레벨에서 다른 엔딩을 프로그래밍할 수 있으므로 스토리가 더욱 재미있을 것입니다. @@ -138,7 +134,6 @@ adventures: {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: | 스토리에서, 어떤 사람은 여러 번 말을 합니다. 예를 들어, 누군가가 도움을 요청하거나 노래를 부를 때 말입니다. @@ -153,7 +148,6 @@ adventures: {repeat} 5 {times} {print} 'Help!' {print} 'Why is nobody helping me?' ``` - start_code: '{repeat} 5 {times} {print} ''Help!''' 8: story_text: | 이 레벨에서는 `{if}` 명령에 여러 줄을 사용할 수 있으며, 이렇게 하면 해피엔딩이나 새드엔딩을 업그레이드할 수 있습니다! @@ -176,7 +170,6 @@ adventures: {print} 'Oh no! Richard is too slow...' {print} _ ``` - start_code: '# 코드를 여기에 입력하세요' 9: story_text: "이 레벨에서는 다른 `{if}` 및 `{repeat}` 명령어 내에서 {if} 및 {repeat} 명령어를 사용할 수 있습니다. \n이것은 여러분에게 많은 선택권을 주고 여러분의 이야기를 상호작용적으로 만드는 데 정말로 도움을 줍니다.\n\n ### 연습문제 1\n코드를 완료하여 `{if}`가 올바르게 작동하도록 하십시오.\n\n### 연습문제 2\n로빈이 집에 가는 스토리의 부분도 `{if}`와 `{else}`를 붙인다.\n\n### 연습문제 3\n레벨 8 스토리로 돌아가서 다른 `{if}`\ \ 안에 최소한 두 개의 `{if}`을 사용합니다.\n" @@ -195,7 +188,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# 코드를 여기에 입력하세요' 10: story_text: | 이 레벨에서 스토리에서 {for} 명령을 사용할 수 있다. 이렇게 하면 어린이 책 '갈색 곰, 갈색곰, 무엇이 보이니'를 쉽게 프로그래밍할 수 있다. @@ -204,7 +196,6 @@ adventures: 스토리 를 보고, 책에서처럼 인쇄되어 있는지 확인한다. example_code: "```\nanimals = _ , _ , _ \n{print} 'Brown bear, Brown bear'\n {print} 'What do you see?'\n```\n" - start_code: '# 코드를 여기에 입력하세요' 12: story_text: |- 이 레벨에서는 변수에 여러 단어를 저장하기 위해 따옴표가 필요할 것입니다. @@ -217,7 +208,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# 코드를 여기에 입력하세요' 13: story_text: | `{and}` 명령어와 `{or}` 명령어를 사용하면 자신의 이야기를 보다 다재다능하게 만들 수 있다. 두 가지 질문을 하고 대답의 조합에 응답할 수 있다. @@ -236,7 +226,6 @@ adventures: {if} path {is} 'left' {and} weapon {is} 'sword' _ ``` - start_code: '# 코드를 여기에 입력하세요' 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. @@ -259,7 +248,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# 코드를 여기에 입력하세요' 18: story_text: | 다른 이야기를 인쇄할 건데 이제는 `{print}`가 붙은 괄호를 써야 해요. @@ -280,7 +268,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# 코드를 여기에 입력하세요' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -318,13 +305,6 @@ adventures: _ {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 @@ -342,11 +322,6 @@ adventures: {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 @@ -379,10 +354,6 @@ adventures: _ 너는 요즘 어때? _ ``` - start_code: | - {print} 안녕하세요! - {ask} 너는 이름이 무엇이니? - {echo} 안녕하세요 2: story_text: | ## The ask command @@ -410,11 +381,6 @@ adventures: 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: 파이썬 코드를 얻기 위해 우리가 해야 할 마지막 변화는 `{ask}`를 `{input}`으로 바꾸는 것이다. example_code: | @@ -526,7 +492,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# 코드를 여기에 입력하세요' calculator: name: Calculator default_save_name: Calculator @@ -563,7 +528,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In level 6 you created a calculator, in this level you can expand that code so it asks multiple questions. @@ -588,7 +552,6 @@ adventures: 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! @@ -606,7 +569,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# 코드를 여기에 입력하세요' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -622,7 +584,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# 코드를 여기에 입력하세요' 12: story_text: | In this level, you can make a calculator that works for decimal numbers. @@ -641,7 +602,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# 코드를 여기에 입력하세요' 13: story_text: | ### 연습문제 1 @@ -658,7 +618,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -683,11 +642,7 @@ adventures: 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 @@ -719,7 +674,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# 코드를 여기에 입력하세요' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -768,17 +722,6 @@ adventures: {clear} {print} '서프라이즈!' ``` - start_code: | - {print} '3' - {sleep} - {clear} - {print} '2' - {sleep} - {clear} - {print} '1' - {sleep} - {clear} - {print} '서프라이즈!' debugging: name: debugging default_save_name: debugging @@ -801,12 +744,6 @@ adventures: {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. @@ -826,14 +763,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -855,16 +784,6 @@ adventures: 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 @@ -879,13 +798,6 @@ adventures: {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 @@ -908,17 +820,7 @@ adventures: {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' @@ -945,19 +847,7 @@ adventures: 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: @@ -973,11 +863,6 @@ adventures: 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 @@ -1002,10 +887,7 @@ adventures: {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} @@ -1042,19 +924,7 @@ adventures: 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: @@ -1069,11 +939,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1113,26 +978,6 @@ adventures: 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 @@ -1161,27 +1006,6 @@ adventures: 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 @@ -1214,31 +1038,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1268,9 +1067,7 @@ adventures: 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?' @@ -1327,36 +1124,6 @@ adventures: 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 @@ -1506,7 +1273,6 @@ adventures: 프로그래밍 필드 아래에 있는 녹색 '코드 실행' 버튼으로 직접 코드를 사용해 보십시오. 준비되셨나요? 출력 결과를 확인하셨다면 이후 다음 탭으로 가셔서 첫 번째 명령어를 배우세요! - start_code: '{print} 안녕하세요!' 2: story_text: | 축하해요! 레벨 2에 올랐네요. 이미 멋진 코드를 만들었기를 바랍니다! @@ -1528,14 +1294,12 @@ adventures: 이는 레벨 2에서 변화한다. 레벨 2에서는 여러 개의 정보를 저장하고 원하는 장소에 인쇄할 수 있는 변수 작업을 배울 수 있다. 그럼 다음 탭으로 가보도록 하겠습니다! - start_code: '{print} 안녕하세요!' 3: story_text: | 이전 레벨에서는 변수가 무엇인지와 이를 사용하여 모험을 보다 상호 작용적으로 만들 수 있는 방법에 대해 배웠습니다. 하지만... 변수만 가지고 할 수 있는 것이 아닙니다! 변수를 사용하여 목록을 만들 수도 있습니다. 그리고 당신은 Hedy가 목록에서 임의의 단어를 고르도록 할 수도 있고, 이것은 당신이 진짜 게임을 만들 수 있게 해 준다! 다음 탭을 잠깐 보세요! - start_code: '{print} 안녕하세요!' 4: story_text: | 이전 레벨에서는 변수를 사용하여 연습해 보았지만, 이 문제를 발견했을 수도 있습니다. @@ -1555,7 +1319,6 @@ adventures: name {is} Sophie {print} My name is name ``` - start_code: '{print} ''안녕하세요''' 5: story_text: | 이전 레벨에서는 코드를 실행할 때마다 게임이 달라지는 `{at} {random}`을 사용하는 법을 이미 배웠습니다. @@ -1567,9 +1330,6 @@ adventures: ``` 암호 {is} {ask} '암호가 뭐에요?' ``` - start_code: |- - name {is} {ask} 'what is your name?' - {if} name {is} Hedy {print} 'cool!' {else} {print} 'meh' 6: story_text: | 이전 레벨에서는 `{ask}`와 `{if}`을 연습했습니다. 예를 들어 손님들에게 무엇을 먹고 싶은지 물어볼 수 있습니다. @@ -1593,7 +1353,6 @@ adventures: total_price {is} food_price + drink_price {print} 'That will be ' total_price ' dollars, please' ``` - start_code: '# 코드를 여기에 입력합니다' 7: story_text: | 잘했어요! 다음 레벨에 도달했으니 `{if}`와 `{else}`로 연습한 셈이죠. 코드가 점점 길어지는 것을 알아차렸을 거예요. @@ -1607,11 +1366,6 @@ adventures: {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: | 이제 여러분은 한 줄의 코드를 반복하는 방법에 대해 배웠습니다. 이것은 유용하지만, 항상 충분하지는 않습니다. 때때로 여러분은 한 번에 여러 줄을 반복하고 싶어합니다. @@ -1620,7 +1374,6 @@ adventures: ``` {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: | 잘했어요! 다른 새 레벨에 도달했어요! 이전 레벨에서는 {if} 또는 {repeat} 명령어에서 여러 줄의 코드를 사용하는 법을 배웠지만 아직 둘을 결합할 수는 없어요... @@ -1635,7 +1388,6 @@ adventures: {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: | 잘하고 있어요! 이전 레벨에서 우리는 여전히 작은 문제에 직면했어요. 당신은 선을 반복하는 법을 배웠지만, 선을 살짝 바꾸고 싶다면 어떻게 해야 하죠. @@ -1651,12 +1403,10 @@ adventures: {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: | 당신은 레벨 11에 도달했고, 잘하고 있어요! 상위 레벨에서는 Hedy가 점점 더 당신에게 파이썬 프로그래밍 언어를 가르치는데 집중하고 있습니다. 파이썬에는 `{repeat}` 명령어가 없지만 {repeat}처럼 작동하는 명령어가 있습니다. 파이썬 언어로 `{repeat}`을(를) 어떻게 말해야 하는지 궁금한가요? 빨리 찾아보세요! - start_code: '{print} ''Lets go to the next tab!''' 12: story_text: | 아마 독자 분은 레스토랑 모험에서 십진법 숫자들을 사용해 보셨을 겁니다. 만약 사용했다면, 독자 분은 Hedy가 십진법 숫자들을 아직 이해하지 못하고 항상 반올림했다는 것을 알아차렸을 거예요. @@ -1669,7 +1419,6 @@ adventures: 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: | 이전 레벨에서 여러분은 두 `{if}` 명령어를 서로 안에 넣는 방법을 배웠습니다. 이것은 잘 작동하지만, 이것과 같이 매우 길고 다루기 힘든 코드를 제공합니다: @@ -1689,7 +1438,6 @@ adventures: {else} {print} 'Access denied!' ``` - start_code: '{print} ''Lets go to the next level!''' 14: story_text: | 아래 프로그램으로 학교에서 한 과목(즉, 6등급 이상)을 통과했는지 계산할 수 있다. @@ -1706,7 +1454,6 @@ adventures: {else} {print} 'Great! You have passed the subject!' ``` - start_code: '{print} ''Lets go to the next tab''' 15: story_text: | 아래 게임에서는 플레이어가 원하는 만큼 플레이할 수 있도록 코드가 만들어졌다... @@ -1724,7 +1471,6 @@ adventures: {if} answer == 'yes' {print} 'Ok we will continue' ``` - start_code: '{print} ''Lets go to the next level!''' 16: story_text: | 이 레벨에서 우리는 실제 파이썬 코드를 향해 조금 더 성장할 것이다. 두 개의 목록을 함께 맞추는 방법도 배울 것이다. @@ -1745,11 +1491,9 @@ adventures: {for} sound {in} sounds {print} 'A ' animal ' says ' sound ``` - start_code: '{print} ''Lets go to the next tab!''' 17: story_text: | Hedy의 마지막 레벨에 거의 다 도달했습니다. 잘했어요! 이 레벨에서는 `{print}`을(를) 사용하는 실제 파이썬 방법을 배울 수 있습니다. - start_code: '{print} ''Lets go to the next level!''' 18: story_text: | 축하합니다! Hedy의 마지막 레벨에 도달했습니다! 여기서 만든 코드를 레플릿이나 파이참과 같은 실제 파이썬 환경에 복사할 수 있고, 거기서 계속 배울 수 있습니다! @@ -1781,7 +1525,6 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level you can also create dice. But this time you can try it yourself, without an example code! @@ -1789,7 +1532,6 @@ adventures: ### 연습문제 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! @@ -1805,7 +1547,6 @@ adventures: _ 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. @@ -1825,7 +1566,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: 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. @@ -1837,7 +1577,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | ### 연습문제 @@ -1851,7 +1590,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# 코드를 여기에 입력하세요' 15: story_text: | ### Exercise @@ -1876,7 +1614,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# 코드를 여기에 입력하세요' dishes: name: Dishes? default_save_name: Dishes @@ -1897,7 +1634,6 @@ adventures: 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: story_text: | With quotation marks you can make your dishwashing program even better. @@ -1912,7 +1648,6 @@ adventures: {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. @@ -1926,7 +1661,6 @@ adventures: _ 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: story_text: | 얼마나 자주 설거지를 할까요? 공평한가요? 이 정도면 계산할 수 있어요. @@ -1958,7 +1692,6 @@ adventures: {print} 'Tuesday the dishes are done by: ' dishwasher {remove} dishwasher {from} people ``` - start_code: '{print} ''Who does the dishes?''' 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! @@ -1970,7 +1703,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - 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! @@ -1985,7 +1717,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# 코드를 여기에 입력하세요' elif_command: name: '{elif}' default_save_name: elif @@ -2033,10 +1764,6 @@ adventures: {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: |- 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. @@ -2048,10 +1775,6 @@ adventures: {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: story_text: | 이제 들여쓰기를 조금 바꿀 것이다. 들여쓰기가 필요할 때마다 우리는 들여쓰기 앞 줄에 `:`가 필요하다. @@ -2090,7 +1813,6 @@ adventures: ### 연습문제 예제 코드를 입력 화면에 복사하고 빈칸을 입력하면 코드가 작동합니다. **추가** 코드를 바꿔서 점쟁이가 당신의 이름뿐만 아니라 당신의 나이, 당신이 좋아하는 스포츠 팀, 또는 당신 자신에 관한 다른 것들도 예측할 수 있도록 하세요. - start_code: '# 코드를 여기에 입력하세요' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only `{echo}`. @@ -2108,7 +1830,6 @@ adventures: story_text_2: | ### 연습문제 Now, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or 'ask again'. - start_code: '# 코드를 여기에 입력하세요' 4: story_text: | This level has no new functions, but allows you to practice with using the quotation marks. @@ -2133,7 +1854,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# 코드를 여기에 입력하세요' 5: story_text: | ### 연습문제 @@ -2157,7 +1877,6 @@ adventures: {if} person {in} friends {print} good_answer {at} {random} {else} {print} bad_answer {at} {random} ``` - start_code: '# 코드를 여기에 입력하세요' 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. @@ -2180,7 +1899,6 @@ adventures: {sleep} {print} kids ' kids!' ``` - start_code: '# 코드를 여기에 입력하세요' 7: story_text: | ### 연습문제 @@ -2193,7 +1911,6 @@ adventures: options = they love you, they love you not _ _ _ _ options {at} {random} ``` - start_code: '# 코드를 여기에 입력하세요' 8: story_text: | In the next example you can have your fortune teller ask multiple questions and also print them! @@ -2211,7 +1928,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# 코드를 여기에 입력하세요' 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. @@ -2230,7 +1946,6 @@ adventures: {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. @@ -2245,7 +1960,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# 코드를 여기에 입력하세요' functions: name: functions default_save_name: functions @@ -2285,21 +1999,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2328,13 +2027,6 @@ adventures: {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. @@ -2358,17 +2050,6 @@ adventures: 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 @@ -2397,7 +2078,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2419,7 +2099,6 @@ adventures: _ {print} name ' is great at ' subjects {at} {random} _ {print} name 's greatest fear is ' fears {at} {random} ``` - start_code: '# 코드를 여기에 입력하세요' haunted: name: 유령의 집 default_save_name: 유령의 집 @@ -2451,7 +2130,6 @@ adventures: 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: | 이 유령이 나오는 집에서는 이모지로 몬스터를 고를 수 있습니다. 물론 단어도 사용할 수 있습니다. @@ -2506,7 +2184,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# 코드를 여기에 입력하세요' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2528,7 +2205,6 @@ adventures: {sleep} {print} monsters {at} {random} ``` - start_code: '# 코드를 여기에 입력하세요' 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. @@ -2550,7 +2226,6 @@ adventures: _ _ _ _ {print} 'Great! Youve escaped!' {else} {print} 'Oh no! You are being eaten by a...' monsters {at} {random} ``` - start_code: '# 코드를 여기에 입력하세요' 9: story_text: "In this level you can use nesting, which allows you to make the haunted house even more interactive!\n\n### 연습문제\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" @@ -2575,7 +2250,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - 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### 연습문제 1\nFinish the program so the player knows which room they are in.\n\n### 연습문제 2\nMake the program into an adventure by following these steps:\n\n1. Make a list of choices\ \ (like: fight or flight)\n 2. 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!\ @@ -2588,7 +2262,6 @@ adventures: {print} 'Room ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2617,7 +2290,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2651,7 +2323,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2682,18 +2353,7 @@ adventures: {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?' @@ -2732,10 +2392,6 @@ adventures: _ _ _ 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... @@ -2752,11 +2408,6 @@ adventures: {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. @@ -2772,16 +2423,6 @@ adventures: {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 @@ -2810,11 +2451,6 @@ adventures: _ 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 @@ -2840,10 +2476,6 @@ adventures: 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: @@ -2852,8 +2484,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2885,8 +2516,7 @@ adventures: {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} @@ -2913,7 +2543,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# 코드를 여기에 입력하세요' 16: story_text: | ### Exercise @@ -2934,7 +2563,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# 코드를 여기에 입력하세요' maths: name: maths default_save_name: maths @@ -2974,8 +2602,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: 앵무새 @@ -3003,11 +2630,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Im Hedy the parrot - {ask} What is your name? - {echo} - {echo} 2: 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. @@ -3028,7 +2650,6 @@ adventures: 그런 다음 4번과 6번 줄에서 `{sleep}` 명령을 입력하면 앵무새가 잠시 동안 조용히 있을 수 있습니다. **Extra** 코드 줄을 더 추가해서 앵무새가 이름만 요구하게 만들 수 있나요? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | 앵무새에게 `{add}`로 새로운 단어를 가르쳐라. @@ -3043,7 +2664,6 @@ adventures: {print} 🧒 Say new_word, Hedy! {print} 🦜 words {at} {random} ``` - start_code: '# 코드를 여기에 입력하세요' 4: story_text: | 이 레벨에서 우리는 `{ask}`와 `{print}` 명령어가 있는 따옴표를 사용해야 한다. @@ -3058,7 +2678,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# 여기에 코드를 입력하세요' 5: story_text: | 앵무새가 정확한 단어를 말하면 보상을 해주세요! @@ -3077,7 +2696,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# 코드를 여기에 입력하세요' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3101,7 +2719,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# 코드를 여기에 입력하세요' 14: story_text: | ### Exercise @@ -3125,7 +2742,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3154,7 +2770,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# 코드를 여기에 입력하세요' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3167,7 +2782,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# 코드를 여기에 입력하세요' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3187,7 +2801,6 @@ adventures: _ _ ``` - start_code: '# 코드를 여기에 입력하세요' print_command: name: '{print}' default_save_name: print @@ -3213,8 +2826,6 @@ adventures: ``` _ 안녕하세요! ``` - start_code: | - {print} Hedy에 오신걸 환영해요! 18: story_text: |- 진짜 파이썬 코드에 도착했어! 이제부터는 `{print}`와 `{range}`가 있는 괄호를 써야 한다는 얘기다. @@ -3231,8 +2842,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3264,7 +2874,6 @@ adventures: {if} points_b > points_a {print} 'You belong to the B club' ``` - start_code: '# 코드를 여기에 입력하세요' quotation_marks: name: '''따옴표''' default_save_name: quotation_marks @@ -3294,10 +2903,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3332,10 +2937,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3369,9 +2970,6 @@ adventures: prices {is} _ _ ``` - start_code: | - animals {is} dog, cat, kangaroo - {print} animals {at} {random} 16: story_text: |- 우리는 파이썬 방식으로 목록을 만들고, 목록 주변에 대괄호를 둘 것이다! 우리는 또한 이전 레벨에서 배운 것처럼 각 항목의 주변에 따옴표를 유지한다. @@ -3420,11 +3018,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3438,10 +3031,6 @@ adventures: {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! @@ -3456,13 +3045,6 @@ adventures: {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 @@ -3488,10 +3070,6 @@ adventures: 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? @@ -3509,11 +3087,6 @@ adventures: _ {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: 식당 default_save_name: 식당 @@ -3537,7 +3110,6 @@ adventures: 그러면 식당 프로그램에 최소 4줄의 코드를 추가해주세요. 고객에게 무엇을 마시고 싶은지 물어보고 현금이나 카드로 지불하고 싶은지 물어봅니다. 마지막으로 고객과 작별할 수 있는 좋은 방법을 생각해 보세요. - start_code: '# 코드를 여기에 입력하세요' 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. @@ -3562,7 +3134,6 @@ adventures: 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: '# 코드를 여기에 입력하세요' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3590,7 +3161,6 @@ adventures: prices {is} _ _ ``` - start_code: '# 코드를 여기에 입력하세요' 4: story_text: | In this level you have to use quotation marks when using the `{print}` or `{ask}` command. @@ -3614,7 +3184,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# 코드를 여기에 입력하세요' 5: story_text: | ### 연습문제 @@ -3631,7 +3200,6 @@ adventures: {if} drink {in} drinks_in_stock {print} 'One ' drink 'coming up!' {else} {print} 'Sorry, we do not sell that' ``` - start_code: '# 코드를 여기에 입력하세요' 6: 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. @@ -3659,7 +3227,6 @@ adventures: {print} 'That will be ' price ' dollars, please' {print} 'Thank you, enjoy your meal!' ``` - start_code: '# 코드를 여기에 입력하세요' 7: story_text: | 이 레벨에서는 코드의 한 줄을 일정 시간 반복하기 위해 `{repeat}` 명령을 사용하는 방법을 배웠습니다. @@ -3673,7 +3240,6 @@ adventures: {print} 'Welcome to Restaurant Chez Hedy' people = {ask} 'How many people are joining us today?' ``` - start_code: '# 코드를 여기에 입력하세요' 8: story_text: | 이 레벨에서 당신은 여러 줄의 코드를 반복함으로써 가상 식당을 더 정교하게 만들 수 있다. 다음과 같이: @@ -3692,7 +3258,6 @@ adventures: ### 연습문제 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: '# 코드를 여기에 입력하세요' 9: story_text: "In this level you can use nesting to make your restaurant more realistic and more fun!\n\n### 연습문제\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\ @@ -3719,7 +3284,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# 코드를 여기에 입력하세요' 10: story_text: | In this level you'll learn how to easily ask orders for different courses. @@ -3758,7 +3322,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# 코드를 여기에 입력하세요' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3780,7 +3343,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# 코드를 여기에 입력하세요' 13: story_text: | In this level you will learn new commands to extend your code even further. @@ -3804,7 +3366,6 @@ adventures: {print} 'That is a healthy choice' {print} 'That will be ' price ' dollars' ``` - start_code: '# 코드를 여기에 입력하세요' 15: story_text: | `{while}`를 사용하면 고객이 주문이 완료될 때까지 주문을 계속 추가할 수 있습니다. @@ -3821,7 +3382,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# 코드를 여기에 입력하세요' rock: name: 가위바위보 default_save_name: Rock @@ -3848,9 +3408,6 @@ adventures: {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! @@ -3862,7 +3419,6 @@ adventures: choice is rock {print} I choose _ ``` - start_code: '# 코드를 여기에 입력하세요' 3: story_text: | You can use the `{at} {random}` command to let the computer pick rock, paper or scissors! @@ -3882,13 +3438,11 @@ adventures: player_1 {is} {ask} Name of player 1: _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. ### 연습문제 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. @@ -3910,7 +3464,6 @@ adventures: ``` 비겼는지 확인하려면 빈칸에 정확한 코드를 입력하세요. - 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### 연습문제\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" @@ -3930,7 +3483,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# 코드를 여기에 입력하세요' 10: story_text: | ### 연습문제 @@ -3941,7 +3493,6 @@ adventures: players = _ {for} _ ``` - start_code: '# 코드를 여기에 입력하세요' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code. @@ -3963,7 +3514,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# 코드를 여기에 입력하세요' 15: story_text: | ### 연습문제 @@ -3986,7 +3536,6 @@ adventures: won = 'yes' _ ``` - start_code: '# 코드를 여기에 입력하세요' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -4003,7 +3552,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# 코드를 여기에 입력하세요' secret: name: SuperSpy default_save_name: SuperSpy @@ -4033,7 +3581,6 @@ adventures: b = 'today at 10.00' {print} _ _ _ ``` - start_code: '# 코드를 여기에 입력하세요' 13: story_text: | We can simplify the superspy code with `{and}`, such that we only need one `{if}`. @@ -4052,7 +3599,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# 코드를 여기에 입력하세요' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -4066,10 +3612,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4107,7 +3649,6 @@ adventures: {print} 'NO MORE MONKEYS JUMPING ON THE BED!' {sleep} ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -4126,7 +3667,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: 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. @@ -4144,7 +3684,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# 코드를 여기에 입력하세요' 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! @@ -4161,7 +3700,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# 코드를 여기에 입력하세요' 11: story_text: | In this level you can use the `{for}` with `{range}` to make songs that use counting, like the 5 little monkeys. @@ -4177,7 +3715,6 @@ adventures: {print} monkeys ' little monkeys jumping on the bed' _ ``` - start_code: '# 코드를 여기에 입력하세요' 12: 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: @@ -4196,7 +3733,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# 코드를 여기에 입력하세요' 13: 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? @@ -4213,16 +3749,6 @@ adventures: {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. @@ -4258,7 +3784,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# 코드를 여기에 입력하세요' 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. @@ -4280,7 +3805,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4302,15 +3826,6 @@ adventures: {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 @@ -4346,7 +3861,6 @@ adventures: {else} player = 'x' ``` - start_code: '# 코드를 여기에 입력하세요' 14: story_text: | 이전 레벨에서는 Tic Tac Toe 게임을 만들었지만 이제 = 기호, == 기호 및 != 기호를 사용하는 방법에 대해 배웠습니다. @@ -4409,7 +3923,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# 코드를 여기에 입력하세요' 15: story_text: | 이 레벨에서 {while} 루프로 Tic Tac Toe 게임을 향상시킬 수 있다. 이 루프로 `{if} game != 'over'`와 `{for} i {in} {range} 1 {to} 9`를 하나의 간단한 행으로 결합할 수 있다. @@ -4471,7 +3984,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# 코드를 여기에 입력하세요' 17: story_text: | 이전 레벨에서 Tic Tac Toe 게임은 짜증나는 특징을 가지고 있었다. 모든 동작이 끝난 후, 당신이 이기거나 그렇지 않으면 당신은 자신을 채워야 했다. @@ -4558,7 +4070,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# 코드를 여기에 입력하세요' turtle: name: 거북이 default_save_name: 거북이 @@ -4582,9 +4093,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | 이 레벨에서 변수를 사용하여 거북이가 상호작용하도록 만들 수 있다. 예를 들어 플레이어에게 거북이가 몇 걸음을 걸어야 하는지 물어볼 수 있다. @@ -4610,11 +4118,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {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. @@ -4627,10 +4130,6 @@ adventures: {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! @@ -4657,11 +4156,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4694,12 +4188,6 @@ adventures: {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. @@ -4723,7 +4211,6 @@ adventures: {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### 연습문제 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### 연습문제 2\nNow create a drawing consisting of at least two polygons.\n" @@ -4764,7 +4251,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# 코드를 여기에 입력하세요' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4782,7 +4268,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4807,16 +4292,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4832,7 +4307,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4843,7 +4317,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4854,7 +4327,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4872,7 +4344,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4891,7 +4362,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4911,7 +4381,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4922,7 +4391,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4935,7 +4403,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4966,7 +4433,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5007,7 +4473,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5030,7 +4495,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5059,7 +4523,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5083,7 +4546,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5111,7 +4573,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5145,7 +4606,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5165,11 +4625,6 @@ adventures: 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 @@ -5187,4 +4642,3 @@ adventures: {print} number {print} 'Happy New Year!' ``` - start_code: '# 코드를 여기에 입력하세요' diff --git a/content/adventures/mi.yaml b/content/adventures/mi.yaml index 8549840e6b2..24b4c7a5e70 100644 --- a/content/adventures/mi.yaml +++ b/content/adventures/mi.yaml @@ -27,7 +27,6 @@ adventures: 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: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -53,7 +52,6 @@ adventures: 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: @@ -87,7 +85,6 @@ adventures: 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. @@ -112,7 +109,6 @@ adventures: {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. @@ -138,7 +134,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -153,7 +148,6 @@ adventures: {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! @@ -176,7 +170,6 @@ adventures: {print} 'Oh no! Richard is too slow...' {print} _ ``` - 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" @@ -195,7 +188,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -204,7 +196,6 @@ adventures: 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' 12: story_text: |- In this level quotation marks will be needed to save multiple words in a variable. @@ -217,7 +208,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 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. @@ -236,7 +226,6 @@ adventures: {if} path {is} 'left' {and} weapon {is} 'sword' _ ``` - start_code: '# place your code here' 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. @@ -259,7 +248,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -280,7 +268,6 @@ adventures: 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 @@ -320,13 +307,6 @@ adventures: _ {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 @@ -344,11 +324,6 @@ adventures: {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 @@ -381,10 +356,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -412,11 +383,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -528,7 +494,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -596,7 +561,6 @@ adventures: 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! @@ -614,7 +578,6 @@ adventures: {else} {print} 'That is wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -630,10 +593,6 @@ adventures: {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. @@ -652,7 +611,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' _ ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -669,7 +627,6 @@ adventures: {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. @@ -694,11 +651,7 @@ adventures: 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 @@ -730,7 +683,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -779,17 +731,6 @@ adventures: {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 @@ -812,12 +753,6 @@ adventures: {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. @@ -837,14 +772,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -866,16 +793,6 @@ adventures: 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 @@ -890,13 +807,6 @@ adventures: {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 @@ -919,17 +829,7 @@ adventures: {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' @@ -956,19 +856,7 @@ adventures: 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: @@ -984,11 +872,6 @@ adventures: 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 @@ -1013,10 +896,7 @@ adventures: {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} @@ -1053,19 +933,7 @@ adventures: 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: @@ -1080,11 +948,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1124,26 +987,6 @@ adventures: 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 @@ -1172,27 +1015,6 @@ adventures: 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 @@ -1225,31 +1047,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1279,9 +1076,7 @@ adventures: 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?' @@ -1338,36 +1133,6 @@ adventures: 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 @@ -1517,7 +1282,6 @@ adventures: 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! @@ -1539,14 +1303,12 @@ adventures: 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: story_text: | In the previous levels you've been practising with variables, but you may have come across this problem. @@ -1566,9 +1328,6 @@ adventures: name {is} Sophie {print} My name is name ``` - start_code: | - name {is} Sophie - {print} My name is name 5: 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. @@ -1580,9 +1339,6 @@ adventures: ``` 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. @@ -1606,7 +1362,6 @@ adventures: total_price {is} food_price + drink_price {print} 'That will be ' total_price ' dollars, please' ``` - start_code: '# place your code here' 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. @@ -1620,11 +1375,6 @@ adventures: {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. @@ -1633,7 +1383,6 @@ adventures: ``` {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... @@ -1648,7 +1397,6 @@ adventures: {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. @@ -1664,12 +1412,10 @@ adventures: {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. @@ -1682,7 +1428,6 @@ adventures: 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: @@ -1702,7 +1447,6 @@ adventures: {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). @@ -1719,12 +1463,6 @@ adventures: {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... @@ -1742,7 +1480,6 @@ adventures: {if} answer == 'yes' {print} 'Ok we will continue' ``` - start_code: '{print} ''Lets go to the next tab!''' 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. @@ -1764,14 +1501,12 @@ adventures: {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! @@ -1803,9 +1538,6 @@ adventures: ``` 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! @@ -1813,7 +1545,6 @@ adventures: ### 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! @@ -1829,7 +1560,6 @@ adventures: _ 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. @@ -1849,7 +1579,6 @@ adventures: ``` 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: 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. @@ -1861,7 +1590,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the dice indicate this time?''' 10: story_text: | ### Exercise @@ -1875,7 +1603,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1900,7 +1627,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1921,7 +1647,6 @@ adventures: 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: story_text: | With quotation marks you can make your dishwashing program even better. @@ -1936,7 +1661,6 @@ adventures: {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. @@ -1950,7 +1674,6 @@ adventures: _ 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: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1982,7 +1705,6 @@ adventures: {print} 'Tuesday the dishes are done by: ' dishwasher {remove} dishwasher {from} people ``` - start_code: '{print} ''Who does the dishes?''' 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! @@ -1994,7 +1716,6 @@ adventures: 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! @@ -2009,11 +1730,6 @@ adventures: {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 @@ -2061,10 +1777,6 @@ adventures: {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: |- 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. @@ -2077,10 +1789,6 @@ adventures: {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: 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. @@ -2119,7 +1827,6 @@ adventures: ### 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: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only `{echo}`. @@ -2137,7 +1844,6 @@ adventures: 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. @@ -2162,7 +1868,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | ### Exercise @@ -2186,7 +1891,6 @@ adventures: {if} person {in} friends {print} good_answer {at} {random} {else} {print} bad_answer {at} {random} ``` - start_code: '# place your code here' 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. @@ -2209,7 +1913,6 @@ adventures: {sleep} {print} kids ' kids!' ``` - start_code: '# place your code here' 7: story_text: | ### Exercise @@ -2222,7 +1925,6 @@ adventures: options = they love you, they love you not _ _ _ _ options {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the next example you can have your fortune teller ask multiple questions and also print them! @@ -2240,7 +1942,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 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. @@ -2259,7 +1960,6 @@ adventures: {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. @@ -2274,7 +1974,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2314,21 +2013,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2357,13 +2041,6 @@ adventures: {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. @@ -2387,17 +2064,6 @@ adventures: 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 @@ -2426,7 +2092,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2448,7 +2113,6 @@ adventures: _ {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 @@ -2480,7 +2144,6 @@ adventures: 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. @@ -2535,7 +2198,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2557,7 +2219,6 @@ adventures: {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. @@ -2579,7 +2240,6 @@ adventures: _ _ _ _ {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" @@ -2604,7 +2264,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - 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\ @@ -2617,7 +2276,6 @@ adventures: {print} 'Room ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2646,7 +2304,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2680,7 +2337,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2711,18 +2367,7 @@ adventures: {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?' @@ -2761,10 +2406,6 @@ adventures: _ _ _ 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... @@ -2781,11 +2422,6 @@ adventures: {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. @@ -2801,16 +2437,6 @@ adventures: {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 @@ -2839,11 +2465,6 @@ adventures: _ 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 @@ -2869,10 +2490,6 @@ adventures: 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: @@ -2881,8 +2498,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2914,8 +2530,7 @@ adventures: {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} @@ -2942,7 +2557,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2963,7 +2577,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -3008,8 +2621,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -3037,11 +2649,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Im Hedy the parrot - {ask} What is your name? - {echo} - {echo} 2: 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. @@ -3062,7 +2669,6 @@ adventures: 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!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3077,7 +2683,6 @@ adventures: {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}`. @@ -3092,7 +2697,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3111,7 +2715,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3135,7 +2738,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3159,7 +2761,6 @@ adventures: {call} _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3188,7 +2789,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3201,7 +2801,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3221,7 +2820,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3247,8 +2845,6 @@ adventures: ``` _ 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. @@ -3265,8 +2861,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3298,7 +2893,6 @@ adventures: {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 @@ -3328,10 +2922,6 @@ adventures: {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** @@ -3366,10 +2956,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3403,9 +2989,6 @@ adventures: 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. @@ -3455,11 +3038,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3473,10 +3051,6 @@ adventures: {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! @@ -3491,13 +3065,6 @@ adventures: {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 @@ -3523,10 +3090,6 @@ adventures: 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? @@ -3544,11 +3107,6 @@ adventures: _ {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 @@ -3572,7 +3130,6 @@ adventures: 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. @@ -3597,7 +3154,6 @@ adventures: 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: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3625,7 +3181,6 @@ adventures: 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. @@ -3649,7 +3204,6 @@ adventures: {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 @@ -3666,7 +3220,6 @@ adventures: {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: 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. @@ -3694,7 +3247,6 @@ adventures: {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. @@ -3708,7 +3260,6 @@ adventures: {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: @@ -3727,7 +3278,6 @@ adventures: ### 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 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\ @@ -3754,7 +3304,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily ask orders for different courses. @@ -3793,7 +3342,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3815,7 +3363,6 @@ adventures: 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. @@ -3839,7 +3386,6 @@ adventures: {print} 'That is a healthy choice' {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3856,7 +3402,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock_2 @@ -3883,9 +3428,6 @@ adventures: {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! @@ -3897,7 +3439,6 @@ adventures: 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! @@ -3917,13 +3458,11 @@ adventures: player_1 {is} {ask} Name of player 1: _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. ### 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. @@ -3945,7 +3484,6 @@ 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" @@ -3965,7 +3503,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | ### Exercise @@ -3976,7 +3513,6 @@ adventures: players = _ {for} _ ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code. @@ -3998,7 +3534,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -4021,7 +3556,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -4038,7 +3572,6 @@ adventures: choice {is} _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -4068,7 +3601,6 @@ adventures: b = 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | We can simplify the superspy code with `{and}`, such that we only need one `{if}`. @@ -4087,7 +3619,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -4105,10 +3636,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4146,7 +3673,6 @@ adventures: {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: @@ -4165,7 +3691,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: 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. @@ -4183,7 +3708,6 @@ adventures: 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! @@ -4200,7 +3724,6 @@ adventures: ``` 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. @@ -4216,7 +3739,6 @@ adventures: {print} monkeys ' little monkeys jumping on the bed' _ ``` - start_code: '# place your code here' 12: 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: @@ -4235,7 +3757,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4252,16 +3773,6 @@ adventures: {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. @@ -4297,7 +3808,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4319,7 +3829,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4341,15 +3850,6 @@ adventures: {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 @@ -4385,7 +3885,6 @@ adventures: {else} player = 'x' ``` - start_code: '# Write your code here' 14: 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. @@ -4448,7 +3947,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4510,7 +4008,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4597,7 +4094,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4621,9 +4117,6 @@ adventures: {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. @@ -4649,11 +4142,6 @@ adventures: {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. @@ -4666,10 +4154,6 @@ adventures: {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! @@ -4696,11 +4180,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4733,12 +4212,6 @@ adventures: {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. @@ -4762,7 +4235,6 @@ adventures: {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" @@ -4803,7 +4275,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4822,7 +4293,6 @@ adventures: {forward} distance ``` ``` - start_code: '# place your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4847,16 +4317,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4872,7 +4332,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4883,7 +4342,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4894,7 +4352,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4912,7 +4369,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4931,7 +4387,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4951,7 +4406,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4962,7 +4416,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4975,7 +4428,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -5006,7 +4458,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5047,7 +4498,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5070,7 +4520,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5099,7 +4548,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5123,7 +4571,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5151,7 +4598,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5185,7 +4631,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5205,11 +4650,6 @@ adventures: 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 @@ -5227,4 +4667,3 @@ adventures: {print} number {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/nb_NO.yaml b/content/adventures/nb_NO.yaml index 9b75939bf0e..f7b9f528765 100644 --- a/content/adventures/nb_NO.yaml +++ b/content/adventures/nb_NO.yaml @@ -18,7 +18,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Fortellingen din starter her' 2: story_text: | På nivå 2 kan du gjøre fortellingen din gøyere. Hovedpersonen sitt navn kan nå være overalt i setningen. @@ -44,7 +43,6 @@ adventures: 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} fortellingen din' 3: story_text: | På nivå 3 kan du gjøre historien din enda mer gøy. Du kan bruke tilfeldighet for å velge et hvilket som helst monster, dyr eller hindring slik: @@ -73,7 +71,6 @@ adventures: dump {is} {ask} Hvilken ting skal han legge igjen? {remove} dump {from} ryggsekk ``` - start_code: '{print} Fortellingen din' 4: story_text: | Du kan ha lagt merke til at det fremdeles er et problem med forrige nivå. Prøvde du å skrive ut en settning som inneholdt ordet navn? @@ -88,7 +85,6 @@ adventures: {print} 'Han hører lyden av en' dyrene {at} {random} {print} navn 'er redd for at det spøker i skogen' ``` - start_code: '{print} ''Fortellingen din vil bli skrevet her!''' 5: story_text: | På dette nivået kan du programmere forskjellige avsluttninger, som vil gjøre fortellingen din enda gøyere. @@ -111,7 +107,6 @@ adventures: {if} slutt {is} glad {print} navn 'tar sverdet og monsteret løper sin vei' {else} {print} 'Monsteret spiser' navn ``` - start_code: '{print} ''Her starter fortellingen din!''' 7: story_text: | I en fortelling sier noen ord flere ganger. For eksempel når noen roper etter hjelp eller synger en sang. @@ -122,7 +117,6 @@ adventures: {repeat} 5 {times} {print} 'Hjelp!' {print} 'Hvorfor hjelper ingen meg?' ``` - start_code: '{repeat} 5 {times} {print} ''Hjelp!''' 8: story_text: | På dette nivået kan du bruke flere linjer i din {if} kommando. På denne måten kan du oppgradere din lykkelige eller triste slutt! @@ -140,7 +134,6 @@ adventures: {print} 'Men Rolf løper for sakte...' {print} 'T-rexen haler innpå og spiser ham i ett stort jafs!🦖' ``` - start_code: '# skriv koden din her' 9: story_text: | På dette nivået kan du bruke nøsting til å putte {if}, {repeat} eller {for}kommandoer inne i andre {if}, {repeat} eller {for}kommandoer. Dette gir deg mange muligheter og virkelig gjør fortellingen din interaktiv. @@ -159,7 +152,6 @@ adventures: {else} {print} 'Robin går hjem' ``` - start_code: '# skriv koden din her' 10: story_text: | På dette nivået kan du bruke {for} kommandoen i fortellingen din. På denne måten kan du enkelt programmere barneboken 'brunbjørn, brunbjørn, hva ser du'. @@ -176,7 +168,6 @@ adventures: {print} 'Hva ser du?' {print} 'Jeg ser alle dyrene som ser på meg!' ``` - start_code: '# skriv koden din her' 12: story_text: | På dette nivået kan du bruke hermetegn for å lagre flere ord i en variabel. @@ -185,7 +176,6 @@ adventures: navn = 'Dronningen av England' {print} navn ' spiste kake, da plutselig ...' ``` - start_code: '# skriv koden din her' 13: story_text: | Ved å bruke `{and}` og `{or}` kommandoene, kan du korte ned historier. For eksempel, sjekk ut historien om dragen. @@ -215,7 +205,6 @@ adventures: {print} 'Dette kan være veldig hendig' sverd = 'funnet' ``` - start_code: '# skriv koden din her' 15: story_text: | Ved hjelp av `{while}` løkke kan man gjøre historier mer interessante. For eksempel kan du bruke `{while} spillet {is} 'i gang'`så du kan spille til spillet er over. @@ -238,7 +227,6 @@ adventures: {print} 'Nei, de er ikke ved ' location {print} 'Nå kan du gå inn i huset!' ``` - start_code: '# skriv koden din her' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -259,7 +247,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -299,13 +286,6 @@ adventures: _ {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 @@ -323,11 +303,6 @@ adventures: {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 @@ -360,10 +335,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -391,11 +362,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -507,7 +473,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Kalkulator default_save_name: Kalkulator @@ -547,7 +512,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Velkommen til denne kalkulatoren!''' 9: story_text: | På de forrige nivåene lærte du hvordan å lage en kalkulator. På dette nivået kan du utvide koden til å lage et lite mattespill. Slik som dette... @@ -566,7 +530,6 @@ adventures: poengsum = poengsum + 1 {print} 'Godt jobbet! Din poengsum er... ' poengsum ' av 10!' ``` - start_code: '{print} ''Velkommen til denne kalkulatoren!''' 10: story_text: | Dette kalkulatorspillet hjelper med å øve på multiplikasjonstabeller! @@ -583,7 +546,6 @@ adventures: {else} {print} 'Det er feil. Det riktige svaret er ' riktig_svar ``` - start_code: '# skriv koden din her' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -599,7 +561,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Du kan lage en kalkulator som fungerer med desimaltall. @@ -610,7 +571,6 @@ adventures: riktig_svar = tall1 + tall2 {print} tall1 ' pluss ' tall2 ' er ' riktig_svar ``` - start_code: '# skriv koden din her' 13: story_text: | ### Exercise 1 @@ -627,7 +587,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -652,11 +611,7 @@ adventures: 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 @@ -688,7 +643,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# skriv koden din her' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -737,17 +691,6 @@ adventures: 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 @@ -770,12 +713,6 @@ adventures: {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. @@ -795,14 +732,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -824,16 +753,6 @@ adventures: 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 @@ -848,13 +767,6 @@ adventures: {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 @@ -877,17 +789,7 @@ adventures: {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' @@ -914,19 +816,7 @@ adventures: 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: @@ -942,11 +832,6 @@ adventures: 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 @@ -971,10 +856,7 @@ adventures: {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} @@ -1011,19 +893,7 @@ adventures: 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: @@ -1038,11 +908,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1082,26 +947,6 @@ adventures: 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 @@ -1130,27 +975,6 @@ adventures: 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 @@ -1183,31 +1007,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1237,9 +1036,7 @@ adventures: 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?' @@ -1296,36 +1093,6 @@ adventures: 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 @@ -1475,7 +1242,6 @@ adventures: Prøv koden selv med den grønne 'Kjør kode' knappen under programmeringsfeltet. Du kan skrive tekst til skjermen ved å bruke `{print}` kommandoen. - start_code: '{print} hallo verden!' 2: story_text: | På nivå 2 lærer vi to nye kommandoer: `{is}` og `{sleep}`. @@ -1490,11 +1256,9 @@ adventures: ``` story_text_2: | `{print}` fungerer fortsatt som før, men `{ask}` kommandoen har endret seg. Fra nå må du bruke en variabel når du bruker `{ask}` kommandoen. Det ser slik ut: - start_code: '{print} hallo verden!' 3: story_text: | På nivå 3 kan du lage lister. Du kan la datamaskinen velge noe tilfeldig fra listen, du gjør det med `{at} {random}`. - start_code: '{print} hallo verden!' 4: story_text: | På nivå 4 har `{ask}` og`{print}` blitt endret. @@ -1510,7 +1274,6 @@ adventures: svar {is} {ask} 'Hva må vi bruke fra nå av?' {print} 'Vi må bruke' svar ``` - start_code: '{print} ''Hallo verden''' 5: story_text: | På nivå 5 er det noe nytt å lære seg, `{if}`! Med `{if}` kommandoen kan du velge mellom to forskjellige valg. @@ -1521,9 +1284,6 @@ adventures: navn {is} {ask} 'Hva heter du?' {if} navn {is} Hedy {print} 'wow!' {else} {print} 'fysj!' ``` - start_code: |- - navn {is} {ask} 'Hva heter du?' - {if} navn {is} Hedy {print} 'kult!' {else} {print} 'meh' 6: story_text: | På dette nivået skal du få lære noe nytt! Du kan nå bruke Hedy til å gjøre matte. @@ -1546,7 +1306,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy {is} morro!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy er morro!''' 8: story_text: | `{ask}` {and} `{print}` fungerer fortsatt slik du er vandt til, men `{if}` {and} `{repeat}` har endret seg litt! @@ -1558,10 +1317,6 @@ adventures: {print} 'Hallo alle sammen' {print} 'Dette blir gjentatt 5 ganger' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hallo folkens' - {print} 'Dette vil bli skrevet ut 5 ganger' 9: story_text: | På dette nivået kan du bruke både `{if}` med kodeblokker {and} `{repeat}` sammen! @@ -1577,13 +1332,6 @@ adventures: else {print} 'pizza er bedre' ``` - start_code: |- - {repeat} 3 {times} - matrett = {ask} 'Hva vil du ha?' - {if} matrett {is} pizza - {print} 'nice!' - else - {print} 'pizza er bedre' 10: story_text: | På dette nivået skal vi lære et nytt nøkkelord `{for}`. Med `{for}` kan du lage en liste og bruke alle elementene i listen. @@ -1594,17 +1342,10 @@ adventures: {for} dyr {in} dyrene {print} 'Jeg elsker ' dyr ``` - start_code: |- - dyrene {is} hunder, katter, flyndre - {for} dyr {in} dyrene - {print} 'Jeg elsker ' dyr 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: |- - {for} teller {in} {range} 1 {to} 5 - {print} teller 12: story_text: | **Desimaltall** @@ -1614,8 +1355,7 @@ adventures: {print} 'To og en halv pluss to og en halv er lik...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'desimaltall må bruke et punktum nå' + {print} 2.5 + 2.5 13: story_text: | @@ -1627,11 +1367,6 @@ adventures: {if} navn {is} 'Hedy' {and} alder {is} 2 {print} 'Du er den ekte Hedy' ``` - start_code: |- - navn = {ask} 'Hva heter du?' - alder = {ask} 'Hvor gammel er du?' - {if} navn {is} 'Hedy' {and} alder {is} 2 - {print} 'Du er den ekte Hedy!' 14: story_text: | Vi skal lære enda flere nye ting. Det kan være du allerede kjenner til disse fra mattetimen, `<`og `>`. @@ -1646,8 +1381,7 @@ adventures: {if} alder > 12 {print} 'Du er eldre enn meg!' ``` - start_code: |- - alder = {ask} 'Hvor gammel er du?' + {if} alder < 13 {print} 'Du er yngre enn meg!' {else} @@ -1666,11 +1400,6 @@ adventures: svar = {ask} 'Hva er 5 ganger 5?' {print} 'A korrekt svar ble gitt' ``` - start_code: |- - svar = 0 - {while} svar != 25 - svar = {ask} 'Hva er 5 ganger 5?' - {print} 'Det svaret var riktig' 16: story_text: | Vi skal nå lage lister på Python måten, med firkantparanteser rundt listene! Vi beholder fnuttene rundt tekstene i listen slik som vi lærte på et tidligere nivå. @@ -1710,8 +1439,7 @@ adventures: navn = 'Hedy' {print}('Mitt navn er ', navn) ``` - start_code: |- - navn = 'Hedy' + {print}('Mitt navn er ', navn) dice: name: Terninger @@ -1739,12 +1467,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} Hva vil terningen vise denne gangen?' 4: story_text: | På dette nivået kan vi lage setninger med terningens verdi i setningen, med fnutter så klart. Denne gangen er ikke eksempelkoden helt ferdig. Kan du fullføre koden? - start_code: '{print} ''Hva vil terningen vise denne gangen?''' 5: story_text: | Du ha også lage en terning igjen på dette nivået ved å bruke `{if}`. @@ -1758,7 +1484,6 @@ adventures: {print} 'du trillet ' _ 'med terningen' {if} _ {is} makk {print} 'Du kan slutte å trille.' _ {print} 'Prøv igjen!' ``` - start_code: '{print} ''Hva vil terningen vise denne gangen?''' 6: story_text: | Du kan også lage en Earthworm-terning igjen i dette, men nå kan du også kalkulere hvor mange poeng som har blitt trillet. @@ -1776,7 +1501,6 @@ adventures: Kan du gjøre det slik at koden gir deg den totale poengsummen for 8 terningkast? For å gjøre det må du kopiere og lime inn et par linjer kode. example_code_2: | Klarte du å beregne poeng for 8 terninger? Det krevde mye kopiering og liming, sant? Vi skal gjøre det lettere på nivå 7! - start_code: '{print} ''Hva vil terningen vise denne gangen?''' 7: story_text: | Du kan også lage en terning igjen på nivå 5. Med `{repeat}` kan du enkelt trille en hel håndfull med terninger. @@ -1788,7 +1512,6 @@ adventures: valgene = 1, 2, 3, 4, 5, makk {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''Hva vil terningen vise denne gangen?''' 10: story_text: | Bruker alle for lang tid på å trille terninger? På dette nivået kan du la Hedy trille alle terningene på en gang! @@ -1800,7 +1523,6 @@ adventures: {print} spiller ' triller ' valg {at} {random} {sleep} ``` - start_code: '# skriv koden din her' 15: story_text: | ### Exercise @@ -1825,7 +1547,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# skriv koden din her' dishes: name: Retter? default_save_name: Retter @@ -1846,7 +1567,6 @@ adventures: ``` story_text_2: | Føler du ikke for å ta oppvasken selv? Hack programmet til å fjerne navnet ditt fra listen. - start_code: '{print} Hvem tar oppvasken?' 4: story_text: | Med fnutter kan du gjøre oppvaskeplanleggingen penere. @@ -1862,7 +1582,6 @@ adventures: {sleep} {print} familie {at} _ ``` - start_code: '{print} ''Hvem tar oppvasken?''' 5: story_text: | Med `{if}`kan du nå ha det mer gøy med valg i programmet. Du kan få programmet til å respondere med det valget maskinen har tatt. @@ -1875,7 +1594,6 @@ adventures: oppvasker {is} familie {at} {random} {if} oppvasker {is} Sofie {print} _ det var dumt at jeg må ta oppvasken _ {else} {print} 'heldigvis ingen oppvask fordi' _ 'allerede tar oppvasken' ``` - start_code: '{print} ''Hvem tar oppvasken?''' 6: story_text: | Hvor ofte må hver ta oppvasken? Er det rettferdig? Du kan telle det på dette nivået. @@ -1908,7 +1626,6 @@ adventures: {remove} oppvasker {from} familie oppvasker = familie {at} {random} ``` - start_code: '{print} ''Hvem tar oppvasken?''' 7: story_text: | Med `{repeat}` kan du repetere deler av kode. Du kan bruke dette til å beregne hvem som skal ta oppvasken for hele uken. @@ -1917,7 +1634,6 @@ adventures: familie = mamma, pappa, Emma, Sofie {repeat} _ _ {print} 'Den som tar oppvasken er ' _ ``` - start_code: '{print} ''Hvem tar oppvasken?''' 10: story_text: | På dette nivået kan du lage en enda bedre oppvaskeplan. @@ -1928,7 +1644,6 @@ adventures: {for} day {in} dager {print} navn {at} {random} ' tar oppvasken på ' day ``` - start_code: '# skriv koden din her' elif_command: name: '{elif}' default_save_name: elif @@ -1976,10 +1691,6 @@ adventures: {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: |- 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. @@ -1991,10 +1702,6 @@ adventures: {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: 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. @@ -2034,7 +1741,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# skriv koden din her' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2053,7 +1759,6 @@ adventures: story_text_2: | ### Exercises Now, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or '{ask} again'. - start_code: '# skriv koden din her' 4: story_text: | This level has no new functions, but allows you to practice with using the quotation marks. @@ -2074,7 +1779,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# skriv koden din her' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2087,7 +1791,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# skriv koden din her' 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. @@ -2118,7 +1821,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# skriv koden din her' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2130,7 +1832,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# skriv koden din her' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2147,7 +1848,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# skriv koden din her' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2163,7 +1863,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# skriv koden din her' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2175,7 +1874,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# skriv koden din her' functions: name: functions default_save_name: functions @@ -2215,21 +1913,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2258,13 +1941,6 @@ adventures: {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. @@ -2288,17 +1964,6 @@ adventures: 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 @@ -2327,7 +1992,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2349,7 +2013,6 @@ adventures: _ {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: Spøkelseshus default_save_name: Spøkelseshus @@ -2379,7 +2042,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - start_code: '{print} Hvordan kom jeg meg her?' 2: story_text: | In this haunted house you can choose your monsters with emojis. Of course you could also use words. @@ -2426,7 +2088,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# skriv koden din her' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2442,7 +2103,6 @@ adventures: {sleep} {print} monsters {at} {random} ``` - start_code: '# skriv koden din her' 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. @@ -2461,7 +2121,6 @@ adventures: {if} chosen_door {is} correct_door {print} 'Great! Youve escaped!' {else} {print} 'Oh no! You are being eaten by a...' monsters {at} {random} ``` - start_code: '# skriv koden din her' 9: story_text: | In this level you can use nesting, which allows you to make the haunted house even more interactive! @@ -2490,7 +2149,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Flykt fra det forheksede huset!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2516,7 +2174,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Flykt fra det forheksede huset!''' 14: story_text: | ### Exercise @@ -2545,7 +2202,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2579,7 +2235,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2610,18 +2265,7 @@ adventures: {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?' @@ -2660,10 +2304,6 @@ adventures: _ _ _ 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... @@ -2680,11 +2320,6 @@ adventures: {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. @@ -2700,16 +2335,6 @@ adventures: {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 @@ -2738,11 +2363,6 @@ adventures: _ 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 @@ -2768,10 +2388,6 @@ adventures: 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: @@ -2780,8 +2396,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2813,8 +2428,7 @@ adventures: {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} @@ -2837,7 +2451,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# skriv koden din her' 16: story_text: | ### Exercise @@ -2858,7 +2471,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# skriv koden din her' maths: name: maths default_save_name: maths @@ -2898,8 +2510,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Papegøye @@ -2925,7 +2536,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Jeg er papegøyen Hedy' 2: story_text: | Lag din egen online papegøye som hermer etter deg! @@ -2942,7 +2552,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Jeg er papegøyen Hedy!' 3: story_text: | Lær papegøyen din et nytt ord med `{add}`. @@ -2955,7 +2564,6 @@ adventures: {print} 🧒 Si nytt_ord , Hedy! {print} 🦜 ordene {at} {random} ``` - start_code: '# skriv koden din her' 4: story_text: | In this level we have to use quotation marks with the commands `{ask}` and `{print}`. @@ -2969,7 +2577,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Belønn papegøyen din om det sier det riktige ordet! @@ -2985,7 +2592,6 @@ adventures: {if} uttalt_ord {is} nytt_ord {print} '🧒 Godt jobbet, Hedy! 🍪' {else} {print} '🧒 Nei, Hedy! Si ' nytt_ord ``` - start_code: '# skriv koden din her' piggybank: name: Sparebøsse default_save_name: Sparebøsse @@ -3005,7 +2611,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# skriv koden din her' 14: story_text: | ### Exercise @@ -3029,7 +2634,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3058,7 +2662,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3071,7 +2674,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3091,7 +2693,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3117,8 +2718,6 @@ adventures: ``` _ 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. @@ -3135,8 +2734,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmester @@ -3168,7 +2766,6 @@ adventures: {if} points_b > points_a {print} 'You belong to the B club' ``` - start_code: '# skriv koden din her' quotation_marks: name: '''quotation marks''' default_save_name: quotation_marks @@ -3198,10 +2795,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3236,10 +2829,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3273,9 +2862,6 @@ adventures: 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. @@ -3324,11 +2910,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3342,10 +2923,6 @@ adventures: {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! @@ -3360,13 +2937,6 @@ adventures: {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 @@ -3392,10 +2962,6 @@ adventures: 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? @@ -3413,11 +2979,6 @@ adventures: _ {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 @@ -3436,7 +2997,6 @@ adventures: ``` story_text_2: | Kan du tenke deg flere linjer du kan legge til restaurantens kode? For eksempe, kan du spørre gjestene hva de har lyst å drikke, fortelle de prisen eller å ønske de et godt måltid? - start_code: '# skriv koden din her' 2: story_text: | På nivå 2 kan du utvide din restaurant ved å bruke variabler. På nivå 1 kunne Hedy bare svare med bestillingen 1 gang og den kunne bare huske siste ting som var bestilt. @@ -3456,7 +3016,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# skriv koden din her' 3: story_text: | Har du problemer med å bestemme hva du vil ha til middag? Du kan la Hedy bestemme for deg! @@ -3488,7 +3047,6 @@ adventures: {remove} allergier {from} smaker {print} Du vil få en smaker {at} {random} milkshake ``` - start_code: '# skriv koden din her' 4: story_text: | På dette nivået må du bruke fnutter når du bruker `{print}`-kommandoen. @@ -3508,7 +3066,6 @@ adventures: {print} 'Takk for bestillingen.' {print} maten ' og ' drikken ' kommer snart!' ``` - start_code: '# skriv koden din her' 5: story_text: | På dette nivået lar `{if}`-kommandoen deg å spørre kunder spørsmål og gi forskjellige ting til svar. @@ -3529,7 +3086,6 @@ adventures: {if} annet {is} nei {print} 'Det var det!' {else} {print} 'En ' annet {print} 'Takk for bestillingen og vel bekomme!' ``` - start_code: '# skriv koden din her' 6: story_text: | På dette nivået kan du bruke matte til å regne ut totalprisen på kundens bestilling. Dette vil gjøre den virtuelle restauranten mer realistisk. @@ -3549,7 +3105,6 @@ adventures: {print} 'Det blir ' pris ' kroner, takk' {print} 'Takk, vel bekomme!' ``` - start_code: '# skriv koden din her' 7: story_text: | På dette nivået har du lært å bruke `{repeat}`-kommandoen til å repeterer en linje med kode et visst antall ganger. @@ -3561,7 +3116,6 @@ adventures: {repeat} antall_personer times mat = {ask} 'Hva vil du spise?' {print} 'Takk for bestillingen, den er på vei!' ``` - start_code: '# skriv koden din her' 8: story_text: | På dette nivået kan du lage din virtuelle restaurant enda mer forseggjort ved å reptere flere linjer med kode. Slik: @@ -3578,7 +3132,6 @@ adventures: ``` story_text_2: | Selvfølgelig, denne koden kan utvides med flere tin i menyen, tilbud om drikke, og/eller flere retter så legg til så mye du ønsker! - start_code: '# skriv koden din her' 9: story_text: | På dette nivået kan du putte `{if}` inni `{if}` for å gjøre restauranten din mer realistisk og gøy! @@ -3606,7 +3159,6 @@ adventures: {print} 'Det blir ' pris ' kroner' {print} 'Vel bekomme!' ``` - start_code: '# skriv koden din her' 10: story_text: | På dette nivået kan du lære hvordan å enkelt spørre om gjestenes ønsker i kort kode. @@ -3648,7 +3200,6 @@ adventures: pris = 40 * antall_personer {print} 'Det blir ' pris ' kroner, takk!' ``` - start_code: '# skriv koden din her' 12: story_text: | Fra dette nivået av kan du bruke desimaltall for å gjøre menyen mer realistisk. @@ -3667,7 +3218,6 @@ adventures: pris = pris + 20.35 {print} 'Det blir ' pris ' kroner, takk!' ``` - start_code: '# skriv koden din her' 13: story_text: | På dette nivået kan vi bruke de nye kommandoen til å oppgradere restauranten vår. @@ -3682,7 +3232,6 @@ adventures: pris = pris - 30 {print} 'Det blir ' pris ' kroner' ``` - start_code: '# skriv koden din her' 15: story_text: | Med `{while}` kan du sørge for at kundene dine kan fortsette å bestille til de er ferdig. @@ -3698,7 +3247,6 @@ adventures: mer = {ask} 'Vil du ha noe mer?' {print} 'Takk!' ``` - start_code: '# skriv koden din her' rock: name: Stein, saks, papir default_save_name: Stein @@ -3726,7 +3274,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Velkommen til din egen stein saks papir!' 2: story_text: | På dette nivået kan du øve deg på å bruke variabler så du kan lage stein, saks, papir-spillet på neste nivå! @@ -3735,7 +3282,6 @@ adventures: valg {is} _ {print} Jeg velger valg ``` - start_code: '# skriv koden din her' 3: story_text: | På dette nivået kan vi lage lister og velge ting fra de. @@ -3756,12 +3302,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Velkommen til din egen stein saks papir!' 4: story_text: | På dette nivået kan vi programmere videre på stein, saks, papir. Om du vil legge til tekst må du bruke fnutter her også. Kan du fullføre koden ved å fylle ut de riktige kommandoene og tengene der det er streker? - start_code: '{print} ''Velkommen til din egen stein saks papir!''' 5: story_text: | På dette nivået kan vi bestemme hvem som vant. @@ -3781,7 +3325,6 @@ adventures: ``` Fyll ut resten av koden der det er linjer for å se om det er uavgjort. - start_code: '{print} ''Velkommen til din egen stein saks papir!''' 9: story_text: | På dette nivået kan du programmere hele stein, saks, papir ved å plassere `{if}`-kommandoer inni `{if}`-kommandoer. Kan du fullføre koden? @@ -3800,7 +3343,6 @@ adventures: {if} ditt_valg {is} saks {print} 'Du tapte!' ``` - start_code: '# skriv koden din her' 10: story_text: | Er du for lat til å spille spillet selv? La Hedy spille det for deg! @@ -3811,7 +3353,6 @@ adventures: {for} spiller {in} spillere {print} spiller ' velger ' valgene {at} {random} ``` - start_code: '# skriv koden din her' 13: story_text: | Med `{and}`-kommandoen kan du korte ned stein, saks, papir-koden din! Sjekk ut eksempelkoden under og prøv å fullføre den. @@ -3829,7 +3370,6 @@ adventures: {if} datamaskinens_valg {is} 'stein' {and} ditt_valg {is} 'saks' {print} 'Datamaskinen vant!' ``` - start_code: '# skriv koden din her' 15: story_text: | Spill til du klarer å slå datamaskinen! Men først, fullfør eksempelkoden... @@ -3850,7 +3390,6 @@ adventures: {print} 'Du vant!' vunnet = 'yes' ``` - start_code: '# skriv koden din her' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3867,7 +3406,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpion default_save_name: språk @@ -3891,7 +3429,6 @@ adventures: b = 'today at 10.00' print a + b ``` - start_code: '# skriv koden din her' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3904,7 +3441,6 @@ adventures: else print 'Go to the trainstation at 10.00' ``` - start_code: '# skriv koden din her' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3920,10 +3456,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Syng en sang! default_save_name: Sang @@ -3957,7 +3489,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Sanger inneholder ofte en del repetisjon. For eksempel... Baby Shark! Om du synger den så kan du fortsette å synge det samme: @@ -3975,7 +3506,6 @@ adventures: ``` Etter Baby Shark kan du selvfølgelig programmere andre sanger. Det er mange sanger med repetisjon. - start_code: '{print} ''Baby Shark''' 8: story_text: | På et tidligere nivå programmerte du sangen 'Bottles of beer'. Du lagde ett vers og så måtte du kopiere verset 99 ganger. På nivå 7 kan du repetere sangen 99 ganger, bare legg til en enkel linje! @@ -3989,7 +3519,6 @@ adventures: verse = vers - 1 {print} vers ' bottles of beer on the wall' ``` - start_code: '# skriv koden din her' 10: story_text: | På dette nivået kan du lett lage barnesangen "Fem små aper". Kan du lage det siste refrenget? @@ -4041,7 +3570,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# skriv koden din her' 11: story_text: | På dette nivået kan du bruke `{for} i {in} {range}` kommandoen til å lage sanger som bruker telling. @@ -4056,7 +3584,6 @@ adventures: {else} {print} 'INGEN FLERE APER FÅR HOPPE I EN SENG!' ``` - start_code: '# skriv koden din her' 12: story_text: | I denne sangen kan vi gjøre det enda enklere å programmere 'Hvis du er lyklig og du vet det, klappe klapp'. Fordi vi kan putte alle handlingene i en variabel, sjekk ut dette: @@ -4071,7 +3598,6 @@ adventures: {print} 'Hvis du er lykkelig og du vet det' {print} handling ``` - start_code: '# skriv koden din her' 13: 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? @@ -4088,16 +3614,6 @@ adventures: {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: | På dette nivået kan du programmere en sang som "Old MacDonald" enda raskere. Du kan knytte sammen det riktige dyret til den riktige lyden ved å putte de på den samme plassen i listen. @@ -4130,7 +3646,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# skriv koden din her' 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. @@ -4152,7 +3667,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4174,15 +3688,6 @@ adventures: {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 @@ -4251,7 +3756,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4314,7 +3818,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4376,7 +3879,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4463,7 +3965,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Skilpadde default_save_name: Skilpadde @@ -4484,9 +3985,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | På nivå 1 kunne skilpadden kun snu seg til høyre eller venstre. Det er litt kjedelig! @@ -4518,11 +4016,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: | - {print} Skilpadderace! - vinkel {is} 90 - {turn} vinkel - {forward} 25 3: story_text: | På dette nivået kan du bruke `{at} {random}` med den tegnende skilpadden. Et tilfeldig valg gjør at skilpadden går en ny rute hver gang. @@ -4533,10 +4026,6 @@ adventures: {turn} vinkler {at} {random} {forward} 25 ``` - start_code: | - vinkler {is} 10, 50, 90, 150, 250 - {turn} vinkler {at} {random} - {forward} 25 4: story_text: | På nivå 4 kan du bruke fnutter med `{print}` og `{ask}`. Også når du tegner! @@ -4563,11 +4052,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: | - {print} 'Tegner figurer' - vinkel {is} 90 - {turn} vinkel - {forward} 25 5: story_text: | På nivå 5 kan du ta valg med `{if}`. For eksempel mellom forskjellige typer figurer. @@ -4600,12 +4084,6 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: | - {print} 'Tegner figurer' - figur {is} {ask} 'Vil du lage en firkant eller en trekant?' - {if} figur {is} trekant vinkel {is} 120 {else} vinkel {is} 90 - {turn} vinkel - {forward} 25 6: story_text: | På dette nivået kan du bruke regning for å tegne forskjellige figurer. @@ -4629,8 +4107,6 @@ adventures: {forward} 50 {turn} grader ``` - start_code: | - {print} 'Tegner figurer' 8: story_text: | Nå som vi kan repetere flere linjer så kan vi lage figurer lettere. @@ -4673,7 +4149,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4691,7 +4166,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4716,16 +4190,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4741,7 +4205,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4752,7 +4215,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4763,7 +4225,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4781,7 +4242,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4800,7 +4260,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4820,7 +4279,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4831,7 +4289,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4844,7 +4301,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4875,7 +4331,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4916,7 +4371,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4939,7 +4393,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4968,7 +4421,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4992,7 +4444,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5020,7 +4471,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5054,7 +4504,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5074,11 +4523,6 @@ adventures: 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 @@ -5096,4 +4540,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/nl.yaml b/content/adventures/nl.yaml index 7764ccf5781..2d8b8738267 100644 --- a/content/adventures/nl.yaml +++ b/content/adventures/nl.yaml @@ -27,7 +27,6 @@ adventures: Gebruik minstens een `{ask}` en een `{echo}` commando. Je mag zelf een onderwerp kiezen. Geen inspiratie? Kies dan een van onze onderwerpen: Naar de bioscoop, een sportwedstrijd of een dagje naar de dierentuin - start_code: '{print} Hier begint jouw verhaal' 2: story_text: | In level 2 kun je je verhaal leuker maken. De naam van je hoofdpersoon kan nu overal in de zin staan. @@ -53,7 +52,6 @@ adventures: Verander de `{ask}` en `{echo}` commando's in jouw code naar de juiste vorm, die je in dit level geleerd hebt. **Extra** Voeg een `{sleep}` commando toe aan jouw code om spanning in het verhaal op te bouwen. - start_code: '{print} Hier komt straks jouw verhaal!' 3: story_text: | In dit level kun je iets willekeurigs aan je verhaal toevoegen. Een willekeurig monster, dier of ander obstakel. Dat gaat zo: @@ -87,7 +85,6 @@ adventures: weggooien {is} {ask} Welk ding zal onze held weggooien? {remove} weggooien {from} tas ``` - start_code: '{print} Hier komt straks jouw verhaal!' 4: story_text: | Misschien heb je gezien dat in het vorige level nog wel een foutje zit. Heb je toevallig geprobeerd om een zin te maken waarin het woord naam zat? Bijv. `{print}` mijn naam is naam. @@ -112,7 +109,6 @@ adventures: {print} _Hij hoort het geluid van een _ dieren {at} {random} {print} naam _ is bang dat dit een spookbos is_ ``` - start_code: '{print} ''Hier komt straks jouw verhaal!''' 5: story_text: | In dit level kun je je verhaal nog leuker maken door verschillende eindes te programmeren. @@ -138,7 +134,6 @@ adventures: {if} einde {is} goed {print} naam ' pakt het zwaard en het monster rent snel weg' {else} {print} 'Het monster eet ' naam ' op' ``` - start_code: '{print} ''Hier komt straks jouw verhaal!''' 7: story_text: | Soms zegt iemand in een verhaal iets meerdere keren. Bijvoorbeeld als iemand om hulp roept, of een liedje zingt. @@ -153,7 +148,6 @@ adventures: {repeat} 5 {times} {print} 'Help!' {print} 'Waarom helpt niemand me nou toch?' ``` - start_code: '{repeat} 5 {times} {print} ''Help!''' 8: story_text: "In dit level kun jij jouw verhaal écht interactief maken! In dit level is het `{if}` commando namelijk veranderd, waardoor je er meerdere regels mee kunt printen. Zo kun je de lezer van je verhaal een keuze laten maken. Na de keuze gaat het verhaal verder op basis van die\ \ keuze. Kijk maar naar het voorbeeld.\n\n### Opdracht 1\nIn de voorbeeldcode zie je hoe je twee verschillende verhalen kunt maken; eentje waarbij je op het geluid afgaat en eentje waarbij jij je verstopt. \nVul zelf lege plekken in! \n**Extra** Maak het verhaal nog langer. Wat gebeurt\ @@ -171,7 +165,6 @@ adventures: {print} 'Snel zoekt ' hoofdpersoon ' een verstopplek' {print} _ ``` - start_code: '# Schrijf jouw code hier' 9: story_text: "In dit level kun je `{if}` and `{repeat}` commando's in andere `{if}` en `{repeat}` commando's stoppen. \nHierdoor krijg je nog meer mogelijkheden om je verhaal echt interactief te maken!\n\n### Opdracht 1\nMaak de code af op de streepjes zodat de `{if}` het doet.\n\n### Opdracht\ \ 2\nVoeg een `{if}` en een `{else}` toe aan het gedeelte van het verhaal waar Robin naar huis gaat.\n\n### Opdracht 3\nGa terug naar je verhaal van level 8 en gebruik ook minstens twee keer een `{if}` in een `{if}`.\n" @@ -190,7 +183,6 @@ adventures: {else} {print} 'Robin gaat naar huis' ``` - start_code: '# Schrijf jouw code hier' 10: story_text: "In dit level kun je het commando `{for}` in je verhaal gebruiken. Op deze manier kun je gemakkelijk het kinderboek 'Beertje bruin, wat zie jij daar?' programmeren.\n\n### Opdracht \n\nKijk naar het verhaal, als je het niet kent, en zorg dat dit hele verhaal wordt uitgeprint.\n" @@ -200,7 +192,6 @@ adventures: {print} 'Bruintje beer, bruintje beer' {print} 'Wat zie je?' ``` - start_code: '# Schrijf jouw code hier' 12: story_text: |- Aanhalingstekens zijn nu nodig om woorden op te slaan in een variabele, voor en achter ieder element in de lijst. @@ -213,7 +204,6 @@ adventures: naam = 'De Koningin van Engeland' {print} naam ' zat te genieten van een lekker taartje, toen plotseling...' ``` - start_code: '# Schrijf jouw code hier' 13: story_text: | Met `{and}` en `{or}` kun je een verhaal nog veelzijdiger maken! Je kan een speler twee vragen stellen en reageren op beide antwoorden. @@ -233,7 +223,6 @@ adventures: _ ``` - start_code: '# Schrijf jouw code hier' 15: story_text: | In dit level kun je de `{while}` loop gebruiken om je verhaaltjes nog interessanter te maken. Zo kun je `{while} spelletje == 'aan'` gebruiken om het spel te laten werken totdat je game over bent. @@ -255,7 +244,6 @@ adventures: {print} 'Helaas, ze liggen niet bij de ' locatie {print} 'Nu kun je het huis in!' ``` - start_code: '# Schrijf jouw code hier' 18: story_text: | We gaan weer een verhaal printen, maar we moeten daarbij steeds haakjes gebruiken bij de `{print}`. @@ -276,7 +264,6 @@ adventures: naam = {input}('Hoe heet jij?') {print}('Welkom bij dit verhaal!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -314,13 +301,6 @@ adventures: _ {print} Je krijgt een {at} {random} milkshake ``` - start_code: | - dieren {is} hond, kat, kangoeroe - leuk {is} {ask} Welk dier vind jij leuk? - {add} leuk {to_list} dieren - niet_leuk {is} {ask} Welk dier vind jij niet leuk? - {remove} niet_leuk {from} dieren - {print} Ik kies dieren {at} {random} and_or_command: name: '{and} & {or}' default_save_name: en of @@ -336,11 +316,6 @@ adventures: {if} naam {is} 'Hedy' {and} leeftijd {is} 2 {print} 'Jij bent de echte Hedy!' ``` - start_code: |- - naam = {ask} 'hoe heet jij?' - leeftijd = {ask} 'hoe oud ben jij?' - {if} naam {is} 'Hedy' {and} leeftijd {is} 2 - {print} 'Jij bent de echte Hedy!' ask_command: name: '{ask}' default_save_name: vraag_commando @@ -366,10 +341,6 @@ adventures: _ Hoe gaat het? _ ``` - start_code: | - {print} Hallo! - {ask} Wat is jouw naam? - {echo} Hoi 2: story_text: | ## Het vraag commando @@ -392,11 +363,6 @@ adventures: lievelingsdier {is} {ask} Wat is je lievelingsdier? {print} Ik hou van lievelingsdier ``` - start_code: |- - naam {is} {ask} Hoe heet je? - {print} Hoi naam - leeftijd {is} {ask} Hoe oud ben je? - {print} naam is leeftijd jaar oud. 18: story_text: Als laatste veranderen we het woord dat je moet gebruiken voor `{ask}`. Vanaf nu noemen we ask`{input}`. example_code: | @@ -503,7 +469,6 @@ adventures: {elif} punten > dealer_punten {and} punten < 21: {print} 'Je wint!!' ``` - start_code: '# Schrijf jouw code hier' calculator: name: Rekenmachine default_save_name: Rekenmachine @@ -569,7 +534,6 @@ adventures: score = score + 1 {print} 'Je score is ' score ' van 10!' ``` - start_code: '{print} ''Welkom bij de rekenmachine!''' 10: story_text: | Met dit rekenspelletje kun je de tafels oefenen. @@ -588,7 +552,6 @@ adventures: {else} {print} 'Foutje! Het was... ' goed ``` - start_code: '# Schrijf jouw code hier' 11: story_text: | Met een `{for}` kan je jouw tafeloefenprogramma met nog minder regels code maken. @@ -604,9 +567,7 @@ adventures: {for} i {in} {range} 1 {to} 10 {print} i * nummer ``` - start_code: | - nummer = 10 - {for} i {in} {range} 1 {to} 10 + {print} i * nummer 12: story_text: | @@ -626,7 +587,6 @@ adventures: antwoord = _ {print} getal1 ' plus ' getal2 ' is ' _ ``` - start_code: '# Schrijf jouw code hier' 13: story_text: | ### Opdracht 1 @@ -643,7 +603,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 14: story_text: | In dit avontuur leer je een rekenmachine bouwen die het gemiddelde cijfer voor jou berekent. Als je de rekenmachine aan de praat krijgt, kun je doorgaan naar het volgende avontuur. Daar leer je hoe je extra features toevoegt aan je rekenmachine. @@ -668,11 +627,7 @@ adventures: gemiddelde_cijfer = {call} _ print 'Je staat gemiddeld een ' gemiddelde_cijfer ``` - start_code: | - {define} bereken_gemiddelde_cijfer - totaal = 0 - {for} i {in} {range} 1 {to} 4 - cijfer = {ask} _ + totaal = totaal + _ {return} _ / 4 @@ -704,7 +659,6 @@ adventures: _ {print} 'Je hebt gewonnen!' ``` - start_code: '# Schrijf jouw code hier' calculator_2: name: Rekenmachine 2 default_save_name: Calculator 2 @@ -753,17 +707,6 @@ adventures: {clear} {print} 'VERRASSING!' ``` - start_code: | - {print} '3' - {sleep} - {clear} - {print} '2' - {sleep} - {clear} - {print} '1' - {sleep} - {clear} - {print} 'VERRASSING!' debugging: name: debugging default_save_name: debugging @@ -786,12 +729,6 @@ adventures: {print} Wat zijn je hobbies? {echo} Jouw hobbies zijn ``` - start_code: | - {print} Ik vind programmeren leuk - Vind jij programmeren ook leuk? - {echo} - {print} Wat zijn je hobbies? - {echo} Jouw hobbies zijn 2: story_text: |- Welkom bij het debugging avontuur. Een code debuggen betekent dat je alle fouten eruit gaat halen. @@ -811,8 +748,7 @@ adventures: {sleep} Alsjeblieft! Goede reis! ``` - start_code: | - bestemming {ask} Waar ga je naartoe op vakantie? + {print} De vlucht naar bstemming vertrekt om 15:00 uur. {ask} Heb je jouw bagage al ingecheckt? {echo} @@ -840,16 +776,6 @@ adventures: film_morgen {is} film_keuzes {at} {random} Ik ga de popcorn pakken! {print} ``` - start_code: | - film_keuzes {is} dracula, fast and furious, home alone, barbie - gekozen_film {is} films {at} {random} - {print} Vanavond gaan we gekozen_films kijken - leuk {ask} Vind je dat een leuke film? - {print} Morgen zullen we iets anders gaan kijken. - {add} gekozen_film {to} film_keuzes - {print} Morgen zullen we film_morgen gaan kijken - film_morgen {is} film_keuzes {at} {random} - Ik ga de popcorn pakken! {print} 4: story_text: |- ### Opdracht @@ -864,13 +790,6 @@ adventures: {print} 'auteur is jouw favoriete auteur' {print} Hmmm... ik denk dat je boeken {at} {random} leuk zou vinden ``` - start_code: | - {print} 'Welkom bij de online bibliotheek! - {ask} Welk genre boeken vind je leuk? - {print} Jij houdt van het genre - auteur {is} {ask} 'Wie' is je favoriete auteur?' - {print} 'auteur is jouw favoriete auteur' - {print} Hmmm... ik denk dat je boeken {at} {random} leuk zou vinden 5: story_text: |- ### Opdracht @@ -893,17 +812,7 @@ adventures: {else} 'Dat wordt dan €5,50' {print} 'Veel plezier!' ``` - start_code: | - {print} Welkom bij Zwembad Hedy! - les {is} {ask} 'Wil je vandaag een zwemles volgen?' - {if} les ja - {print} 'Mooi! Jij gaat meedoen aan een les!' - {print} {else} 'Je gaat geen zwemles volgen' - korting {is} {ask} 'Heb je een kortingscode?' - {if} korting {is} ja - korting_antwoord {is} {ask} 'Welke kortingscode heb je?' - kortingscode = Senior4231, Student8786, NewMember6709 - {if} korting_antwoord {is} {in} kortingscode + {print} 'Dat wordt dan €3,50' {else} 'Die code is niet geldig' {else} 'Dat wordt dan €5,50' @@ -930,19 +839,7 @@ adventures: totaall = prijs + aantal producten {print} 'Dat wordt dan €' prijs 'alstublieft' ``` - start_code: | - {print} 'Snackautomaat' - gekozen_product = {ask} 'Maak een keuze' - 1_euro_producten = cola sinas sap water - 2_euro_producten = chocolade, koekje, museli reep - 3euro_prodcuten = chips, gezouten nootjes, bananenbrood - {if} gekozen {is} {in} 1_euro_producten - prijs = 1 - {if} gekozen_product {is} 2_euro_producten - prijs = 2 - {else} gekozen_product {in} 3_euro_producten - prijs = 3 - aantal_producten = '{ask} Hoeveel ' gekozen_product wilt u hebben?' + totaall = prijs + aantal producten {print} 'Dat wordt dan €' prijs 'alstublieft' 7: @@ -958,11 +855,6 @@ adventures: 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 @@ -987,10 +879,7 @@ adventures: {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} @@ -1027,19 +916,7 @@ adventures: prijs = aantal * 6 {print} 'Dat wordt dan 'prijs euro' alstublieft' ``` - start_code: | - {print} 'Welkom bij onze broodjeszaak' - aantal 'Hoeveel broodjes wilt u bestellen?' - {repeat} aantal {times} - {ask} {is} {ask} 'Welk soort brood wilt u?' - soorten_brood {is} wit, bruin, rogge, knoflook, glutenvrij - {if} gekozen_brood in soorten_brood - {print} 'Super!' - {else} - 'Sorry, dat hebben we niet' - extras {is} {ask} 'Wilt u daar nog extra's op?' - saus {is} {ask} 'Welke saus wilt u?' - {print} Een gekozen_brood met extras en saus. + prijs = aantal * 6 {print} 'Dat wordt dan 'prijs euro' alstublieft' 10: @@ -1054,11 +931,6 @@ adventures: {for} naam {is} namen {print} Op het strand vindt naam het leuk om to activiteit at random ``` - start_code: | - namen = Muad Hasan Samira Noura - activiteiten = vliegeren, zwemmen, wandelen, baden in de zon - {for} naam {is} namen - {print} Op het strand vindt naam het leuk om to activiteit at random 11: story_text: "### Opdracht\nDebug dit kalender-programma. De uitvoer van het programma moet eruitzien als een lijst van datums.\nBijvoorbeeld:\n\n```\nHedy kalender\nHier zijn alle dagen van november\n1 november \n2 november \n3 november \n```\nEnzovoort.\n\nLet op! Test je code voor de\ \ maand februari extra goed, want het aantal dagen in deze maand verandert in schrikkeljaren." @@ -1085,26 +957,6 @@ adventures: for i in range 1 to dagen print i maand ``` - start_code: | - print 'Hedy kalender' - maanden_met_31 dagen = januari, maart, mei, juli, september, october, december - maanden_met_30_dagen = april, juni, augustus, november - maand = ask 'Welke maand wil je zien?' - if maand in maanden_met_31_dagen - dagen = 31 - if maand in maanden_met30_dagen - dagen = 30 - if maand = februari - schrikkeljaren = 2020, 2024, 2028, 2036, 2040, 2044, 2028 - jaar = ask 'Welk jaar is het?' - if jaar in schrikkeljaren - dagen = 29 - else - dagen = 28 - - print 'Hier zijn alle dagen van ' maand - for i in range 1 to dagen - print i maand 12: story_text: |- ### Opdracht @@ -1133,27 +985,6 @@ adventures: for i in range 0 to mensen call groet_klant ``` - start_code: | - define groet - begroetingen = 'Hallo', 'Hoi!', 'Goedenavond' - print begroetingen at random - - define bestelling - eten = ask 'Wat wil je eten?' - print 'Een eten' - drinken = 'Wat wil je drinken?' - print 'Een ' drinken - extra = ask 'Wil je daar nog iets bij?' - if extra is 'nee' - print 'Oke' - else - print 'En ' extra - print 'Dankjewel' - - print 'Welkom bij ons restaurant' - mensen = ask 'Met hoeveel personen bent u?' - for i in range 0 to mensen - call groet_klant 13: story_text: |- ### Exercise @@ -1186,31 +1017,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1240,9 +1046,7 @@ adventures: 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?' @@ -1299,36 +1103,6 @@ adventures: 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 @@ -1478,7 +1252,6 @@ adventures: Als je een code hebt getypt in het invoerscherm kun je op de knop 'Voer de code uit' klikken. Je programma wordt dan uitgevoerd in het uitvoerscherm. Klaar om te leren programmeren? Ga dan snel naar het eerste avontuur in het volgende tabje! - start_code: '{print} hallo wereld!' 2: story_text: | Gefeliciteerd! Je bent door naar level 2. Hopelijk heb je al wat coole codes gemaakt! @@ -1500,14 +1273,12 @@ adventures: Dat verandert gelukkig in dit level. In level 2 leer je werken met variabelen. Hiermee kun je meerdere stukjes informatie opslaan èn kun je het overal in de zin plaatsen waar je wil. Op naar het volgende avontuur! - start_code: '{print} hello world!' 3: story_text: | In het vorige level heb je geleerd wat een variabele is en hoe je avonturen wat interactiever kunt maken. Maar... Dat is niet het enige wat je kunt doen met variabelen! Je kunt met variabelen ook lijstjes maken. En je kunt Hedy een willekeurig item van het lijstje laten kiezen, waardoor je echte spelletjes kunt programmeren! Ga maar snel naar het volgende avontuur! - start_code: '{print} hello world!' 4: story_text: | In de vorige levels heb je geoefend met variabelen, maar misschien ben je dit probleem tegengekomen. @@ -1527,9 +1298,6 @@ adventures: naam {is} Sophie {print} Mijn naam is naam ``` - start_code: | - naam {is} Sophie - {print} Mijn naam is naam 5: story_text: | In de voorgaande levels heb je geleerd om met `{at} {random}` te werken. Hierdoor kun je spelletjes maken waarbij er steeds een andere uitkomst is. @@ -1541,9 +1309,6 @@ adventures: ``` wachtwoord {is} {ask} 'Wat is het juiste wachtwoord?' ``` - start_code: |- - naam {is} {ask} 'Hoe heet jij?' - {if} naam {is} Hedy {print} 'cool!' {else} {print} 'meh' 6: story_text: | In het vorige level heb je geoefend met `{ask}` en `{if}`. Zo heb je in het restaurant bijvoorbeeld aan je klanten gevraagd wat ze wilden eten. @@ -1567,7 +1332,6 @@ adventures: totaal_prijs {is} eten_prijs + drinken_prijs {print} 'Dat wordt dan ' totaal_prijs ' euro, alstublieft' ``` - start_code: '# Schrijf jouw code hier' 7: story_text: | Goed gedaan! Je bent bij het volgende level, wat betekent dat je goed geoefend hebt met `{if}` en `{else}`. Waarschijnlijk heb je al gemerkt dat je codes steeds langer worden. @@ -1581,11 +1345,6 @@ adventures: {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: | Je hebt nu één regel code leren herhalen. Dat is handig, maar niet altijd genoeg. Soms wil je een groepje van meerdere codes een paar keer herhalen. @@ -1594,7 +1353,6 @@ adventures: ``` {repeat} 5 {times} {print} 'In het volgende avontuur leer je meerdere regels herhalen!' ``` - start_code: '{print} ''Op naar het volgende avontuur!''' 9: story_text: | Fantastisch! Je bent alweer bij een nieuw level! In de vorige levels leerde je meerdere regels code in een blokje zetten met een {if} of {repeat} commando. Maar je kon ze nog niet allebei tegelijk gebruiken... @@ -1609,7 +1367,6 @@ adventures: {print} 'Joepie!' {else} {print} 'Nee? Oefen dan nog even door in het vorige level' - start_code: '{print} Op naar het volgende avontuur!' 10: story_text: | Wat ben jij goed bezig! In het vorige level ben je misschien tegen een klein probleempje aangelopen. Je hebt geleerd hoe je regels kunt herhalen, maar wat als je ze elke keer net ietsje ander wil. @@ -1625,12 +1382,10 @@ adventures: {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} ''Op naar het volgende avontuur!''' 11: story_text: | Je bent al ver gekomen! Goedzo! In de hogere levels gaat de Hedy programmeertaal steeds meer op Python lijken. In Python bestaat het `{repeat}` commando niet, maar er is wel een commando dat werkt zoals {repeat}. Ben je benieuwd hoe je`{repeat}` zegt in Pythontaal? Ga dan naar het volgende avontuur! - start_code: '{print} ''Op naar het volgende avontuur!''' 12: story_text: | Misschien heb je in een van je programma's al eens geprobeerd om kommagetallen te gebruiken, bijvoorbeeld bij je restaurant. Als je dat gedaan hebt, dan ben je er achtergekomen dat Hedy die kommagetallen steeds afrondde. @@ -1643,7 +1398,6 @@ adventures: print 'Je hebt een burger en drinken besteld' print 'Dat kost ' totaal ' euro alstublieft' ``` - start_code: '{print} ''Op naar het volgende avontuur!''' 13: story_text: | In vorige levels heb je geleerd hoe je twee `{if}`commando's in elkaar kan stoppen. Dit werk prima, maar het kan wel resulteren in lange onhandige codes zoals deze: @@ -1663,7 +1417,6 @@ adventures: {else} {print} 'Toegang geweigerd!' ``` - start_code: '{print} ''Op naar het volgende avontuur!''' 14: story_text: | Met het programma hiernaast kun je berekenen of je je schoolvak wel of niet hebt gehaald (dus, of je een 6 of hoger hebt gehaald). @@ -1680,12 +1433,6 @@ adventures: {else} {print} 'Hoera! Je haalt het vak!' ``` - start_code: | - antwoord = {ask} 'Wil je nog meer leren?' - {if} antwoord == 'ja' - {print} 'Ga naar het volgende avontuur!' - {if} antwoord != 'ja' - {print} 'Dat is jammer!' 15: story_text: | In het spelletje hiernaast kan de speler erg lang blijven spelen... @@ -1703,7 +1450,6 @@ adventures: {if} antwoord == 'ja' {print} 'Ok dan ga ik door' ``` - start_code: '{print} ''Op naar het volgende avontuur!''' 16: story_text: | In dit level komen we weer een stukje dichter bij Pythoncode. Je gaat leren hoe je twee lijstjes met elkaar kunt matchen. @@ -1725,14 +1471,12 @@ adventures: {print} 'Een ' dier ' zegt ' geluid ``` Let op: Deze code werkt niet in dit level. Ga naar het volgende tabblad en leer hoe je dit moet repareren. - start_code: '{print} ''Op naar het volgende avontuur!''' 17: story_text: | Nu maken we nog een kleine verandering bij het inspringen. Elke keer als we moeten inspringen, gebruiken we een `:` bij de regel erboven. In dit level leer je ook een nieuw commando `{elif}`. `{elif}` is een samentrekking van {else} en {if} voor als je 3 of meer opties wilt programmeren. Kijk maar in het volgende avontuur! - start_code: '{print} ''Op naar het volgende tabblad!''' 18: story_text: | Hoera! Je hebt het einde van Hedy bereikt! De codes die je hier in het laaste level maakt kun je kopiëren naar andere Python omgevingen, zoals replit or PyCharm. Daar kun je verder Python leren! @@ -1762,16 +1506,12 @@ adventures: ``` keuze {is} _ ``` - start_code: | - keuzes {is} 1, 2, 3, 4, 5, regenworm - {print} Jij gooide _ {at} {random} ! 4: story_text: | Ook in dit level kun je een dobbelsteen maken. Maar nu mag je het zelf proberen, zonder voorbeeld! ### Opdracht Programmeer een dobbelsteen. Tip: Weet je niet hoe? Spiek dan bij jouw dobbelsteen uit het vorige level, maar vergeet de aanhalingstekens niet. - start_code: '{print} ''Wat zal de dobbelsteen deze keer aangeven?''' 5: story_text: | Je kunt ook in dit level weer een dobbelsteen maken en daarbij de `{if}` en `{else}` gebruiken. @@ -1786,7 +1526,6 @@ adventures: _ worp {is} regenworm {print} 'Je mag stoppen met gooien.' _ {print} 'Je moet nog een keer hoor!' ``` - start_code: '{print} ''Wat zal de dobbelsteen deze keer aangeven?''' 6: story_text: | Je kunt nu weer een regenwormendobbelsteen maken, maar nu kun je ook uitrekenen hoeveel punten er gegooid zijn. @@ -1807,7 +1546,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''Wat zal de dobbelsteen deze keer aangeven?''' 7: story_text: | Je kunt ook in dit level weer een dobbelsteen maken. Met de `{repeat}` code kun je makkelijk een heel handje dobbelstenen rollen. @@ -1819,7 +1557,6 @@ adventures: keuzes = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''Wat zal de dobbelsteen deze keer aangeven?''' 10: story_text: | ### Opdracht @@ -1833,7 +1570,6 @@ adventures: {print} speler ' gooit ' keuzes {at} {random} {sleep} ``` - start_code: '# Schrijf jouw code hier' 15: story_text: | ### Opdracht @@ -1858,7 +1594,6 @@ adventures: _ {print} 'Hoera! Je hebt 6 gegooid in ' pogingen ' pogingen.' ``` - start_code: '# Schrijf jouw code hier' dishes: name: Afwas? default_save_name: Afwas @@ -1879,7 +1614,6 @@ adventures: Daarna bedenk je een taak die gedaan moet worden en laat je de computer kiezen wie de taak moet doen met het `{at} {random}` commando. **Extra** Heb jij geen zin om de afwas te doen? Hack dan het programma door jouw naam van het lijstje te halen met `{remove}`. - start_code: '{print} Wie doet de afwas?' 4: story_text: | Met aanhalingstekens kun je je afwasprogramma beter maken. @@ -1893,7 +1627,6 @@ adventures: {print} _ de afwas wordt gedaan door _ {print} mensen {at} _ ``` - start_code: '{print} ''Wie doet de afwas?''' 5: story_text: | Met de `{if}` kun je jouw programma nu nog leuker maken. Je kan je programma laten reageren op de keuze. @@ -1907,7 +1640,6 @@ adventures: _ afwasser {is} Sophie {print} _ chips ik moet de afwas doen _ _ {print} ' gelukkig geen afwas want ' _ ' wast al af' ``` - start_code: '{print} ''Wie doet de afwas?''' 6: story_text: | Hoe vaak gaat iedereen eigenlijk afwassen? Is dat wel eerlijk? Dat kun je nu tellen. @@ -1938,7 +1670,6 @@ adventures: {print} 'Dinsdag is de afwasser: ' afwasser {remove} afwasser {from} mensen ``` - start_code: '{print} ''Wie doet de afwas?''' 7: story_text: | Met de `{repeat}` kun je stukjes code herhalen. Daarmee kun je dan voor meerdere dagen uitrekenen wie er aan de beurt is voor de afwas. @@ -1950,7 +1681,6 @@ adventures: mensen = mama, papa, Emma, Sophie {repeat} _ _ {print} 'De afwasser is ' _ _ _ ``` - start_code: '{print} ''Wie doet de afwas?''' 10: story_text: | In dit level kun je je afwasrooster nog makkelijker programmeren en het rooster netjes voor de hele week uitprinten. @@ -1965,11 +1695,6 @@ adventures: {for} dag {in} dagen {print} 'Op ' dag ' doet ' namen {at} {random} ' de afwas.' ``` - start_code: | - dagen = maandag, dinsdag, woensdag, donderdag, vrijdag, zaterdag, zondag - namen = mama, papa, Emma, Sophie - {for} dag {in} dagen - {print} 'Op ' dag ' doet ' namen {at} {random} ' de afwas.' elif_command: name: '{elif}' default_save_name: alsanders @@ -2017,10 +1742,6 @@ adventures: {for} dier {in} dieren {print} dier ' is een leuk dier!' ``` - start_code: |- - dieren {is} hond, kat, papegaai - {for} dier {in} dieren - {print} dier ' is een leuk dier!' 11: story_text: |- We gaan nu een extra vorm van de `{for}` toevoegen! In vorige levels gebruikten we de `{for}` altijd met een lijst. Maar nu mag je `{for}` ook gebruiken met getallen. @@ -2033,10 +1754,6 @@ adventures: {print} i {print} 'Wie niet weg is, is gezien' ``` - start_code: |- - {for} i {in} {range} 1 {to} 10 - {print} i - {print} 'Wie niet weg is, is gezien' 17: story_text: | Er komt nu een kleine verandering in het inspringen. Elke keer als er moet worden ingesprongen, moet je een `:` typen in de regel daarvoor. @@ -2073,7 +1790,6 @@ adventures: ### Opdracht Kopieer de voorbeeldcode naar jouw invoerscherm met de gele knop en vul de commando's in op de lijntjes om de code te laten werken. **Extra** Pas de code aan en laat de waarzegger niet alleen je naam voorspellen, maar ook iets anders. Zoals je leeftijd, woonplaats, favoriete sportteam of iets anders over jezelf. - start_code: '# Maak jouw eigen code hier' 3: story_text: | In het vorige level heb je een begin gemaakt aan de waarzegger, maar echt voorspellingen waren er nog niet. @@ -2092,7 +1808,6 @@ adventures: story_text_2: | ### Opdracht Er zijn nu maar 3 antwoordopties waar Hedy uit kan kiezen, kun jij er meer toevoegen? Bijvoorbeeld: zeker weten, geen idee of probeer het nog eens! - start_code: '# Schrijf jouw code hier' 4: story_text: | In dit level kun je oefenen met de aanhalingstekens. @@ -2113,7 +1828,6 @@ adventures: {sleep} 2 {print} antwoorden {at} {random} ``` - start_code: '# Schrijf jouw code hier' 5: story_text: | ##Opdracht @@ -2136,7 +1850,6 @@ adventures: {if} persoon {in} vrienden {print} goed_antwoord {at} {random} {else} {print} fout_antwoord {at} {random} ``` - start_code: '# Schrijf jouw code hier' 6: story_text: | In dit level kun je rekenen met Hedy, waardoor je "magische" formules kunt gebruiken in je voorspellingen! @@ -2159,7 +1872,6 @@ adventures: {sleep} 2 {print} kinderen ' kinderen!' ``` - start_code: '# Schrijf jouw code hier' 7: story_text: | ### Opdracht @@ -2172,7 +1884,6 @@ adventures: opties = ook verliefd op jou, niet verliefd op jou _ _ _ _ 'Jouw geliefde is ' opties {at} {random} ``` - start_code: '# Schrijf jouw code hier' 8: story_text: | In het volgende voorbeeld kan Hedy na een vraag meteen een antwoord printen, omdat je nu een heel stuk code mag herhalen. @@ -2190,7 +1901,6 @@ adventures: {sleep} {print} antwoorden {at} {random} ``` - start_code: '# Schrijf jouw code hier' 10: story_text: "In dit level kun je met een druk op de knop het hele leven voorspellen van al je vrienden tegelijk!\n\n### Opdracht \nVul de lege plekken op met code die je in dit level geleerd hebt.\n" example_code: | @@ -2205,7 +1915,6 @@ adventures: {print} naam ' krijgt een ' huisdieren {at} {random} ' als huisdier' {sleep} 2 ``` - start_code: '# Schrijf jouw code hier' 12: story_text: |- Vanaf level 12 moet je in een lijst ook aanhalingstekens gebruiken. @@ -2220,7 +1929,6 @@ adventures: {sleep} 2 {print} voorspellingen {at} {random} ``` - start_code: '# Schrijf jouw code hier' functions: name: Functies default_save_name: functions @@ -2259,21 +1967,6 @@ adventures: {call} draai {sleep} 2 ``` - start_code: | - kanten = 'linker', 'rechter' - ledematen = 'hand', 'voet' - kleuren = 'rood', 'blauw', 'groen', 'geel' - - {define} draai - gekozen_kant = kanten {at} {random} - gekozen_ledemaat = ledematen _ - gekozen_kleur = kleuren _ - {print} gekozen_kant gekozen_ledemaat ' op ' gekozen_kleur - - {print} 'Klaar voor een potje Twister?' - {for} i {in} {range} 1 to _ - {call} draai - {sleep} 2 13: story_text: | Nu je hebt geleerd om functies te gebruiken, leer je dit level hoe je functies kunt gebruiken met argumenten. @@ -2302,13 +1995,6 @@ adventures: {call} lied {with} 'sea' {call} lied {with} 'ocean' ``` - start_code: | - {define} lied {with} plek - {print} 'My Bonnie is over the ' plek - - {call} lied {with} 'ocean' - {call} lied {with} 'sea' - {call} lied {with} 'ocean' 14: story_text: | In de vorige levels heb je geleerd om functies met argumenten te maken. Je kunt functies ook goed gebruiken om iets uit te rekenen. @@ -2332,17 +2018,6 @@ adventures: nieuwe_prijs = _ bereken_nieuwe_prijs with oude_prijs, _ {print} 'De nieuwe prijs is ' nieuwe_prijs ' euro' ``` - start_code: | - {define} bereken_nieuwe_prijs {with} bedrag, percentage - percentage = percentage / 100 - korting_bedrag = bedrag * percentage - {return} bedrag - korting_bedrag - - oude_prijs = {ask} 'Wat staat er op het prijskaartje?' - korting = {ask} 'Hoeveel procent korting krijg je?' - - nieuwe_prijs = _ bereken_nieuwe_prijs with oude_prijs, _ - {print} 'De nieuwe prijs is ' nieuwe_prijs ' euro' guess_my_number: name: Raad mijn getal default_save_name: guess my number @@ -2371,7 +2046,6 @@ adventures: {print} 'Je hebt het getal geraden!' spel = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2393,7 +2067,6 @@ adventures: _ {print} naam ' is goed in ' vakken {at} {random} _ {print} naam 's grootste angst is ' angsten {at} {random} ``` - start_code: '# schrijf jouw code hier' haunted: name: Spookhuis default_save_name: Spookhuis @@ -2425,7 +2098,6 @@ adventures: Kopieer de voorbeeldcode naar jouw invoerscherm door op de gele knop te klikken. Maak het spookverhaal zelf af door minstens 5 regels aan het verhaal toe te voegen. Begin elke regel met een `{print}` commando. - start_code: '{print} Hoe ben ik hier terechtgekomen?' 2: story_text: | In dit spookhuis kun je je monsters kiezen met emojis. Al kun je natuurlijk ook gewoon woorden gebruiken. @@ -2474,7 +2146,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '{print} Ontsnap uit het spookhuis!' 4: story_text: | In dit level heb je geleerd hoe je aanhalingstekens moet gebruiken. @@ -2496,7 +2167,6 @@ adventures: {sleep} {print} monsters {at} {random} ``` - start_code: '{print} ''Ontsnap uit het spookhuis!''' 5: story_text: | Tot nu toe werd er in je spookhuisspel wel altijd aan de speler gevraagd welke deur geopend moest worden, maar zoals je misschien al gemerkt hebt, maakte het niet uit wat voor antwoord de speler gaf. @@ -2518,7 +2188,6 @@ adventures: _ _ _ _ {print} 'Hoera! Je ontsnapt!' {else} {print} 'Oh nee! Je wordt opgepeuzeld door een...' monsters {at} {random} ``` - start_code: '{print} ''Ontsnap uit het spookhuis!''' 9: story_text: | In de vorige levels heb je geleerd hoe je hele stukken code meerdere keren kunt herhalen. Hierdoor kun je levels maken in je spookhuisgame! @@ -2552,7 +2221,6 @@ adventures: {if} speler {is} levend {print} 'Hoera! Je bent ontsnapt!' ``` - start_code: '{print} ''Ontsnap uit het spookhuis!''' 11: story_text: | In dit level hebben we `{for}` aangepast zodat je een speler kan vertellen waar hij is. @@ -2576,7 +2244,6 @@ adventures: {print} 'Kamer ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Ontsnap uit het spookhuis!''' 14: story_text: | ### Opdracht @@ -2605,7 +2272,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# Schrijf jouw code hier' 16: story_text: | ### Opdracht @@ -2639,7 +2305,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# Schrijf jouw code hier' hotel: name: hotel default_save_name: hotel @@ -2670,18 +2335,7 @@ adventures: {call} welkomstbericht {with} titel, naam, afkomst, 105 ``` - start_code: | - {define} welkomstbericht {with} titel, achternaam, afkomst, kamernummer - {print} 'Welkom in Hotel Hedy, ' titel ' ' achternaam - fijne_reis {is} {ask} 'Heeft u een fijne reis gehad vanaf ' afkomst '?' - {if} fijne_reis {is} 'ja' - {print} 'Mooi!' - {else} - {print} 'Wat naar voor u.' - {print} 'Hopelijk kunt u lekker tot rust komen op uw kamer.' - {print} 'Uw kamernummer is ' kamernummer - {print} 'Hallo. Vul uw gegevens in om in te checken.' titel = {ask} 'Wat is uw aanspreekvorm (dhr, mevr, dr, etc.)?' naam = {ask} 'Wat is uw achternaam?' afkomst = {ask} 'Waar komt u vandaan?' @@ -2718,10 +2372,6 @@ adventures: _ _ _ 4 _ 'Goedzo!' _ _ 'Nee 2 + 2 = 4' ``` - start_code: |- - naam {is} {ask} 'hoe heet jij?' - {if} naam {is} Hedy {print} 'leuk' - {else} {print} 'minder leuk!' 8: story_text: | Je hebt al geleerd hoe je een blok aan regels code kunt herhalen met`{repeat}`. @@ -2737,11 +2387,6 @@ adventures: {print} 'Welkom Hedy' {print} 'Jij mag computeren!' ``` - start_code: | - naam = {ask} 'Hoe heet je?' - {if} naam {is} Hedy - {print} 'Welkom Hedy' - {print} 'Jij mag computeren!' 9: story_text: | In dit level kun je een {if} commando in een ander {if} commando stoppen. @@ -2757,16 +2402,6 @@ adventures: {else} {print} 'Je wil niet doorgaan' ``` - start_code: | - doorgaan = {ask} 'Wil je doorgaan?' - {if} doorgaan = ja - zeker = {ask} 'Weet je het zeker?' - {if} zeker {is} ja - {print} 'We gaan door' - {else} - {print} 'Je bent niet zeker' - {else} - {print} 'Je wil niet doorgaan' in_command: name: '{in}' default_save_name: in @@ -2795,11 +2430,6 @@ adventures: _ antwoord _ dieren _ 'Mijne ook!' _ _ 'Mijn lievelingsdieren zijn koeien, schapen en varkens' ``` - start_code: | - mooie_kleuren {is} geel, rood - lievelingskleur {is} {ask} 'Wat is jouw lievelingskleur?' - {if} lievelingskleur {in} mooie_kleuren {print} 'mooi!' - {else} {print} 'mwah' is_command: name: '{is}' default_save_name: is_command @@ -2825,10 +2455,6 @@ adventures: lievelingsdier {is} _ {print} Ik hou van lievelingsdier ``` - start_code: |- - naam {is} Hedy - leeftijd {is} 15 - {print} naam is leeftijd jaar oud. 6: story_text: | We veranderen ook hoe je een woord opslaat in een variabele! Je mag hierbij vanaf nu een `=` in plaats van een `{is}` gebruiken. Kijk maar: @@ -2837,8 +2463,7 @@ adventures: naam = Hedy antwoord = 20 + 4 ``` - start_code: | - naam = Hedy + antwoord = 20 + 4 14: story_text: | @@ -2870,8 +2495,7 @@ adventures: {if} name != 'Hedy' {print} 'Jij bent Hedy niet' ``` - start_code: |- - leeftijd = {ask} 'Hoe oud ben jij?' + {if} leeftijd < 13 {print} 'Dan ben je jonger dan ik!' {else} @@ -2894,7 +2518,6 @@ adventures: {if} kikker {is} grenouille {print} 'Super!' {else} {print} 'Helaas, kikker is grenouille' ``` - start_code: '# Schrijf jouw code hier' 16: story_text: | ### Opdracht @@ -2915,7 +2538,6 @@ adventures: {print} 'Fout, ' franswoord[i] ' betekent ' vertaling[i] {print} 'Je hebt ' score ' goede antwoorden gegeven.' ``` - start_code: '# Schrijf jouw code hier' maths: name: Rekenen default_save_name: rekenen @@ -2956,8 +2578,7 @@ adventures: b = 'wereld!' {print} a + b ``` - start_code: |- - {print} 'kommagetallen gebruiken een punt' + {print} 2.5 + 2.5 parrot: name: Papegaai @@ -2986,11 +2607,6 @@ adventures: {echo} {echo} ``` - start_code: | - {print} Ik ben papegaai Hedy - {ask} Wie ben jij? - {echo} - {echo} 2: story_text: | In het vorige level heb je een papegaai gemaakt die jou napraatte. In dit level maken we die papegaai interactief met een variabele en het `{ask}` commando. @@ -3011,7 +2627,6 @@ adventures: Vul daarna `{sleep}` commando's op andere regels zodat de papegaai soms ook even stil is. **Extra** Je kunt variabelen gebruiken om de papegaai meer te laten zeggen dat alleen je naam. Kun jij deze code afmaken? - start_code: '{print} Ik ben Hedy de papegaai!' 3: story_text: | Leer je papegaai nieuwe woordjes met het `{add}` commando! @@ -3026,7 +2641,6 @@ adventures: {print} 🧒: Zeg nieuw_woord , Hedy! {print} 🦜: woorden {at} {random} ``` - start_code: '# Schrijf jouw code hier' 4: story_text: | In dit level gebruiken we aanhalingstekens bij de commando's `{ask}` en `{print}`. @@ -3041,7 +2655,6 @@ adventures: {print} _ 🧒: Zeg _ nieuw_woord _ , Hedy! _ {print} _ 🦜: _ woorden {at} {random} ``` - start_code: '# Schrijf jouw code hier' 5: story_text: | Beloon je papegaai als hij het nieuwe woordje zegt! @@ -3059,7 +2672,6 @@ adventures: _ gezegd_woord {is} nieuw_woord _ '🧒 Goedzo! 🍪' _ _ '🧒 Nee! Zeg ' nieuw_woord ``` - start_code: '# Schrijf jouw code hier' piggybank: name: Spaarvarken default_save_name: Spaarvarken @@ -3081,7 +2693,6 @@ adventures: weken = prijs / zakgeld {print} 'Je kunt over ' _ ' weken een ' _ ' kopen!' ``` - start_code: '# Schrijf jouw code hier' 14: story_text: | ### Opdracht @@ -3105,7 +2716,6 @@ adventures: {call} _ ``` - start_code: '# Schrijf jouw code hier' pressit: name: Toetsaanslag default_save_name: Toetsaanslag @@ -3129,7 +2739,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# Jouw code komt hier' 7: story_text: | Nu je `{repeat}` hebt geleerd kunnen we meerdere keren kijken of er een toets is ingedrukt. Dat kan je gebruiken om de schildpad te besturen. @@ -3140,7 +2749,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# schrijf jouw code hier' 9: story_text: | We kunnen nu met `{pressed}` een programma maken om typen te oefenen. @@ -3160,7 +2768,6 @@ adventures: _ _ ``` - start_code: '# schrijf jouw code hier' print_command: name: '{print}' default_save_name: print @@ -3186,8 +2793,6 @@ adventures: ``` _ Hallo! ``` - start_code: | - {print} Welkom bij Hedy! 18: story_text: |- We gaan nu echte Python code programmeren! Dat betekent dat we vanaf nu haakjes moeten gebruiken bij `{print}` en `{range}`. @@ -3204,8 +2809,7 @@ adventures: temperatuur = 25 {print}('Het is ', temperatuur, ' graden buiten') ``` - start_code: |- - naam = 'Hedy' + {print}('Mijn naam is ', naam) quizmaster: name: Quizmaster @@ -3237,7 +2841,6 @@ adventures: {if} punten_b > punten_a {print} 'Jij hoort in club B' ``` - start_code: '# Schrijf jouw code hier' quotation_marks: name: '''Aanhalingstekens''' default_save_name: haakjes @@ -3270,10 +2873,6 @@ adventures: {print} 'Daar rijden twee oma's in hun auto's ' {print} 'Zouden zij liever 's middags of 's avonds rijden?' ``` - start_code: |- - {print} 'Vanaf nu gebruik je aanhalingstekens!' - antwoord {is} {ask} 'Wat gebruiken we vanaf nu?' - {print} 'We gebruiken ' antwoord ' vanaf nu' 12: story_text: | **Tekst moet altijd met aanhalingstekens** @@ -3308,10 +2907,6 @@ adventures: score = 25 {print} 'Jij hebt ' score ' gehaald!' ``` - start_code: |- - name = {ask} 'Wie ben jij?' - {if} name = 'Hedy de Robot' - {print} 'Hoi!' random_command: name: '{random}' default_save_name: willekeurig @@ -3345,9 +2940,6 @@ adventures: prijzen {is} _ _ ``` - start_code: | - dieren {is} hond, kat, kangoeroe - {print} dieren {at} {random} 16: story_text: |- We zijn aangekomen bij de laatste paar Hedy levels. We komen dus steeds dichter bij echte Python code. @@ -3400,11 +2992,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is leuk!' ``` - start_code: | - {print} 'Fijne verjaardag voor jou' - {print} 'Fijne verjaardag voor jou' - {print} 'Fijne verjaardag lieve Hedy' - {print} 'Fijne verjaardag voor jou!' 8: story_text: | **Inspringen** @@ -3428,10 +3015,6 @@ adventures: {print} 'INDRINGER!' {print} 'Je kunt deze computer niet gebruiken!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hallo allemaal' - {print} 'Dit wordt allemaal 5 keer herhaald' 9: story_text: | In dit level kun je niet alleen meerdere regels gebruiken bij `{if}` en `{repeat}`, maar je kunt ze ook nog eens in elkaar zetten! @@ -3448,13 +3031,6 @@ adventures: {else} {print} 'pizza is lekkerder' ``` - start_code: |- - {repeat} 3 {times} - eten = {ask} 'Wat wil je bestellen?' - {if} eten {is} pizza - {print} 'lekker' - {else} - {print} 'pizza is lekkerder' repeat_command_2: name: '{repeat} 2' default_save_name: herhaal2 @@ -3479,10 +3055,6 @@ adventures: leeftijd = {ask} 'Hoe oud ben je geworden?' {repeat} leeftijd {times} {print} 'Hieperdepiep Hoera!' ``` - start_code: | - {repeat} 2 {times} antwoord = {ask} 'Wist je al dat je een vraag ook kunt herhalen?' - {if} antwoord {is} ja {repeat} 2 {times} {print} 'Daar was jij al achter!' - {else} {repeat} 3 {times} {print} 'Je hebt weer iets nieuws geleerd!' 8: story_text: | ### In het blok of niet? @@ -3500,11 +3072,6 @@ adventures: _ {print} 'de mosselman' _ {print} 'Zeg ken jij de mosselman? Hij woont in Scheveningen' ``` - start_code: |- - {repeat} 3 {times} - {print} 'Deze regel wordt herhaald...' - {print} 'Deze ook..' - {print} 'maar deze niet!' restaurant: name: Restaurant default_save_name: Restaurant @@ -3528,7 +3095,6 @@ adventures: Voeg daarna zelf minstens 4 regels code toe aan het restaurantprogramma. Vraag de klanten wat ze willen drinken en vraag of ze willen pinnen. Bedenk tot slot een aardige manier om de klant gedag te zeggen. - start_code: '# Schrijf jouw code hier' 2: story_text: | In level 2 kun je variabelen gebruiken om je restaurant interactiever te maken! Kijk maar naar het voorbeeld. @@ -3552,7 +3118,6 @@ adventures: Voeg nu in jouw code ook zo'n opsomming toe van het eten en het drinken dat de klant heeft besteld. **Extra** Nu je variabelen hebt leren gebruiken, kun je zoveel variabelen als je wil toevoegen aan één regel. Kun jij nog meer variabelen toevoegen aan je regel, zoals hier opeten of meenemen, pinnen of cash, met of zonder rietje etc.? - start_code: '# Schrijf jouw code hier' 3: story_text: | Vind jij het moeilijk om te kiezen wat je wil eten? Je kunt Hedy voor je laten kiezen! @@ -3580,7 +3145,6 @@ adventures: prijzen {is} _ _ ``` - start_code: '# Schrijf jouw code hier' 4: story_text: "Ook in het restaurant moet je aanhalingstekens gebruiken bij de commando's `{print}` en `{ask}` .\n\n### Opdracht\nKun jij de voorbeeldcode aan de praat krijgen door aanhalingstekens toe te voegen? Let op: variabelen moeten niet binnen de aanhalingstekens staan. \nVoeg daarna\ \ `{clear}` commando's toe om steeds maar 1 regel tekst in je uitvoerscherm te hebben.\n\n### Opdracht 2\nKopieer je eigen restaurantcode van het vorige level en zet aanhalingstekens op de juiste plaats. Voeg ook `{clear}` commando's toe.\n" @@ -3597,7 +3161,6 @@ adventures: {print} Bedankt voor de bestelling. {print} Jouw eten en drank komen er zo aan! ``` - start_code: '# Schrijf jouw code hier' 5: story_text: | ###Opdracht @@ -3614,7 +3177,6 @@ adventures: {if} drank {in} drank_voorraad {print} 'Een ' drank 'komt eraan!' {else} {print} 'Sorry, dat hebben we niet' ``` - start_code: '# Schrijf jouw code hier' 6: story_text: | In dit level kun je in jouw restaurant prijzen toevoegen en berekenen, dat maakt het veel echter! @@ -3642,7 +3204,6 @@ adventures: {print} 'Dat is dan ' prijs ' euro, alstublieft!' {print} 'Bedankt en eet smakelijk!' ``` - start_code: '{print} ''Welkom''' 7: story_text: | In dit level heb je geleerd hoe je `{repeat}` gebruikt om een regel code een aantal keren te herhalen. @@ -3656,7 +3217,6 @@ adventures: {print} 'Welkom bij restaurant Hedy' mensen = {ask} 'Met hoeveel personen bent u?' ``` - start_code: '# Schrijf jouw code hier' 8: story_text: | In dit level kun je meerdere regels code herhalen, wat betekent dat je meerdere mensen kunt vragen wat ze willen eten en drinken en dat ook nog kunt printen. @@ -3673,7 +3233,6 @@ adventures: {print} 'Eet smakelijk!' ``` story_text_2: "### Opdracht\nBreid je code uit met meer dingen op het menu. Bijvoorbeeld: vragen of ze drinken willen, of toetjes. Voeg minstens nog een extra vraag toe. \n**Extra** Voeg alles toe aan het menu dat je kan verzinnen, zoveel dingen als je wil!\n" - start_code: '{print} ''Welkom bij McHedy!''' 9: story_text: | In dit level kun je het restaurant nog beter maken. @@ -3707,7 +3266,6 @@ adventures: {print} 'Dat is dan ' prijs ' euro' {print} 'Eet smakelijk!' ``` - start_code: '# Schrijf jouw code hier' 10: story_text: | In dit level kun je gemakkelijk de bestelling opnemen van gasten voor verschillende gangen. @@ -3754,7 +3312,6 @@ adventures: {print} 'Dus u wilt bestellen voor ' mensen ' mensen.' {print} 'Laten we beginnen' ``` - start_code: '{print} ''Welkom bij McHedy!''' 12: story_text: | In dit level kun je kommagetallen gebruiken op je menukaart, kijk maar! @@ -3775,7 +3332,6 @@ adventures: prijs = prijs + 2.35 {print} 'Dat wordt dan ' prijs ' euro, alsjeblieft' ``` - start_code: '# Schrijf jouw code hier' 13: story_text: | In dit level leer je nieuwe commando's om je code nog verder uit te breiden. @@ -3799,7 +3355,6 @@ adventures: {print} 'Dat is een gezonde keuze!' {print} 'Dat wordt dan ' prijs ' euro' ``` - start_code: '# Schrijf jouw code hier' 15: story_text: | Met de `{while}` kun je zorgen dat je klanten kunnen blijven bestellen tot ze klaar zijn. @@ -3815,7 +3370,6 @@ adventures: meer = {ask} 'Wilt u nog iets bestellen?' {print} 'Bedankt!' ``` - start_code: '# Schrijf jouw code hier' rock: name: Steen, papier, schaar default_save_name: Steen @@ -3844,9 +3398,6 @@ adventures: {ask} kies uit: _ {echo} Dus jouw keuze was : ``` - start_code: | - {print} Welkom bij jouw eigen steen papier schaar! - {ask} Kies uit steen, papier of schaar 2: story_text: | In dit level kun je variabelen gebruiken om alvast een stukje van het spelletje te programmeren. In het volgende level leer je het spelletje maken. @@ -3858,7 +3409,6 @@ adventures: keuze {is} steen {print} ik kies _ ``` - start_code: '# Schrijf jouw code hier' 3: story_text: | Je kunt het `{at} {random}` commando gebruiken om de computer steen, papier of schaar te laten kiezen! @@ -3878,13 +3428,11 @@ adventures: speler_1 {is} {ask} Naam van speler 1: _ ``` - start_code: '{print} Welkom bij jouw eigen steen papier schaar!' 4: story_text: | In dit level kunnen we steen, papier, schaar verder programmeren. Maar als je er tekst bij wilt, moet je ook hier nu aanhalingstekens gebruiken. ### Opdracht Kopieer je code uit het vorige level en maak hem werkend in dit level door bij elk `{print}` en `{ask}` commando aanhalingstekens te gebruiken. - start_code: '{print} ''Welkom bij jouw eigen steen papier schaar!''' 5: story_text: | In dit level kunnen we gaan bepalen of het gelijkspel is. Daarvoor heb je de nieuwe `{if}` code nodig. @@ -3906,7 +3454,6 @@ adventures: ``` Vul op de streepjes eerst de goede code aan om te kijken of het gelijkspel is. - start_code: '{print} ''Welkom bij jouw eigen steen papier schaar!''' 9: story_text: | In dit level kun je het hele steen, papier, schaar programma maken door de `{if}` commando's in elkaar te zetten! @@ -3932,7 +3479,6 @@ adventures: {print} 'De computer wint!' # Maak deze code af ``` - start_code: '# Schrijf jouw code hier' 10: story_text: | ### Opdracht @@ -3943,7 +3489,6 @@ adventures: spelers = _ {for} _ ``` - start_code: '# Schrijf jouw code hier' 13: story_text: | Met het `{and}` commando kun je steen, papier, schaar met veel minder regels programmeren. Kijk maar eens naar de voorbeeldcode. @@ -3964,7 +3509,6 @@ adventures: {if} computer_keuze {is} 'steen' {and} jouw_keuze {is} 'schaar' _ ``` - start_code: '# Schrijf jouw code hier' 15: story_text: | ### Opdracht @@ -3987,7 +3531,6 @@ adventures: gewonnen = 'ja' _ ``` - start_code: '# Schrijf jouw code hier' rock_2: name: Steen, papier, schaar 2 default_save_name: Steen2 @@ -4004,7 +3547,6 @@ adventures: keuze {is} _ {print} Ik kies keuze ``` - start_code: '# schrijf jouw code hier' secret: name: Geheim agent default_save_name: Geheim agent @@ -4027,7 +3569,6 @@ adventures: tijd = 'vandaag om 10:00' {print} _ _ ``` - start_code: '# Schrijf jouw code hier' 13: story_text: | We kunnen nu met maar één `{if}` bekijken of het programma gebruikt wordt door de geheim agent. @@ -4045,7 +3586,6 @@ adventures: {else} {print} 'Ga naar het treinstation om 10:00' ``` - start_code: '# Schrijf jouw code hier' sleep_command: name: '{sleep}' default_save_name: slaap @@ -4063,10 +3603,6 @@ adventures: {sleep} 2 {print} groen! ``` - start_code: | - {print} Mijn favoriete kleur is... - {sleep} 2 - {print} groen! songs: name: Zing een liedje! default_save_name: Liedje @@ -4105,7 +3641,6 @@ adventures: {print} 'BLUB BLUB BLUB BLUB BLUB BLUB BLUB BLUB BLUB BLUB BLUB BLUB BLUB' {sleep} ``` - start_code: '{print} ''Zing een liedje!''' 7: story_text: | In liedjes zit vaak veel herhaling. Denk maar aan Baby Shark! Ze zingen steeds hetzelfde: @@ -4124,7 +3659,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: story_text: | Nu kun je meerdere regels herhalen, wat heel fijn is in liedjes! @@ -4146,7 +3680,6 @@ adventures: {print} 'Maar hij moest de boeven vangen, dus koos hij een ander beest' {print} 'en nu mag je zelf bedenken wat voor beest dat is geweest!' ``` - start_code: '# Schrijf jouw code hier' 10: story_text: "Ook in dit level kunnen we weer liedjes zingen, bijv. Baby Shark. Met `{for}` kunnen we het liedje met maar 6 regels code printen. \n\n### Opdracht 1\nKun jij baby shark printen met een `{for}`? Vul de streepjes in en maak de codes verder af.\n" example_code: "```\nfamilie = baby, mama, papa, opa, oma\n_ _ _ _ \n {print} _\n```\n" @@ -4159,7 +3692,6 @@ adventures: ``` visjes = 10, 9, 8, 7, 6, 5, 4, 3, 2 ``` - start_code: '# Schrijf jouw code hier' 11: story_text: | In dit level kun je makkelijk (af)tellen in een liedje. Zo kun je bijvoorbeeld het kinderliedje '10 kleine visjes' programmeren. @@ -4174,7 +3706,6 @@ adventures: _ _ _ _ 10 _ 1 {print} i ' kleine visjes zwommen naar de zee' ``` - start_code: '# Schrijf jouw code hier' 12: story_text: | In dit level kun je meerdere woorden in een variabele opslaan. Dat komt goed uit bij liedjes zoals het Engelse kinderliedje 'if you're happy and you know it, clap your hands'. @@ -4193,7 +3724,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# Schrijf jouw code hier' 13: story_text: | In het vorige avontuur heb je geleerd hoe je een argument kunt gebruiken in een functie, maar wist je ook dat je dit kunt combineren met een `{ask}`? @@ -4210,16 +3740,6 @@ adventures: {call} lied {with} synoniem {call} lied {with} gekozen_plek ``` - start_code: | - {define} lied {with} plek - {print} 'My Bonnie is ' plek - - gekozen_plek = {ask} 'Waar is Bonnie?' - synoniem = {ask} 'Wat een is daar een ander woord voor?' - - {call} lied {with} gekozen_plek - {call} lied {with} synoniem - {call} lied {with} gekozen_plek 16: story_text: | Maak het nog makkelijker om een liedje te programmeren zoals old MacDonald! Je kunt nu de dieren en hun geluiden aan elkaar koppelen, door ze op dezelfde plaats in het lijstje te zetten. @@ -4255,7 +3775,6 @@ adventures: {print} 'HELA HUP! daar gaat ie!' {print} 's morgens in de vroegte' ``` - start_code: '# Schrijf jouw code hier' 18: story_text: | In level 16 hebben we liedjes met lijsten gemaakt. Maar, deze codes doen het nu niet meer goed. De dubbele punten uit level 17 en de haakjes uit level 18 moeten er nog bij. @@ -4277,7 +3796,6 @@ adventures: {print} 'HELA HUP! daar gaat ie!' {print} 's morgens in de vroegte' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Zing nog een lied! default_save_name: Song 2 @@ -4299,15 +3817,6 @@ adventures: {print} 'die drinkt zijn melk zo zoetjes' {call} _ ``` - start_code: | - {define} slaap - {print} 'Slaap kindje slaap' - {print} _ - - {call} slaap - {print} 'Een schaap met witte voetjes' - {print} 'die drinkt zijn melk zo zoetjes' - {call} _ tic: name: Boter Kaas en Eieren default_save_name: Boter @@ -4334,7 +3843,6 @@ adventures: {else} speler = 'x' ``` - start_code: '# Schrijf jouw code hier' 14: story_text: "In de vorige levels heb je het spel \"boter, kaas en eieren\" kunnen maken. Nu heb je het = teken, het == teken en het != teken geleerd. \nJe kunt deze kennis toepassen in het \"boter, kaas en eieren\" spel op deze manier:\n" example_code: | @@ -4395,7 +3903,6 @@ adventures: {else} teken = 'x' ``` - start_code: '# Schrijf jouw code hier' 15: story_text: | In dit level kun je jouw spel nog meer verbeteren door gebruik te maken van de {while} lus. Met deze lus kun je de twee regels `{if} game != 'over'` en `{for} i {in} {range} 1 to 9` combineren tot één simpele regel. @@ -4458,7 +3965,6 @@ adventures: {else} teken = 'x' ``` - start_code: '# schrijf jouw code hier' 17: story_text: "In de vorige levels was je boter kaas en eieren spel nog vervelend om te spelen. Na elke x of o die je zette vroeg het spel namelijk of je gewonnen had of niet. \nDit maakte het spel wel speelbaar, maar erg traag. In dit level heb je het `{elif}` commando geleerd, dat dit\ \ probleem kan oplossen. \nMet `{elif}` kun je Hedy laten checken of er een speler gewonnen heeft. Hiervoor heb je wel wat extra regels nodig.\n\nIn de voorbeeld code zie je dat we de voorwaarden om te winnen (3 op een rij)hebben toegevoegd. \nJe vindt ze op regel 46 tot 69. Je kunt\ @@ -4540,7 +4046,6 @@ adventures: {else}: teken = 'x' ``` - start_code: '# schrijf jouw code hier' turtle: name: Tekenen default_save_name: Schildpad @@ -4561,9 +4066,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | In dit level kun je variabelen gebruiken om de teken-schildpad interactief te maken. Je kunt bijvoorbeeld aan de speler vragen hoeveel stapjes de schildpad moet nemen. @@ -4583,11 +4085,6 @@ adventures: hoek {is} 90 {turn} hoek {forward} 25 - start_code: |- - {print} Schildpaddenrace! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | Ook bij je teken-schildpad kun je `{at} {random}` gebruiken! Dan loopt hij steeds een ander pad. @@ -4601,10 +4098,6 @@ adventures: {turn} hoeken {at} {random} {forward} 25 ``` - start_code: |- - hoeken {is} 10, 50, 90, 150, 250 - {turn} hoeken {at} {random} - {forward} 25 4: story_text: | In dit level moet je aanhalingstekens gebruiken bij `{print}` en `{ask}`. Ook bij het tekenen dus! @@ -4631,11 +4124,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Figuren tekenen' - hoek {is} 90 - {turn} hoek - {forward} 25 5: story_text: | In dit level kun je met `{if}` een keuze maken. Bijvoorbeeld tussen verschillende soorten figuren. @@ -4668,12 +4156,6 @@ adventures: {if} richting {is} rechts {turn} _ {forward} 100 ``` - start_code: |- - {print} 'Figuren tekenen' - figuur {is} {ask} 'Wil je een vierkant of een driehoek?' - {if} figuur {is} driehoek hoek {is} 120 {else} hoek {is} 90 - {turn} hoek - {forward} 25 6: story_text: | In dit level kun je gaan rekenen en kun je daarmee verschillende figuren tekenen. @@ -4697,7 +4179,6 @@ adventures: {forward} 50 {turn} hoek ``` - start_code: '{print} ''Figuren tekenen''' 8: story_text: "Nu we meerdere regels kunnen herhalen, kunnen we makkelijker figuren maken.\nWant we hoeven maar één keer in te stellen wat de hoek is, en die variabele steeds gebruiken in de `{repeat}`.\n\n### Opdracht 1\n De voorbeeldcode tekent een vierkant. Verander dat in een ander figuur\ \ zoals een driehoek of zeshoek. Je moet daarvoor twee regels veranderen!\nTip: een heel rondje is 360 graden. \n\n### Opdracht 2\nMaak nu een tekening naar je eigen inzicht, met minstens twee verschillende veelhoeken.\n" @@ -4738,7 +4219,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: "In dit level kun je de teken-schildpad een figuur laten tekenen. \nDe schildpad volgt de afstanden in de lijst één voor één, waarbij de stappen steeds groter worden.\n### Opdracht 1\nVoeg een turn van 90 graden toe aan de code om een spiraal te tekenen.\nVoeg ten minste 5\ \ getallen toe aan de lijst, zodat de spiraal steeds groter wordt.\n **(extra)** Kan jij de spiraal in een andere vorm veranderen? Probeer verschillende getallen met turn!\n### Opdracht 2\nDe spiraal wordt nu van binnen naar buiten getekend, kun jij dit omdraaien?\n" @@ -4750,7 +4230,6 @@ adventures: {forward} afstand ``` ``` - start_code: '# Write your code here' 12: story_text: | We kunnen functies gebruiken om complexere figuren te tekenen met minder code. @@ -4775,16 +4254,6 @@ adventures: {forward} 50 {call} vierkant ``` - start_code: | - {define} vierkant - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} vierkant - {forward} 50 - {call} vierkant - {forward} 50 - {call} vierkant turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4800,7 +4269,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4811,7 +4279,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4822,7 +4289,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4840,7 +4306,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4859,7 +4324,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4879,7 +4343,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4890,7 +4353,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4903,7 +4365,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4934,7 +4395,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4975,7 +4435,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4998,7 +4457,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5027,7 +4485,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5051,7 +4508,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5079,7 +4535,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5113,7 +4568,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: zolang @@ -5134,11 +4588,6 @@ adventures: antwoord = {ask} 'What is 5 times 5?' {print} 'Je hebt een correct antwoord gegeven' ``` - start_code: |- - antwoord = 0 - {while} antwoord != 25 - antwoord = {ask} 'Wat is 5 keer 5?' - {print} 'Goed gedaan!' years: name: Oud en Nieuw default_save_name: Oud en Nieuw @@ -5157,4 +4606,3 @@ adventures: {print} getal {print} 'Gelukkig Nieuwjaar!' ``` - start_code: '# Jouw code komt hier' diff --git a/content/adventures/pa_PK.yaml b/content/adventures/pa_PK.yaml index c02f2f100a9..4a4adf17a87 100644 --- a/content/adventures/pa_PK.yaml +++ b/content/adventures/pa_PK.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -49,7 +48,6 @@ adventures: 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: @@ -78,7 +76,6 @@ adventures: 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? @@ -93,7 +90,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -116,7 +112,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -127,7 +122,6 @@ adventures: {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! @@ -145,7 +139,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put `{if}`, `{repeat}` or `{for}` commands inside other `{if}`, `{repeat}` or `{for}` commands. This gives you many options and really helps you to make your story interactive. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -181,7 +173,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +515,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -569,7 +533,6 @@ adventures: 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! @@ -586,7 +549,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -602,7 +564,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -613,7 +574,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -630,7 +590,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -655,11 +614,7 @@ adventures: 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 @@ -691,7 +646,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -740,17 +694,6 @@ adventures: 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 @@ -773,12 +716,6 @@ adventures: {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. @@ -798,14 +735,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -827,16 +756,6 @@ adventures: 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 @@ -851,13 +770,6 @@ adventures: {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 @@ -880,17 +792,7 @@ adventures: {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' @@ -917,19 +819,7 @@ adventures: 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: @@ -945,11 +835,6 @@ adventures: 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 @@ -974,10 +859,7 @@ adventures: {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} @@ -1014,19 +896,7 @@ adventures: 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: @@ -1041,11 +911,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1085,26 +950,6 @@ adventures: 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 @@ -1133,27 +978,6 @@ adventures: 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 @@ -1186,31 +1010,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1240,9 +1039,7 @@ adventures: 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?' @@ -1299,36 +1096,6 @@ adventures: 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 @@ -1478,7 +1245,6 @@ adventures: Try the code yourself with the green 'Run code' button under the programming field. You can print text to the screen using the `{print}` command. - start_code: '{print} hello world!' 2: story_text: | In level 2 we learn two new commands: `{is}` and `{sleep}`. @@ -1493,11 +1259,9 @@ adventures: ``` story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: '{print} hello world!' 3: story_text: | In level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`. - start_code: '{print} hello world!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1513,7 +1277,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Hello world''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1524,9 +1287,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - start_code: |- - name {is} {ask} 'what is your name?' - {if} name {is} Hedy {print} 'cool!' {else} {print} 'meh' 6: story_text: | In this level you learn something new: you can now also calculate. @@ -1549,7 +1309,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}`, `{else}` and `{repeat}` have changed! @@ -1573,10 +1332,6 @@ adventures: {print} 'INTRUDER!' {print} 'You cannot use this computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1591,13 +1346,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1608,17 +1356,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1628,8 +1369,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1641,11 +1381,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1660,8 +1395,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1680,11 +1414,6 @@ adventures: 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' 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. @@ -1714,9 +1443,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1744,12 +1472,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1763,7 +1489,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1781,7 +1506,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1793,7 +1517,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1805,7 +1528,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1830,7 +1552,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1848,7 +1569,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1864,7 +1584,6 @@ adventures: {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. @@ -1872,7 +1591,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1905,7 +1623,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1914,7 +1631,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1925,7 +1641,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1973,10 +1688,6 @@ adventures: {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: |- 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. @@ -1988,10 +1699,6 @@ adventures: {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: 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. @@ -2031,7 +1738,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2049,7 +1755,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2070,7 +1775,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2083,7 +1787,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2114,7 +1817,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2126,7 +1828,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2143,7 +1844,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2159,7 +1859,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2171,7 +1870,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2211,21 +1909,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2254,13 +1937,6 @@ adventures: {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. @@ -2284,17 +1960,6 @@ adventures: 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 @@ -2323,7 +1988,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2345,7 +2009,6 @@ adventures: _ {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 @@ -2375,7 +2038,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2422,7 +2084,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2438,7 +2099,6 @@ adventures: {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. @@ -2457,7 +2117,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2486,7 +2145,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2512,7 +2170,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2541,7 +2198,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2575,7 +2231,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2606,18 +2261,7 @@ adventures: {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?' @@ -2656,10 +2300,6 @@ adventures: _ _ _ 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... @@ -2676,11 +2316,6 @@ adventures: {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. @@ -2696,16 +2331,6 @@ adventures: {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 @@ -2734,11 +2359,6 @@ adventures: _ 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 @@ -2764,10 +2384,6 @@ adventures: 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: @@ -2776,8 +2392,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2809,8 +2424,7 @@ adventures: {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} @@ -2833,7 +2447,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2854,7 +2467,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2894,8 +2506,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2921,7 +2532,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2938,7 +2548,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2951,7 +2560,6 @@ adventures: {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}`. @@ -2965,7 +2573,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -2981,7 +2588,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3001,7 +2607,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3025,7 +2630,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3054,7 +2658,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3067,7 +2670,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3087,7 +2689,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3113,8 +2714,6 @@ adventures: ``` _ 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. @@ -3131,8 +2730,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3164,7 +2762,6 @@ adventures: {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 @@ -3194,10 +2791,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3232,10 +2825,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3269,9 +2858,6 @@ adventures: 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. @@ -3320,11 +2906,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3338,10 +2919,6 @@ adventures: {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! @@ -3356,13 +2933,6 @@ adventures: {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 @@ -3388,10 +2958,6 @@ adventures: 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? @@ -3409,11 +2975,6 @@ adventures: _ {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 @@ -3433,7 +2994,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3453,7 +3013,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3485,7 +3044,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3505,7 +3063,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3526,7 +3083,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3545,7 +3101,6 @@ adventures: {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. @@ -3557,7 +3112,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3575,7 +3129,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3603,7 +3156,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3648,7 +3200,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3667,7 +3218,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3682,7 +3232,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3699,7 +3248,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3727,7 +3275,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3736,7 +3283,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3758,12 +3304,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3783,7 +3327,6 @@ 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. Can you finish the code? @@ -3803,7 +3346,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3814,7 +3356,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3832,7 +3373,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3854,7 +3394,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3871,7 +3410,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3895,7 +3433,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3908,7 +3445,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3924,10 +3460,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3961,7 +3493,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3979,7 +3510,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3993,7 +3523,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4045,7 +3574,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4060,7 +3588,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4075,7 +3602,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4092,16 +3618,6 @@ adventures: {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. @@ -4137,7 +3653,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4159,7 +3674,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4181,15 +3695,6 @@ adventures: {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 @@ -4257,7 +3762,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4320,7 +3824,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4382,7 +3885,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4469,7 +3971,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4491,9 +3992,6 @@ adventures: {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. @@ -4517,11 +4015,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4532,10 +4025,6 @@ adventures: {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! @@ -4562,11 +4051,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4599,12 +4083,6 @@ adventures: 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. @@ -4628,7 +4106,6 @@ adventures: {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. @@ -4671,7 +4148,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4689,7 +4165,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4714,16 +4189,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4739,7 +4204,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4750,7 +4214,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4761,7 +4224,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4779,7 +4241,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4798,7 +4259,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4818,7 +4278,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4829,7 +4288,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4842,7 +4300,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4873,7 +4330,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4914,7 +4370,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4937,7 +4392,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4966,7 +4420,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4990,7 +4443,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5018,7 +4470,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5052,7 +4503,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5072,11 +4522,6 @@ adventures: 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 @@ -5094,4 +4539,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/pap.yaml b/content/adventures/pap.yaml index 4541fe1f309..d810a402feb 100644 --- a/content/adventures/pap.yaml +++ b/content/adventures/pap.yaml @@ -27,7 +27,6 @@ adventures: 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: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -53,7 +52,6 @@ adventures: 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: @@ -87,7 +85,6 @@ adventures: 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. @@ -112,7 +109,6 @@ adventures: {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. @@ -138,7 +134,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -153,7 +148,6 @@ adventures: {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! @@ -176,7 +170,6 @@ adventures: {print} 'Oh no! Richard is too slow...' {print} _ ``` - 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" @@ -195,7 +188,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -204,7 +196,6 @@ adventures: 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' 12: story_text: |- In this level quotation marks will be needed to save multiple words in a variable. @@ -217,7 +208,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 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. @@ -236,7 +226,6 @@ adventures: {if} path {is} 'left' {and} weapon {is} 'sword' _ ``` - start_code: '# place your code here' 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. @@ -256,7 +245,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -277,7 +265,6 @@ adventures: 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 @@ -317,13 +304,6 @@ adventures: _ {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 @@ -341,11 +321,6 @@ adventures: {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 @@ -378,10 +353,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -409,11 +380,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -525,7 +491,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -591,7 +556,6 @@ adventures: 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! @@ -609,7 +573,6 @@ adventures: {else} {print} 'That is wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -625,10 +588,6 @@ adventures: {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. @@ -647,7 +606,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' _ ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -664,7 +622,6 @@ adventures: {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. @@ -689,11 +646,7 @@ adventures: 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 @@ -719,7 +672,6 @@ adventures: {print} 'Good job!' {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -768,17 +720,6 @@ adventures: {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 @@ -801,12 +742,6 @@ adventures: {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. @@ -826,14 +761,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -855,16 +782,6 @@ adventures: 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 @@ -879,13 +796,6 @@ adventures: {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 @@ -908,17 +818,7 @@ adventures: {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' @@ -945,19 +845,7 @@ adventures: 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: @@ -973,11 +861,6 @@ adventures: 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 @@ -1002,10 +885,7 @@ adventures: {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} @@ -1042,19 +922,7 @@ adventures: 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: @@ -1069,11 +937,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1113,26 +976,6 @@ adventures: 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 @@ -1161,27 +1004,6 @@ adventures: 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 @@ -1214,31 +1036,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1268,9 +1065,7 @@ adventures: 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?' @@ -1327,36 +1122,6 @@ adventures: 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 @@ -1506,7 +1271,6 @@ adventures: 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! @@ -1528,14 +1292,12 @@ adventures: 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: story_text: | In the previous levels you've been practising with variables, but you may have come across this problem. @@ -1555,9 +1317,6 @@ adventures: name {is} Sophie {print} My name is name ``` - start_code: | - name {is} Sophie - {print} My name is name 5: 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. @@ -1569,9 +1328,6 @@ adventures: ``` 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. @@ -1595,7 +1351,6 @@ adventures: total_price {is} food_price + drink_price {print} 'That will be ' total_price ' dollars, please' ``` - start_code: '# place your code here' 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. @@ -1609,11 +1364,6 @@ adventures: {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. @@ -1622,7 +1372,6 @@ adventures: ``` {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... @@ -1637,7 +1386,6 @@ adventures: {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. @@ -1653,12 +1401,10 @@ adventures: {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. @@ -1671,7 +1417,6 @@ adventures: 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: @@ -1691,7 +1436,6 @@ adventures: {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). @@ -1708,12 +1452,6 @@ adventures: {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... @@ -1731,7 +1469,6 @@ adventures: {if} answer == 'yes' {print} 'Ok we will continue' ``` - start_code: '{print} ''Lets go to the next tab!''' 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. @@ -1753,14 +1490,12 @@ adventures: {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! @@ -1792,9 +1527,6 @@ adventures: ``` 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! @@ -1802,7 +1534,6 @@ adventures: ### 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! @@ -1818,7 +1549,6 @@ adventures: _ 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. @@ -1838,7 +1568,6 @@ adventures: ``` 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: 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. @@ -1850,7 +1579,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the dice indicate this time?''' 10: story_text: | ### Exercise @@ -1864,7 +1592,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | In this game you have to throw 6 in as little tries as possible. @@ -1880,7 +1607,6 @@ adventures: tries = tries + 1 {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1901,7 +1627,6 @@ adventures: 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: story_text: | With quotation marks you can make your dishwashing program even better. @@ -1916,7 +1641,6 @@ adventures: {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. @@ -1930,7 +1654,6 @@ adventures: _ 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: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1962,7 +1685,6 @@ adventures: {print} 'Tuesday the dishes are done by: ' dishwasher {remove} dishwasher {from} people ``` - start_code: '{print} ''Who does the dishes?''' 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! @@ -1974,7 +1696,6 @@ adventures: 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! @@ -1989,11 +1710,6 @@ adventures: {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 @@ -2041,10 +1757,6 @@ adventures: {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: |- 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. @@ -2057,10 +1769,6 @@ adventures: {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: 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. @@ -2099,7 +1807,6 @@ adventures: ### 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: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only `{echo}`. @@ -2117,7 +1824,6 @@ adventures: 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. @@ -2142,7 +1848,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | ### Exercise @@ -2166,7 +1871,6 @@ adventures: {if} person {in} friends {print} good_answer {at} {random} {else} {print} bad_answer {at} {random} ``` - start_code: '# place your code here' 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. @@ -2189,7 +1893,6 @@ adventures: {sleep} {print} kids ' kids!' ``` - start_code: '# place your code here' 7: story_text: | ### Exercise @@ -2202,7 +1905,6 @@ adventures: options = they love you, they love you not _ _ _ _ options {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the next example you can have your fortune teller ask multiple questions and also print them! @@ -2220,7 +1922,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 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. @@ -2239,7 +1940,6 @@ adventures: {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. @@ -2254,7 +1954,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2294,21 +1993,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2337,13 +2021,6 @@ adventures: {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. @@ -2367,17 +2044,6 @@ adventures: 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 @@ -2406,7 +2072,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2428,7 +2093,6 @@ adventures: _ {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 @@ -2460,7 +2124,6 @@ adventures: 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. @@ -2515,7 +2178,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2537,7 +2199,6 @@ adventures: {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. @@ -2559,7 +2220,6 @@ adventures: _ _ _ _ {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" @@ -2584,7 +2244,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - 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\ @@ -2597,7 +2256,6 @@ adventures: {print} 'Room ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | In this level you can use the `<` and `>` symbol to introduce lives to your game. @@ -2624,7 +2282,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | This haunted house game uses the connection between the lists you can use in this level. @@ -2657,7 +2314,6 @@ adventures: {print} bad_fate[i] {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2688,18 +2344,7 @@ adventures: {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?' @@ -2738,10 +2383,6 @@ adventures: _ _ _ 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... @@ -2758,11 +2399,6 @@ adventures: {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. @@ -2778,16 +2414,6 @@ adventures: {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 @@ -2816,11 +2442,6 @@ adventures: _ 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 @@ -2846,10 +2467,6 @@ adventures: 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: @@ -2858,8 +2475,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2891,8 +2507,7 @@ adventures: {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} @@ -2919,7 +2534,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | Make your own program to practice your vocabulary in a new language. @@ -2938,7 +2552,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2983,8 +2596,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -3012,11 +2624,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Im Hedy the parrot - {ask} What is your name? - {echo} - {echo} 2: 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. @@ -3037,7 +2644,6 @@ adventures: 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!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3052,7 +2658,6 @@ adventures: {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}`. @@ -3067,7 +2672,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3086,7 +2690,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3110,7 +2713,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | In this level you can let Hedy tell you if you have saved up enough money! @@ -3128,7 +2730,6 @@ adventures: {print} 'Great! You have enough' {print} 'Lets go shopping!' ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3157,7 +2758,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3170,7 +2770,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3190,7 +2789,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3216,8 +2814,6 @@ adventures: ``` _ 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. @@ -3234,8 +2830,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3266,7 +2861,6 @@ adventures: {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 @@ -3296,10 +2890,6 @@ adventures: {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** @@ -3334,10 +2924,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3371,9 +2957,6 @@ adventures: 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. @@ -3423,11 +3006,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3441,10 +3019,6 @@ adventures: {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! @@ -3459,13 +3033,6 @@ adventures: {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 @@ -3491,10 +3058,6 @@ adventures: 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? @@ -3512,11 +3075,6 @@ adventures: _ {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 @@ -3540,7 +3098,6 @@ adventures: 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. @@ -3565,7 +3122,6 @@ adventures: 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: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3593,7 +3149,6 @@ adventures: 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. @@ -3617,7 +3172,6 @@ adventures: {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 @@ -3634,7 +3188,6 @@ adventures: {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: 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. @@ -3662,7 +3215,6 @@ adventures: {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. @@ -3676,7 +3228,6 @@ adventures: {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: @@ -3695,7 +3246,6 @@ adventures: ### 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 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\ @@ -3722,7 +3272,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily ask orders for different courses. @@ -3761,7 +3310,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3783,7 +3331,6 @@ adventures: 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. @@ -3807,7 +3354,6 @@ adventures: {print} 'That is a healthy choice' {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3821,7 +3367,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock_2 @@ -3848,9 +3393,6 @@ adventures: {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! @@ -3862,7 +3404,6 @@ adventures: 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! @@ -3882,13 +3423,11 @@ adventures: player_1 {is} {ask} Name of player 1: _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. ### 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. @@ -3910,7 +3449,6 @@ 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" @@ -3930,7 +3468,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | ### Exercise @@ -3941,7 +3478,6 @@ adventures: players = _ {for} _ ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code. @@ -3963,7 +3499,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | Play until you beat the computer! But first, finish the example code... @@ -3985,7 +3520,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -4002,7 +3536,6 @@ adventures: choice {is} _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -4032,7 +3565,6 @@ adventures: b = 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | We can simplify the superspy code with `{and}`, such that we only need one `{if}`. @@ -4051,7 +3583,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -4069,10 +3600,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4110,7 +3637,6 @@ adventures: {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: @@ -4129,7 +3655,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: 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. @@ -4147,7 +3672,6 @@ adventures: 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! @@ -4164,7 +3688,6 @@ adventures: ``` 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. @@ -4180,7 +3703,6 @@ adventures: {print} monkeys ' little monkeys jumping on the bed' _ ``` - start_code: '# place your code here' 12: 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: @@ -4199,7 +3721,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4216,16 +3737,6 @@ adventures: {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. @@ -4258,7 +3769,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4280,7 +3790,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4302,15 +3811,6 @@ adventures: {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 @@ -4346,7 +3846,6 @@ adventures: {else} player = 'x' ``` - start_code: '# Write your code here' 14: 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. @@ -4409,7 +3908,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4471,7 +3969,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4558,7 +4055,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4582,9 +4078,6 @@ adventures: {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. @@ -4610,11 +4103,6 @@ adventures: {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. @@ -4627,10 +4115,6 @@ adventures: {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! @@ -4657,11 +4141,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4694,12 +4173,6 @@ adventures: {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. @@ -4723,7 +4196,6 @@ adventures: {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" @@ -4764,7 +4236,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4783,7 +4254,6 @@ adventures: {forward} distance ``` ``` - start_code: '# place your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4808,16 +4278,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4833,7 +4293,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4844,7 +4303,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4855,7 +4313,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4873,7 +4330,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4892,7 +4348,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4912,7 +4367,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4923,7 +4377,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4936,7 +4389,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4967,7 +4419,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5008,7 +4459,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5031,7 +4481,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5060,7 +4509,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5084,7 +4532,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5112,7 +4559,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5146,7 +4592,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5166,11 +4611,6 @@ adventures: 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 @@ -5188,4 +4628,3 @@ adventures: {print} number {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/pl.yaml b/content/adventures/pl.yaml index cd4a333b835..42579d5cf89 100644 --- a/content/adventures/pl.yaml +++ b/content/adventures/pl.yaml @@ -27,7 +27,6 @@ adventures: Użyj co najmniej jednego polecenia `{ask}` i jednego `{echo}`. Możesz zrobić to na dowolny temat. Jeśli nie możesz wymyślić tematu, skorzystaj z jednej z naszych opcji: wyjście do kina, mecz sportowy lub dzień w zoo. - start_code: '{print} Historyjka zaczyna się tutaj' 2: story_text: | Na poziomie 2 twoja opowieść może być znacznie zabawniejsza. Imię głównego bohatera może pojawić się w dowolnym miejscu w zdaniu. @@ -46,7 +45,6 @@ adventures: ``` story_text_2: "### Ćwiczenie\nTeraz nadszedł czas, aby dodać zmienne do opowieści, którą stworzyłeś na poprzednim poziomie. \nPrzejdź do „Moje programy”, poszukaj przygody fabularnej poziomu 1 i skopiuj kod. Wklej kod na ekranie wprowadzania na tym poziomie. \n\nTen kod nie zadziała na\ \ tym poziomie, ponieważ nie używałeś jeszcze zmiennych. \nZmień polecenia `{ask}` i `{echo}` w swoim kodzie na poprawną formę, której nauczyłeś się na tym poziomie. \n\n**Dodatkowo** Dodaj polecenie uśpienia do swojego kodu, aby zbudować napięcie w swojej historii.\n" - start_code: '{print} Twoja historyjka' 3: story_text: | Na poziomie 3. Twoja historyjka może być jeszcze zabawniejsza. Możesz wybrać losowo potwora, zwierzę oraz inne utrudnienia, tak jak w przykładzie: @@ -80,7 +78,6 @@ adventures: wyrzuc {is} {ask} Który przedmiot powinien wyrzucić? {remove} wyrzuc {from} plecak ``` - start_code: '{print} Twoja histora' 4: story_text: | Mogłeś zauważyć, że w poprzednich poziomach ciągle jest pewnie problem. Czy próbowałeś napisać zdanie które zawierało słowo “imię”? Na przykład: `{print}` moje imię to imię. @@ -102,7 +99,6 @@ adventures: {print} _ Słyszy dźwięk _ zwierzęta {at} {random} {print} name _ obawia się, że jest w nawiedzonym lesie _ ``` - start_code: '{print} ''Twoja opowieść będzie tutaj napisana!''' 5: story_text: | W tym poziomie możesz zaprogramować różne zakończenia, które sprawią, że Twoja opowieść będzie jeszcze ciekawsza. @@ -128,7 +124,6 @@ adventures: {if} zakończenie {is} dobre {print} imię ' wyciąga miecz i potwór ucieka' {else} {print} 'Potwór zjada ' imię ``` - start_code: '{print} ''Tutaj jest początek Twojej opowieści!''' 7: story_text: "W niektórych opowieściach, bohaterowie czasem powtarzają wybrany zwrot kilka razy. Przykładem tego jest bohater wołający o pomoc lub też śpiewający piosenkę.\nMożesz stworzyć takie powtórzenia w swojej opowieści przy użyciu polecenia `{repeat}`.\n\nDodaj powtórzenia do Twojej\ \ opowieści. Wróć do swoich zapisanych programów i wybierz Twój program z opowieścią z poziomu 6 i \nznajdź linię zawierającą polecenie `{print}` i powtórz ją!\n" @@ -138,7 +133,6 @@ adventures: {repeat} 5 {times} {print} 'Pomocy!' {print} 'Dlaczego nikt mi nie pomaga?' ``` - start_code: '{repeat} 5 {times} {print} ''Pomocy!''' 8: story_text: | W tym poziomie masz możliwość napisania wielu linii kodu wewnątrz polecenia `{if}`. Dzięki temu możesz urozmaicić szczęśliwe i tragiczne zakończenia Twojej opowieści. @@ -159,7 +153,6 @@ adventures: {print} 'O, nie! Richard jest zbyt wolny...' {print} _ ``` - start_code: '# tutaj umieść swój kod' 9: story_text: | W tym poziomie możesz użyć poleceń `{if}` and `{repeat}` wewnątrz innych poleceń `{if}` oraz `{repeat}`. @@ -188,7 +181,6 @@ adventures: {else} {print} 'Robin wraca do domu' ``` - start_code: '# tutaj umieść swój kod' 10: story_text: | W tym poziomie możesz użyć polecenia {for} w swojej opowieści. Dzięki tej komendzie możesz bardzo prosto zaprogramować część wierszyka "Sroczka kaszkę warzyła". @@ -197,7 +189,6 @@ adventures: Spójrz na opowiadanie jeśli go nie znasz i upewnij się, że jest wydrukowane tak jak w książce. example_code: "```\nanimals = _ , _ , _ \n{print} 'Brown bear, Brown bear'\n {print} 'What do you see?'\n```\n" - start_code: '# tutaj umieść swój kod' 12: story_text: |- W tym poziomie cudzysłowy będą potrzebne, żeby przypisac wiele słów do jednej zmiennej. @@ -210,7 +201,6 @@ adventures: imię = 'Królowa Anglii' {print} imię ' jadła kawałek ciasta, gdy nagle...' ``` - start_code: '# tutaj umieść swój kod' 13: story_text: | Używając poleceń `{and}` oraz `{or}` możesz uczynić swoje opowieści bardziej wszechstronnymi. Możesz zadać dwa pytania i odpowiedzieć na kombinację odpowiedzi. @@ -221,7 +211,6 @@ adventures: ### Ćwiczenie 2 Odnajdź opowieść z poprzedniego poziomu i dodaj jedno polecenie `{and}` lub `{or}`. example_code: "```\n{print} 'Nasz bohater idzie przez las'\n{print} 'Ścieżka rozdziela się'\nścieżka = {ask} 'Którą ścieżkę powinna wybrać?'\nbroń ={ask} 'Jaką broń wyciąga?'\n{if} ścieżka {is} 'lewo' {and} broń {is} 'miecz'\n\t_\n```\n" - start_code: '# tutaj umieść swój kod' 15: story_text: | Przy użyciu pętli `{while}` możesz stworzyć jeszcze bardziej wciągające opowieści. Na przykład, możesz użyć `{while} gra {is} 'działa'` żeby kontynuować grę aż się zakończy. @@ -231,7 +220,6 @@ adventures: 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: "```\nklucze = 'zgubione'\n{print} 'Stoisz w ogrodzie i zgubiłeś swoje klucze.' \n{print} 'Gdzie chcesz ich poszukać?'\n{print} 'Możesz wybrać: drzewo, doniczka, kamień, skrzynka na listy'\n{while} klucze == 'zgubione'\n miejsce = {ask} 'Gdzie chcesz popatrzeć?'\n {if}\ \ miejsce == 'doniczka'\n {print} 'Tutaj są!'\n klucze = 'znalezione'\n {else}\n {print} 'Nie, nie ma ich w ' miejsce\n{print} 'Teraz możesz wejść do domu!'\n```\n" - start_code: '# tutaj umieść swój kod' 18: story_text: | Napiszemy kolejną opowieść, ale teraz musimy użyć nawiasów z `{print}`. @@ -253,7 +241,6 @@ adventures: imię = {input}("Jak się nazywasz?") {print}('Witamy w tej opowieści!') ``` - start_code: '# tutaj napisz swój kod' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -293,13 +280,6 @@ adventures: _ {print} Otrzymujesz koktajl o smaku {at} {random} ``` - start_code: |- - zwierzęta {is} pies, kot, kangur - ulubione {is} {ask} Jakie jest Twoje ulubione zwierzę? - {add} ulubione {to_list} zwierzęta - nielubiane {is} {ask} Którego zwierzęcia nie lubisz? - {remove} nielubiane {from} zwierzęta - {print} Wybieram zwierzęta {at} {random} and_or_command: name: '{and} & {or}' default_save_name: and or @@ -317,11 +297,6 @@ adventures: {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: komenda_{ask} @@ -354,10 +329,6 @@ adventures: _ Jak się masz? _ ``` - start_code: | - {print} Cześć! - {ask} Jak masz na imię? - {echo} cześć 2: story_text: | ## Komenda zapytaj @@ -386,11 +357,6 @@ adventures: ulubione_zwierzę {is} {ask} Jakie jest Twoje ulubione zwierzę? {print} Lubię ulubione_zwierzę ``` - start_code: |- - imię {is} {ask} Jak się nazywasz? - {print} Cześć imię - wiek {is} {ask} Ile masz lat? - {print} imię ma wiek lat 18: story_text: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -502,7 +468,6 @@ adventures: {elif} punkty > punkty_krupiera {and} punkty < 21: {print} 'Wygrywasz!' ``` - start_code: '# umieść tutaj swój kod' calculator: name: Kalkulator default_save_name: Kalkulator @@ -533,7 +498,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Witamy w tym kalkulatorze!''' 9: story_text: | W poziomie 6 stworzyłeś kalkulator, w tym poziomie możesz rozbudować ten kod tak, aby zadawał wiele pytań. @@ -545,7 +509,6 @@ adventures: Daj graczom informację zwrotną, gdy wprowadzą dobrą lub złą odpowiedź. Aby to osiągnąć, rozszerz swój program o `{else}`. example_code: "```\nwynik = 0\n{repeat} 10 {times}\n liczby = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n liczba1= liczby {at} {random}\n liczba2 = liczby {at} {random}\n poprawna_odpowiedź = liczba1* liczba2 \n {print} 'Ile jest ' liczba1 ' razy ' liczba2 '?'\n odpowiedź = {ask}\ \ 'Wpisz tutaj swoją odpowiedź...'\n {print} 'Twoja odpowiedź to' odpowiedź\n {if} _ {is} _\n wynik = wynik + 1\n{print} 'Świetna robota! Twój wynik to... ' wynik ' na 10!\n```\n" - start_code: '{print} ''Witamy w tym kalkulatorze!''' 10: story_text: | Ta gra w kalkulator pomoże Ci przećwiczyć tabliczkę mnożenia! @@ -553,7 +516,6 @@ adventures: Czy możesz dodać więcej liczb do listy, aby ćwiczyć tabliczkę mnożenia do 10? example_code: "```\nliczby = 1, 2, 3\n{for} liczba1 {in} liczby\n {for} liczba2 {in} liczby\n odpowiedź = {ask} 'Ile wynosi ' liczba2 ' razy ' liczba1 '?'\n poprawna_odpowiedź = liczba1 * liczba2\n {if} odpowiedź {is} poprawna_odpowiedź\n {print} 'Świetna\ \ robota!'\n {else}\n {print} 'To nieprawidłowa odpowiedź. Prawidłowa odpowiedź to ' poprawna_odpowiedź \n```\n" - start_code: '# umieść tutaj swój kod' 11: story_text: | Dzięki `{for}` można uprościć program ćwiczeniowy tabliczki mnożenia. @@ -569,7 +531,6 @@ adventures: {for} i {in} {range} 1 do 10 {print} i * liczba ``` - start_code: '# umieść tutaj swój kod' 12: story_text: | Teraz możesz zrobić kalkulator, który działa dla liczb dziesiętnych. Wypełnij puste miejsca, aby działał poprawnie! @@ -580,7 +541,6 @@ adventures: odpowiedź = _ {print} liczba1 ' plus ' liczba2 ' to ' odpowiedź ``` - start_code: '# umieść tutaj swój kod' 13: story_text: | ### Ćwiczenie 1 @@ -597,7 +557,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -622,11 +581,7 @@ adventures: 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 @@ -658,7 +613,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# umieść tutaj swój kod' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -707,17 +661,6 @@ adventures: {clear} {print} 'NIESPODZIANKA!' ``` - start_code: | - {print} '3' - {sleep} - {clear} - {print} '2' - {sleep} - {clear} - {print} '1' - {sleep} - {clear} - {print} 'NIESPODZIANKA!' debugging: name: debugging default_save_name: debugging @@ -740,12 +683,6 @@ adventures: {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. @@ -765,14 +702,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -794,16 +723,6 @@ adventures: 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 @@ -818,13 +737,6 @@ adventures: {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 @@ -847,17 +759,7 @@ adventures: {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' @@ -884,19 +786,7 @@ adventures: 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: @@ -912,11 +802,6 @@ adventures: 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 @@ -941,10 +826,7 @@ adventures: {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} @@ -981,19 +863,7 @@ adventures: 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: @@ -1008,11 +878,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1052,26 +917,6 @@ adventures: 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 @@ -1100,27 +945,6 @@ adventures: 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 @@ -1153,31 +977,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1207,9 +1006,7 @@ adventures: 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?' @@ -1266,36 +1063,6 @@ adventures: 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 @@ -1443,7 +1210,6 @@ adventures: Witaj w Hedy! Na Poziomie 1 nauczysz się pisać historię. Wypróbuj kod, naciskając zielony przycisk pod polem programowania. Gotowe? Świetnie, możesz udać się do następnej zakładki i nauczyć pierwszej komendy! - start_code: '{print} witaj świecie!' 2: story_text: | Gratulację! Witamy na poziomie 2. Już stworzyliśmy trochę kodu za ciebie ;). @@ -1461,11 +1227,9 @@ adventures: ``` story_text_2: | `{print}` wciąż działa tak samo, ale komenda `{ask}` zmieniła się. Musisz użyć zmiennej również w komendzie `{ask}`. Wygląda to tak: - start_code: '{print} witaj świecie!' 3: story_text: "Na poprzednim poziomie nauczyliśmy się czym są zmienna i jak możemy ich używać, żeby nasze przygody były bardziej interaktywne. \nAle... to nie jedyna rzecz, którą możemy zrobić ze zmiennymi! Zmienne mogą też być listami. \nA nawet możemy pozwolić Hedy, aby wybrała losowe\ \ słowo z listy, co pozwoli Ci stworzyć prawdziwe gry!\nSpójrzmy na kolejną zakładkę!\n" - start_code: '{print} witaj świecie!' 4: story_text: | Na poprzednich poziomach ćwiczyliśmy używanie zmiennych, ale mogłaś napotkać się na jeden problem. @@ -1485,9 +1249,6 @@ adventures: imię {is} Zosia {print} Moje imię to imię ``` - start_code: |- - imię {is} Zosia - {print} Moje imię to imię 5: story_text: | W poprzednich poziomach nauczyliśmy się używać `{at} {random}`, które sprawiało, że gry wyglądały inaczej pomiędzy ich odpaleniami. @@ -1499,9 +1260,6 @@ adventures: ``` hasło {is} {ask} 'Jakie jest prawidłowe hasło?' ``` - start_code: |- - imię {is} {ask} 'Jak masz na imię?' - {if} imię {is} Hedy {print} 'super!' {else} {print} 'eh' 6: story_text: | W tym poziomie nauczysz się czegoś nowego: od teraz możesz również liczyć. @@ -1524,7 +1282,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy to zabawa!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy to zabawa!''' 8: story_text: | `{ask}` i `{print}` wciąż działają tak jak je poznałeś do tej pory. Ale `{if}`, `{else}` i `{repeat}` zmieniły się! @@ -1548,10 +1305,6 @@ adventures: {print} 'INTRUZ!' {print} 'Nie możesz używać tego komputera!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Siema ludziska' - {print} 'To zostanie wypisane 5 razy' 9: story_text: | Na tym poziomie możesz używać nie tylko wielu linii z poleceniem `{if}` oraz `{repeat}`, ale możesz używać ich łącznie! @@ -1566,13 +1319,6 @@ adventures: {else} {print} 'pizza jest lepsza' ``` - start_code: |- - {repeat} 3 {times} - jedzenie = {ask} 'Co byś zjadł?' - {if} jedzenie {is} pizza - {print} 'super!' - {else} - {print} 'pizza jest lepsza' 10: story_text: "W tym poziomie nauczysz się nowego polecenia/pętli `{for}`. Z poleceniem/pętlą `{for}`możesz tworzyć listy i możesz używać wszystkich elementów listy. \n`{for}` tworzy blok kodu, jak `{repeat}` i `{if}` więc wszystkie linie w bloku muszą być wcięte, a więc zaczynać się spacjami." example_code: | @@ -1581,17 +1327,10 @@ adventures: {for} zwierzę {in} zwierzęta {print} 'Moim ulubionym zwierzakiem jest ' zwierzę ``` - start_code: |- - zwierzęta {is} pies, kot, blobfish - {for} zwierzę {in} zwierzęta - {print} 'Moim ulubionym zwierzakiem jest ' zwierzę 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: |- - {for} licznik {in} {range} 1 {to} 5 - {print} licznik 12: story_text: |- **Ułamki dziesiętne** @@ -1601,8 +1340,7 @@ adventures: {print} 'Dwa i pół plus dwa i pół to...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'Teraz zapisując ułamki dziesiętne musisz wykorzystać kropkę do oddzielenia części ułamkowej od części całkowitych' + {print} 2.5 + 2.5 13: story_text: |- @@ -1616,11 +1354,6 @@ adventures: {if} imię {is} 'Hedy' {and} wiek {is} 2 {print} 'Naprawdę jesteś Hedy!' ``` - start_code: |- - imię = {ask} 'Jak masz na imię?' - wiek = {ask} 'Ile masz lat?' - {if} imię {is} 'Hedy' {and} wiek {is} 2 - {print} 'Naprawdę jesteś Hedy!' 14: story_text: | W tej lekcji nauczymy się zastosowania nowych operatorów logicznych, które możesz pamiętać z lekcji matematyki: operatory `<` i `>`. @@ -1635,8 +1368,7 @@ adventures: {if} wiek > 12 {print} 'Masz więcej lat niż ja!' ``` - start_code: |- - wiek = {ask} 'Ile masz lat?' + {if} wiek < 13 {print} 'Jesteś młodszy niż ja!' {else} @@ -1651,11 +1383,6 @@ adventures: odpowiedź = {ask} 'Ile jest 5 razy 5?' {print} 'Dobra odpowiedź' ``` - start_code: |- - odpowiedź = 0 - {while} odpowiedź != 25 - odpowiedź = {ask} 'Ile jest 5 razy 5?' - {print} 'Dobra odpowiedź' 16: story_text: |- Tym razem stworzymy listy w sposób podobny do Pythona. Te listy mają kwadratowe nawiasy dookoła listy! Dodatkowo, zostawimy też cudzysłowie dookoła każdego elementu listy tak jak się nauczyliśmy w poprzednich poziomach. @@ -1685,8 +1412,7 @@ adventures: story_text: |- Dotarliśmy do prawdziwego kodu Pythona! Oznacza to, że od teraz musimy używać nawiasów z `{print}` i `{range}`. Oznacza to również, że jeśli używasz angielskich wersji poleceń możesz używać kodu Hedy z tego poziomu w dowolnym środowisku Pythona. Jeśli jeszcze tego nie zrobiłeś, możesz przełączyć język w menu poleceń, aby to zrobić. - start_code: |- - imię = 'Hedy' + {print}('Mam na imię ', imię) dice: name: Kostka do gry @@ -1714,7 +1440,6 @@ adventures: ``` wybór {is} _ ``` - start_code: '{print} Jaka wartość wypadnie na kostce tym razem?' 4: story_text: | W tym poziomie możesz stworzyć kostki do gry. Ale tym razem spróbuj zrobić to samodzielnie, bez przykładowego kodu! @@ -1722,7 +1447,6 @@ adventures: ### Ćwiczenie Stwórz własne kostki do gry. Wskazówka: Jeśli nie masz pojęcia jak stworzyć kostki do gry, spójrz na te z poprzedniego poziomu, ale nie zapomnij dodać cudzysłowów. - start_code: '{print} ''Jaka wartość tym razem wypadnie na kostce?''' 5: story_text: | Teraz dodamy polecenia `{if}` oraz `{else}` do naszych kości! @@ -1738,7 +1462,6 @@ adventures: _ rzut {is} dżdżownica {print} 'Możesz przestać rzucać.' _ {print} 'Musisz rzucić jeszcze raz!' ``` - start_code: '{print} ''Jaka wartość tym razem wypadnie na kostce?''' 6: story_text: | Na tym poziomie możesz zrobić kostkę do gry z Gąsienicą i nawet policzyć ile punktów wyrzuciłaś w sumie. @@ -1758,7 +1481,6 @@ adventures: ``` example_code_2: | Czy udało ci się policzyć wynik dla 8 kostek? Wymagało to sporo kopiowania i wklejania, prawda? W poziomie 7 ułatwimy to! - start_code: '{print} ''Jaka wartość tym razem wypadnie na kostce?''' 7: story_text: | Na poziomie 5 już mogłeś zrobić kostkę do gry. Przy pomocy polecenia `{repeat}` możesz łatwo rzucić ręką pełną kostek. @@ -1770,7 +1492,6 @@ adventures: wybory = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''Jaka wartość tym razem wypadnie na kostce?''' 10: story_text: | Czy wszyscy zbyt długo rzucają kostką? Na tym poziomie możesz pozwolić Hedy rzucić wszystkimi kośćmi naraz! @@ -1785,7 +1506,6 @@ adventures: {print} gracz ' wyrzucił ' wybory {at} {random} {sleep} ``` - start_code: '# umieść tutaj swój kod' 15: story_text: | ### Exercise @@ -1810,7 +1530,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# umieść swój kod tutaj' dishes: name: Zmywanie? default_save_name: Zmywanie @@ -1831,7 +1550,6 @@ adventures: Następnie pomyśl o zadaniu do wykonania i pozwól komputerowi zdecydować, kto ma wykonać zadanie za pomocą polecenia `{at} {random}`. **Dodatkowo** Nie masz ochoty samodzielnie zmywać naczyń? Zhakuj program, usuwając swoją nazwę z listy za pomocą polecenia `{remove}` `{from}`. - start_code: '{print} Kto dziś zmywa naczynia?' 4: story_text: | Korzystając z cudzysłowów możesz sprawić, że twój program o zmywaniu naczyń będzie jeszcze lepszy. @@ -1845,7 +1563,6 @@ adventures: {sleep} {print} ludzie {at} _ ``` - start_code: '{print} ''Kto zmywa naczynia?''' 5: story_text: | Dzięki poleceniu `{if}` możesz mieć teraz trochę więcej zabawy z wyborami w twoich programach. Możesz teraz sprawić, by twój program reagował na wybory podjęte przez komputer. @@ -1859,7 +1576,6 @@ adventures: _ kto_zmywa {is} Zosia {print} _ o, nie... Moja kolej zmywania naczyń _ _ {print} 'całe szczęście ' _ ' myje naczynia' ```` - start_code: '{print} ''Kto zmywa naczynia?''' 6: story_text: | Jak często wszyscy będą zmywać naczynia? Czy to jest sprawiedliwe? Możesz to policzyć na tym poziomie. @@ -1892,7 +1608,6 @@ adventures: {remove} kto_zmywa {from} ludzie kto_zmywa = ludzie {at} {random} ``` - start_code: '{print} ''Kto zmywa naczynia?''' 7: story_text: | Przy użyciu komendy `{repeat}` możesz powtórzyć fragmenty kodu. Możesz to wykorzystać do ustalenia kto będzie zmywał naczynia przez kilka dni! @@ -1904,7 +1619,6 @@ adventures: ludzie = mamy, taty, Emmy, Sophie {repeat} _ _ {print} 'Zmywanie naczyń jest zadaniem ' _ _ _ ``` - start_code: '{print} ''Kto myje naczynia?''' 10: story_text: | Na tym poziomie w prosty sposób ułożysz plan na cały tydzień! @@ -1919,7 +1633,6 @@ adventures: {for} dzień {in} dni {print} imiona {at} {random} ' myje naczynia w ' dzień ``` - start_code: '# umieść tutaj swój kod' elif_command: name: '{elif}' default_save_name: elif @@ -1967,10 +1680,6 @@ adventures: {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: |- Na tym poziomie dodajemy nową formę `{for}`. Na wcześniejszych poziomach używaliśmy `{for}` z listą, ale możemy też używać `{for}` z liczbami. @@ -1983,10 +1692,6 @@ adventures: {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: 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. @@ -2025,7 +1730,6 @@ adventures: ### Ćwiczenie Skopiuj przykładowy kod na ekran wprowadzania i wypełnij puste pola, aby kod działał. **Dodatkowo** Zmień kod i pozwól wróżbitce nie tylko przewidzieć Twoje imię, ale także wiek, ulubioną drużynę sportową lub coś innego o sobie. - start_code: '# umieść swój kod tu' 3: story_text: | Na poprzednich poziomach stworzyłeś swoją pierwszą maszynę do wróżenia, ale Hedy nie mogła niczego przewidzieć, tylko wykonać {echo}. @@ -2035,7 +1739,6 @@ adventures: story_text_2: | ### Ćwiczenie Teraz Hedy może odpowiedzieć tylko tak, nie lub może. Czy możesz dać Hedy więcej opcji odpowiedzi, np. 'zdecydowanie' lub 'zapytaj ponownie'. - start_code: '# umieść tutaj swój kod' 4: story_text: | Ten poziom nie ma żadnych nowych funkcji, ale pozwala poćwiczyć używanie cudzysłowów. @@ -2060,7 +1763,6 @@ adventures: {sleep} 2 {print} odpowiedzi {at} {random} ``` - start_code: '# umieść tutaj swój kod' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2073,7 +1775,6 @@ adventures: osoba {is} {ask} 'Kim jesteś?' {if} osoba {is} Hedy {print} 'Zdecydowanie wygrasz!🤩' {else} {print} 'Złe wieści! Ktoś inny wygra!😭' ``` - start_code: '# umieść tutaj swój kod' 6: story_text: | Na tym poziomie możesz używać matematyki w swoich przewidywaniach jako wróżbita. Pozwala to na tworzenie (zwariowanych) formuł do obliczania przyszłości. @@ -2086,7 +1787,6 @@ adventures: example_code: "```\n{print} 'Jestem Hedy - wróżka!'\n{print} 'Mogę przewidzieć, ile dzieci będziesz miał, gdy dorośniesz!'\nwiek = {ask} 'Ile masz lat?'\nrodzeństwo = {ask} 'Ile masz rodzeństwa?'\nwzrost = {ask} 'Ile masz wzrostu w centymetrach?'\nliczba_dzieci = wzrost / wiek\nliczba_dzieci\ \ = liczba_dzieci - rodzeństwo\n{print} 'Będziesz miał...'\n{sleep}\n{print} liczba_dzieci ' dzieci!'\n```\n\nJeśli poprzedni przykład nie był dla Ciebie wystarczająco zwariowany, spójrz na ten!\n```\n{print} 'Jestem Hedy - zwariowany wróżbita!'\n{print} 'Przewiduję, jak mądry jesteś!'\n\ nożna = {ask} 'W skali 1-10 jak bardzo kochasz piłkę nożną?'\nbanany = {ask} 'Ile bananów zjadłeś w tym tygodniu?'\nhigiena = {ask} 'Ile razy dzisiaj umyłaś ręce?'\nwynik = banany + higiena\nwynik = wynik * nożna \n{print} 'Jesteś ' nożna ' procentowo inteligentny.'\n```\n" - start_code: '# umieść tutaj swój kod' 7: story_text: | Na tym poziomie możesz użyć komendy `{repeat}`, aby twoja maszyna przepowiedziała kilka losów jednocześnie. @@ -2098,7 +1798,6 @@ adventures: odpowiedź = tak, nie, może {repeat} 3 {times} {print} 'Moja kryształowa kula mówi...' odpowiedź {at} {random} ``` - start_code: '# umieść tutaj swój kod' 8: story_text: | Na poprzednich poziomach nauczyłeś się, jak użyć `{repeat}`, aby wróżka odpowiedziała na 3 pytania z rzędu, ale mieliśmy problem z wydrukowaniem pytań. @@ -2118,7 +1817,6 @@ adventures: {sleep} {print} 'Moja kryształowa kula mówi...' odpowiedzi {at} {random} ``` - start_code: '# umieść tutaj swój kod' 10: story_text: | Na tym poziomie nauczysz się programować grę MASH (dwór, mieszkanie, chałupa, dom). W tej grze możesz przewidzieć jak będzie wyglądać przyszłość dla wszystkich graczy jednocześnie. @@ -2137,7 +1835,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# umieść tutaj swój kod' 12: story_text: | Na tym poziomie możesz tworzyć los wieloma słowami. Czy możesz dodać więcej różnych fortun do listy? @@ -2149,7 +1846,6 @@ adventures: {sleep} {print} losy {at} {random} ``` - start_code: '# umieść tutaj swój kod' functions: name: functions default_save_name: functions @@ -2189,21 +1885,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2232,13 +1913,6 @@ adventures: {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. @@ -2262,17 +1936,6 @@ adventures: 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 @@ -2301,7 +1964,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2323,7 +1985,6 @@ adventures: _ {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: Nawiedzony dom default_save_name: Nawiedzony dom @@ -2355,7 +2016,6 @@ adventures: Skopiuj przykładowy kod na ekran wprowadzania, klikając żółty przycisk. Teraz zakończ historię, dodając co najmniej 5 linii kodu. Pamiętaj, aby każdą linię kodów rozpocząć od komendy `{print}`. - start_code: '{print} Jak się tu znalazłem?' 2: story_text: | W tym nawiedzonym domu możesz wybierać swoje potwory za pomocą emotikonów. Oczywiście możesz też użyć słów. @@ -2402,7 +2062,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# umieść tutaj swój kod' 4: story_text: | Na tym poziomie nauczysz się używać cudzysłowów w swoich grach. @@ -2418,7 +2077,6 @@ adventures: {sleep} {print} potwory {at} {random} ``` - start_code: '# umieść tutaj swój kod' 5: story_text: | Aż do tego poziomu gra w nawiedzonym domu zawsze prosiła gracza o wybranie drzwi, ale jak zapewne zauważyłeś, tak naprawdę nie musieli odpowiadać poprawnie. @@ -2429,7 +2087,6 @@ adventures: Czy potrafisz znaleźć 4 brakujące słowa, aby uzupełnić kod? example_code: "```\n{print} 'Uciekaj z nawiedzonego domu!'\n{print} 'Przed tobą znajdują się 3 drzwi...'\ndrzwi {is} 1, 2, 3\npotwory {is} wilkołak, mumia, wampir, zombie\nwybrane_drzwi {is} {ask} 'Które drzwi wybierasz?'\n {print} 'Wybrałeś drzwi...' wybrane_drzwi \n{sleep}\npoprawne_drzwi\ \ {is} drzwi {at} {random}\n_ _ _ {print} 'Fantastycznie! Uciekłeś!'\n{else} {print} 'O nie! Zostałeś zjedzony przez...' potwory. {at} {random}\n```\n" - start_code: '# umieść tutaj swój kod' 9: story_text: | Na tym poziomie możesz skorzystać ze wcięć, dzięki czemu nawiedzony dom stanie się jeszcze bardziej interaktywny! @@ -2460,7 +2117,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Ucieknij z nawiedzonego domu!''' 11: story_text: | Na tym poziomie zmieniliśmy polecenie `{for}`, abyśmy mogli powiedzieć graczowi, gdzie się znajduje. @@ -2484,7 +2140,6 @@ adventures: {print} 'Pokój ' i potwór = potwory {at} {random} ``` - start_code: '{print} ''Ucieknij z nawiedzonego domu!''' 14: story_text: | ### Exercise @@ -2513,7 +2168,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2547,7 +2201,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2578,18 +2231,7 @@ adventures: {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?' @@ -2629,10 +2271,6 @@ adventures: _ _ _ 4 _ 'Dobra robota!' _ _ 'Nie, 2 + 2 = 4' ``` - start_code: |- - imię {is} {ask} 'jak masz na imię?' - {if} imię {is} Hedy {print} 'super' - {else} {print} 'eh' 8: story_text: | ## If... Else... @@ -2649,11 +2287,6 @@ adventures: {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. @@ -2669,16 +2302,6 @@ adventures: {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 @@ -2707,11 +2330,6 @@ adventures: _ odpowiedź _ animals _ 'Mine too!' _ _ 'Moje ulubione zwierzęta to psy, krowy i owce' ``` - start_code: |- - ładne_kolory {is} zielony, żółty - wybrany_kolor {is} {ask} 'Jaki jest Twój ulubiony kolor?' - {if} wybrany_kolor {in} ładne_kolory {print} 'ładny!' - {else} {print} 'meh' is_command: name: '{is}' default_save_name: komenda_to @@ -2737,10 +2355,6 @@ adventures: 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: @@ -2749,8 +2363,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2782,8 +2395,7 @@ adventures: {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} @@ -2809,7 +2421,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# umieść tutaj swój kod' 16: story_text: | ### Exercise @@ -2830,7 +2441,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# umieść tutaj swój kod' maths: name: maths default_save_name: maths @@ -2870,8 +2480,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Papuga @@ -2899,11 +2508,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Jestem papuga Hedy - {ask} Jak masz na imię? - {echo} - {echo} 2: story_text: | Stwórz swoją własną cyfrową papugę, która będzie po tobie powtarzać cokolwiek powiesz! @@ -2920,7 +2524,6 @@ adventures: story_text_2: | ### Ćwiczenie Możesz użyć zmiennych, aby papuga powiedziała więcej niż tylko twoje imię. Czy możesz uzupełnić kod? - start_code: '{print} Jestem papuga Hedy!' 3: story_text: | Naucz swoją papugę nowego słowa z poleceniem `{add}`. @@ -2935,7 +2538,6 @@ adventures: {print} 🧒 Powiedz nowe_słowo , Hedy! {print} 🦜 słowa {at} {random} ``` - start_code: '# tutaj umieść swój kod' 4: story_text: | W tym poziomie musimy użyć cudzysłowy z poleceniami `{ask}` and `{print}`. @@ -2950,7 +2552,6 @@ adventures: {print} _ 🧒 Powiedz _ nowe_słowo _, Hedy!_ {print} _ 🦜 _ słowa {at} {random} ``` - start_code: '# tutaj umieść swój kod' 5: story_text: | Daj swojej papudze nagrodę jeżeli powie poprawne słowo. @@ -2969,7 +2570,6 @@ adventures: _ powiedziane_słowo {is} nowe_słowo _ '🧒 Świetnie, Hedy! 🍪' _ _ '🧒 Nie, Hedy! Powiedz ' nowe_słowo ``` - start_code: '# tutaj umieść swój kod' piggybank: name: Skarbonka default_save_name: Skarbonka @@ -2981,7 +2581,6 @@ adventures: Dokończ kod, aby obliczyć, ile masz pieniędzy i jak długo musisz oszczędzać, aby kupić to, co chcesz! example_code: "```\n{print} 'Cyfrowa skarbonka'\nżyczenie = {ask} 'Co chciałbyś kupić?'\ncena = {ask} 'Ile to kosztuje?'\nzaoszczędzone = {ask} 'Ile pieniędzy już zaoszczędziłeś?'\nkieszonkowe = {ask} 'Ile kieszonkowego dostajesz na tydzień?'\ndo_zaoszczędzenia = cena - zaoszczędzone\n\ tygodnie = do_zaoszczędzenia / kieszonkowe \n{print} 'Możesz kupić ' _ ' za ' _ ' tygodni.'\n```\n" - start_code: '# umieść tutaj swój kod' 14: story_text: | ### Exercise @@ -3005,7 +2604,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Naciśnięcia klawiszy default_save_name: Naciśnięty @@ -3034,7 +2632,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# tutaj wpisz swój kod' 7: story_text: | Skoro już nauczyłeś się polecenia `{repeat}` możesz naciskać klawisze wiele razy! Dzięki temu możesz sprawić, że żółw będzie chodził do przodu i obracał się. @@ -3045,7 +2642,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# umieść tutaj swój kod' 9: story_text: |- Teraz gdy wiesz, jak łączyć instrukcje, możesz utworzyć narzędzie pisania bezwzrokowego za pomocą `{pressed}`. @@ -3054,7 +2650,6 @@ adventures: Dokończ kod. Za każdym razem program ma wybrać losową literę, którą należy nacisnąć. Otrzymujesz punkt za prawidłowy klawisz i odjęcie dwóch punktów za niewłaściwy klawisz. **(extra)** Clear the screen after each letter, and show the user how many points they have scored. example_code: "```\npunkty = 1\nlitery = a, b, c, d, e\n{repeat} 10 {times}\n litera = _ _ _\n {print} 'Naciśnij literę ' litera \n {if} litera {is} {pressed}\n _\n _\n _\n```\n" - start_code: '# umieść tutaj swój kod' print_command: name: '{print}' default_save_name: print @@ -3081,8 +2676,6 @@ adventures: ``` _ Cześć! ``` - start_code: | - {print} Witamy w Hedy! 18: story_text: |- We arrived at real Python code! That means we need to use parentheses with `{print}` and `{range}` from now on. @@ -3099,8 +2692,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Mistrz Quizu @@ -3131,7 +2723,6 @@ adventures: {if} points_b > points_a {print} 'You belong to the B club' ``` - start_code: '# umieść tutaj swój kod' quotation_marks: name: '''Cudzysłowy''' default_save_name: cudzysłowy @@ -3161,10 +2752,6 @@ adventures: {print} 'I'm babysitting my sister's kids' {print} 'What's more fun than that?' ``` - start_code: |- - {print} 'Od teraz musimy używać cudzysłowów!' - odpowiedź {is} {ask} 'Czego musimy używać?' - {print} 'Musimy używać ' odpowiedź 12: story_text: | **All texts need to be in quotation marks** @@ -3199,10 +2786,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: Komenda pozycja losowa @@ -3237,9 +2820,6 @@ adventures: nagroda {is} _ _ ``` - start_code: | - zwierzęta {is} psy, koty, kangury - {print} zwierzęta {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. @@ -3288,11 +2868,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3306,10 +2881,6 @@ adventures: {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! @@ -3324,13 +2895,6 @@ adventures: {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 @@ -3356,10 +2920,6 @@ adventures: 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? @@ -3377,11 +2937,6 @@ adventures: _ {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: Restauracja default_save_name: Restauracja @@ -3398,7 +2953,6 @@ adventures: Następnie dodaj co najmniej 4 kolejne linie kodu do programu restauracji. Zapytaj klienta, co chciałby wypić i czy chce zapłacić gotówką, czy kartą. Na koniec wymyśl jakiś miły sposób pożegnania się z klientem. - start_code: '# umieść swój kod tutaj' 2: story_text: | Na poziomie 2 możesz rozbudować swoją restaurację za pomocą zmiennych. Na poziomie 1 Hedy mogła wyświetlić {echo} zamówienie tylko raz i pamiętała tylko ostatnią zamówioną rzecz. @@ -3423,7 +2977,6 @@ adventures: Teraz dodaj własne podsumowanie zamówionego przez klienta jedzenia i napojów. **Dodatkowo** Teraz gdy nauczyłeś się używać zmiennych, możesz użyć tylu zmiennych w jednej linii, ile tylko zechcesz. Czy możesz dodać więcej zmiennych do swojego kodu, jak np. zjeść w lokalu lub na wynos, gotówką lub kartą, ze słomką lub bez itp? - start_code: '# umieść swój tutaj' 3: story_text: | Masz problem z podjęciem decyzji, co chcesz zjeść na obiad? Możesz pozwolić Hedy wybrać za Ciebie! @@ -3451,7 +3004,6 @@ adventures: ceny {is} _ _ ``` - start_code: '# umieść swój kod tutaj' 4: story_text: | W tym poziomie musisz używać cudzysłowu, gdy używasz polecenia `{print}` lub `{ask}`. @@ -3471,7 +3023,6 @@ adventures: {print} Dziękujemy za zamówienie. {print} Twoje jedzenie i napoje będą na miejscu! ``` - start_code: '# umieść tutaj swój kod' 5: story_text: | Na tym poziomie polecenie `{if}` pozwala Ci na `{ask}` (zapytanie) klientów i udzielanie różnych odpowiedzi. @@ -3492,7 +3043,6 @@ adventures: {if} cokolwiek {is} nie {print} 'To wszystko!' {else} {print} 'jeden ' cokolwiek {print} 'Dziękujemy za zamówienie i smacznego!' ``` - start_code: '# umieść tutaj swój kod' 6: story_text: | Na tym poziomie możesz użyć matematyki do obliczenia całkowitej ceny zamówienia klienta, co może sprawić, że Twoja wirtualna restauracja będzie bardziej realistyczna. @@ -3511,7 +3061,6 @@ adventures: {print} 'To będzie ' cena ' złotych.' {print} 'Dziękuję, smacznego!' ``` - start_code: '# umieść tutaj swój kod' 7: story_text: | Na tym poziomie nauczyłeś się używać polecenia `{repeat}` do powtórzenia linii kodu określoną ilość razy. @@ -3525,7 +3074,6 @@ adventures: {print} 'Witamy w restauracji Chez Hedy' osoby = {ask} 'Ile osób dzisiaj do nas dołącza?' ``` - start_code: '# umieść tutaj swój kod' 8: story_text: | Na tym poziomie możesz rozbudować swoją wirtualną restaurację, powtarzając wiele linii kodu. W ten sposób: @@ -3544,14 +3092,12 @@ adventures: ### Ćwiczenie Ten kod można rozszerzyć o więcej pozycji w menu, na przykład oferując napoje i/lub wiele dań, lub deserów. Dodaj jeszcze co najmniej jeden element. **Dodatkowo** Dodaj jeszcze więcej elementów, tyle opcji, ile chcesz! - start_code: '# umieść tutaj swój kod' 9: story_text: "Na tym poziomie możesz użyć wcięć, aby Twoja restauracja była bardziej realistyczna i zabawniejsza!\n\n### Ćwiczenie\nWcięcie zostało usunięte z przykładowego kodu.\nCzy potrafisz określić, ile wcięć potrzebuje każda linia, aby kod działał poprawnie?\nJeśli klient zamawia\ \ pizzę, Hedy nie powinna pytać, jakiego sosu chce klient.\n\n**Dodatkowo** Restauracja nie posiada wszystkich sosów. Sporządź listę dostępnych sosów i przy każdym zamówieniu napisz, czy je sprzedajesz.
\n**Dodatkowo** Pizze mają dodatki. Zapytaj klientów, czego chcą.
\n**Dodatkowo**\ \ Czy klienci chcą drinka? Zapytaj ich też!
\n" example_code: "```\n{print} 'Witamy w Restauracji Chez Hedy!'\nosoby = {ask} 'Ile osób dzisiaj do nas dołączy?'\n{print} 'Świetnie!'\ncena = 0\n{repeat} osoby {times}\n_ jedzenie = {ask} 'Co chciałbyś zamówić?'\n_ {print} jedzenie \n_ {if} jedzenie {is} frytki\n_ cena = cena + 3\n_ sos\ \ = {ask} 'Jaki sos chciałbyś mieć do swoich frytek?'\n_ {if} sos {is} nie\n_ {print} 'bez sosu'\n _ {else}\n_ cena = cena + 1\n_ {print} 'z ' sos\n_ {if} jedzenie {is} pizza\n _ cena = cena + 4\n{print} 'To będzie ' cena ' złotych.'\n{print} 'Smacznego!'\n```\n" - start_code: '# umieść tutaj swój kod' 10: story_text: | Na tym poziomie nauczysz się, jak łatwo pytać o zamówienia na różne dania. @@ -3582,7 +3128,6 @@ adventures: {print} 'Więc chcesz zamówić dla ' osoby ' osób.' {print} 'Chodźmy!' ``` - start_code: '# umieść tutaj swój kod' 12: story_text: | Od tego poziomu możesz używać liczb dziesiętnych, aby menu było bardziej realistyczne. @@ -3604,7 +3149,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# umieść tutaj swój kod' 13: story_text: | Na tym poziomie możemy wykorzystać nowe komendy do ulepszenia naszej restauracji. @@ -3619,14 +3163,12 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# umieść tutaj swój kod' 15: story_text: | Dzięki `{while}` możesz mieć pewność, że Twoi klienci będą mogli dodawać zamówienia, dopóki ich nie skończą. ### Exercise Correctly add the `{while}` command to this code. example_code: "```\n{print} 'Witamy w McHedy'\nwięcej = 'tak'\n_\n zamówienie = {ask} 'Co chcesz zamówić?'\n {print} zamówienie \n więcej = {ask} 'Czy chciałby Pan/Pani zamówić coś jeszcze?'\n{print} 'Dziękuję!'\n```\n" - start_code: '# umieść tutaj swój kod' rock: name: Papier, kamień, nożyce default_save_name: Kamień @@ -3653,9 +3195,6 @@ adventures: {ask} wybierz z _ {echo} a więć wybrałeś: ``` - start_code: | - {print} Witaj w swoim własnym programie kamień, papier, nożyce! - {ask} Co wybierzesz? 2: story_text: | Na tym poziomie możesz poćwiczyć używanie zmiennych, dzięki będziesz mógł stworzyć grę w papier, kamień, nożyce w następnym poziomie! @@ -3664,7 +3203,6 @@ adventures: _ {is} {ask} papier, kamień czy nożyce? {print} Ja wybrałam _ ``` - start_code: '# umieść swój kod tutaj' 3: story_text: | Na tym poziomie możemy wprowadzać listy i wybierać z nich rzeczy. @@ -3687,7 +3225,6 @@ adventures: {print} gracz 1 wybiera... możliwości {at} {random} {print} gracz 2 _ ``` - start_code: '{print} Witamy, w twojej własnej grze w papier, kamień, nożyce!' 4: story_text: | Na tym poziomie możemy dodatkowo zaprogramować kamień, papier, nożyce. Jeśli chcesz dodać tekst, tutaj również musisz użyć cudzysłowów. @@ -3695,7 +3232,6 @@ adventures: ### Ćwiczenie Przekopiuj swój kod z poprzedniego poziomu i spraw, żeby zadziałał używając cudzysłowów w każdej komendzie `{print}` i `{ask}`. - start_code: '{print} ''Witamy w twoim własnym programie kamień, papier, nożyce!''' 5: story_text: | Na tym poziomie możemy ustalić, kto wygrał. @@ -3715,13 +3251,11 @@ adventures: ``` Fill in the correct code on the blanks to see {if} it is a draw. - start_code: '{print} ''Witamy w twoim własnym programie kamień, papier, nożyce!''' 9: story_text: "W tym poziomie można zaprogramować całą grę kamień, papier, nożyce poprzez zagnieżdżanie poleceń `{if}`. \n\n### Ćwiczenie\nCzy potrafisz dokończyć kod? Program musi powiedzieć, kto wygrał dla każdej kombinacji.\n\n**Dodatkowo** Chcesz zagrać w więcej niż jedną grę? Rozwiń\ \ kod tak, aby można było rozegrać wiele rund. Możesz nawet użyć `{ask}`, aby zapytać użytkownika, ile rund chce zagrać.\n" example_code: "```\nopcje = papier, kamień, nożyce\ntwój_wybór = {ask} 'Co wybierasz?'\n{print} 'Wybrałeś ' twój_wybór \nwybór_komputera = opcje {at} {random}\n{print} 'Komputer wybrał ' wybór_komputera \n{if} wybór_komputera {is} twój_wybór \n {print} 'remis'\n{if} wybór_komputera\ \ {is} kamień\n {if} twój_wybór {is} papier\n {print} 'Wygrałeś!'\n {if} twój_wybór {is} nożyce\n {print} 'Przegrałeś!'\n#dokończ program\n```\n" - start_code: '# umieść tutaj swój kod' 10: story_text: | Czujesz się zbyt leniwy, by samemu zagrać w grę? Pozwól Hedy zagrać w nią za Ciebie! @@ -3741,7 +3275,6 @@ adventures: {for} gracz {in} gracze {print} gracz ' wybiera ' wybory {at} {random} ``` - start_code: '# umieść tutaj swój kod' 13: story_text: | Dzięki poleceniu `{and}` możesz skrócić swój kod kamień, papier, nożyce! Sprawdź poniższy przykładowy kod i spróbuj go dokończyć. @@ -3760,14 +3293,12 @@ adventures: {print} 'Komputer wygrał!' _ ``` - start_code: '# umieść tutaj swój kod' 15: story_text: | ### Ćwiczenie Graj, aż pokonasz komputer! Najpierw dokończ przykładowy kod... example_code: "```\nwygrana = 'nie'\nwybory = 'kamień', 'papier', 'nożyce'\n {while} wygrana == 'nie'\n twój_wybór = {ask} 'Co wybierasz?'\n wybór_komputera = wybory {at} {random}\n {print} 'Ty wybrałeś' twój_wybór \n {print} 'komputer wybrał ' wybór_komputera\n {if} wybór_komputera\ \ == twój_wybór\n {print} 'Remis!'\n {if} wybór_komputera == 'kamień' {and} twój_wybór == 'nożyce'\n {print} 'Przegrywasz!'\n {if} wybór_komputera == 'kamień' {and} twój_wybór == 'papier'\n {print} 'Wygrywasz!'\n wygrana = 'tak'\n_\n```\n" - start_code: '# umieść tutaj swój kod' rock_2: name: Papier, kamień, nożyce 2 default_save_name: Kamień_2 @@ -3784,7 +3315,6 @@ adventures: wybór {is} _ {print} Wybrałam wybór ``` - start_code: '# tutaj wstaw swój kod' secret: name: Super Szpieg default_save_name: language @@ -3811,7 +3341,6 @@ adventures: b = 'dziś o 10.00' {print} a + b ``` - start_code: '# umieść tutaj swój kod' 13: story_text: | Czy potrafisz wpisać właściwe polecenie w pustym miejscu? Mózg: Superszpieg musi poprawnie odpowiedzieć na OBA pytania, zanim zdobędzie poufne informacje! @@ -3824,7 +3353,6 @@ adventures: {else} {print} 'Idź na dworzec o 10.00' ``` - start_code: '# umieść tutaj swój kod' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3840,10 +3368,6 @@ adventures: {sleep} 2 {print} zielony! ``` - start_code: |- - {print} Moim ulubionym kolorem jest... - {sleep} 2 - {print} zielony! songs: name: Zaśpiewaj piosenkę! default_save_name: Piosenka @@ -3875,7 +3399,6 @@ adventures: {print} 'SKAKAĆ NA ŁÓŻKU ZABRONIONE JEST!' {sleep} ``` - start_code: '{print} ''Zacznijmy śpiewać!''' 7: story_text: | Piosenki często zawierają dużo powtórzeń, na przykład: Dziecko Rekin (ang. Baby Shark)! Jeżeli ją zaśpiewasz to będziesz śpiewać ten w kółko ten sam tekst: @@ -3894,7 +3417,6 @@ adventures: {repeat} _ _ {print} 'Dziecko Rekin tututudutudu' {print} 'Dziecko Rekin' ``` - start_code: '{print} ''Dziecko Rekin''' 8: story_text: | W poprzednich poziomach programowałeś piosenkę "Butelki Piwa" (ang. Bottles of Beer). Bez użycia polecenia `{repeat}` musiałeś wiele razy skopiować wersy piosenki. @@ -3912,7 +3434,6 @@ adventures: wers = wers - 1 {print} wers ' butelek piwa na ścianie' ``` - start_code: '# umieść tutaj swój kod' 10: story_text: | Dzięki `{for}` możesz wydrukować całą piosenkę „Baby Shark” (w tym wszystkie inne rekiny w rodzinie) w zaledwie 6 liniach! @@ -3929,7 +3450,6 @@ adventures: ``` małpki = 5, 4, 3, 2, 1 ``` - start_code: '# umieść tutaj swój kod' 11: story_text: | Na tym poziomie możesz użyć `{for}` z `{range}`, aby tworzyć piosenki, które wykorzystują liczenie, takie jak 5 małych małpek. @@ -3945,7 +3465,6 @@ adventures: {print} małpki 'małe małpki skaczące po łóżku' _ ``` - start_code: '# umieść swój kod tutaj' 12: story_text: | W tej piosence jeszcze prościej zaprogramujemy 'jeśli jesteś dziś szczęśliwy w dłonie klaszcz'. To wszystko dzięki temu, że wszystkie akcje możemy przypisać do zmiennej. Zobacz jak: @@ -3964,7 +3483,6 @@ adventures: {print} 'jeśli jesteś dziś szczęśliwy' {print} akcja ``` - start_code: '# umieść tutaj swój kod' 13: 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? @@ -3981,16 +3499,6 @@ adventures: {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: | Na tym poziomie możesz jeszcze szybciej zaprogramować utwór taki jak „Dziadek Fajną Farmę Miał”. Możesz połączyć odpowiednie zwierzę z odpowiednim dźwiękiem, po prostu umieszczając je w tym samym miejscu na liście. @@ -4023,7 +3531,6 @@ adventures: {print} 'Hej ho i już się wznosi,' {print} 'Wcześnie o poranku!' ``` - start_code: '# umieść tutaj swój kod' 18: story_text: | W poziomie 16 stworzyliśmy piosenki przy użyciu list. Te programy nie będą już działały poprawnie w tym poziomie. Dwukropki z poziomu 17 i nawiasy kwadratowe z poziomu 18 muszą zostać dodane. @@ -4045,7 +3552,6 @@ adventures: {print} 'Hej ho i już się wznosi,' {print} 'Wcześnie o poranku!' ``` - start_code: '# Tutaj wpisz swój kod' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4067,15 +3573,6 @@ adventures: {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: Kółko i Krzyżyk default_save_name: Tic @@ -4143,7 +3640,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# umieść tutaj swój kod' 14: story_text: | Na poprzednich poziomach stworzyłeś grę w kółko i krzyżyk. Teraz nauczyłeś się używać znaku =, znaku == i znaku !=. @@ -4206,7 +3702,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# umieść tutaj swój kod' 15: story_text: | Na tym poziomie możesz poprawić swoją grę w kółko i krzyżyk za pomocą pętli {while}. Za pomocą tej pętli możesz połączyć `{if} game != 'over'` i `{for} i {in} {range} 1 {to} 9` w jedną prostą linię. @@ -4268,7 +3763,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# umieść tutaj swój kod' 17: story_text: | Na poprzednich poziomach gra w kółko i krzyżyk miała irytującą cechę. Po każdym ruchu musiałeś się wpisać, czy wygrałeś, czy nie. @@ -4355,7 +3849,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# umieść tutaj swój kod' turtle: name: Żółw default_save_name: Żółw @@ -4379,9 +3872,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | Na tym poziomie możesz używać zmiennych aby uczynić żółwia interaktywnym. Na przykład możesz zapytać użytkownika ile kroków ma zrobić twój żółw. @@ -4407,11 +3897,6 @@ adventures: {turn} kąt {forward} 25 ``` - start_code: |- - {print} Wyścig żółwi! - kąt {is} 90 - {turn} kąt - {forward} 25 3: story_text: | Na tym poziomie możesz użyć `{at} {random}` podczas rysowania żółwiem. Losowy wybór sprawia, że żółw za każdym razem idzie inną ścieżką. @@ -4424,10 +3909,6 @@ adventures: {turn} kąty {at} {random} {forward} 25 ``` - start_code: |- - kąty {is} 10, 50, 90, 150, 250 - {turn} kąty {at} {random} - {forward} 25 4: story_text: | Na poziomie 4 musisz użyć cudzysłowów z poleceniami `{print}` oraz `{ask}`. To samo się dotyczy rysowania! @@ -4454,11 +3935,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Rysujemy figury' - kąt {is} 90 - {turn} kąt - {forward} 25 5: story_text: | Na poziomie 5 możesz dokonywać wyboru przy użyciu polecenia `{if}`. Przykładem takiego wyboru byłby wybór pomiędzy różnymi typami figur do narysowania. @@ -4491,12 +3967,6 @@ adventures: {if} kierunek {is} prawo {turn} _ {forward} 100 ``` - start_code: |- - {print} 'Rysujemy figury' - figura {is} {ask} 'Czy chciałbyś narysować kwadrat czy też trójkąt?' - {if} figura {is} trójkąt kąt {is} 120 {else} kąt {is} 90 - {turn} kąt - {forward} 25 6: story_text: | Na tym poziomie możesz użyć matematyki żeby narysować różne figury. @@ -4504,7 +3974,6 @@ adventures: Z tego też powodu już wiesz dlaczego gdy rysujemy kwadrat to obracamy się o 90 stopni. Jako, że kwadrat ma cztery boki pod kątem prostym to znaczy że kąt pomiędzy nimi to 90 stopni - 360 stopni podzielone przez 4 (boki) to 90 stopni. Dzięki temu, że w Hedy możesz przeprowadzać obliczenia matematyczne, możesz tez rysować wszystkie figury jakie tylko chcesz! example_code: "```\nkątów = {ask} 'Ile chcesz kątów?'\nkąt = 360 / kątów\n{forward} 50\n{turn} kąt\n{forward} 50\n{turn} kąt\n{forward} 50\n{turn} kąt\n{forward} 50\n{turn} kąt\n{forward} 50\n{turn} kąt\n{forward} 50 \n{turn} kąt\n```\n" - start_code: '{print} ''Rysujemy figury''' 8: story_text: | Dzięki naszej nowo nabytej umiejętności powtarzania wielu linii kodu możemy rysować figury w jeszcze prostszy sposób. @@ -4554,7 +4023,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# umieść tutaj swój kod' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4572,7 +4040,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4597,16 +4064,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4622,7 +4079,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4633,7 +4089,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4644,7 +4099,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4662,7 +4116,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4681,7 +4134,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4701,7 +4153,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4712,7 +4163,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4725,7 +4175,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4756,7 +4205,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4797,7 +4245,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4820,7 +4267,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4849,7 +4295,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4873,7 +4318,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -4901,7 +4345,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -4935,7 +4378,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -4955,11 +4397,6 @@ adventures: 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: Nowy Rok default_save_name: Odliczanie do Nowego Roku @@ -4977,4 +4414,3 @@ adventures: {print} liczba {print} 'Szczęśliwego Nowego Roku!' ``` - start_code: '# tutaj umieść swój kod' diff --git a/content/adventures/pt_BR.yaml b/content/adventures/pt_BR.yaml index d03a3dfa32f..11b2c207be5 100644 --- a/content/adventures/pt_BR.yaml +++ b/content/adventures/pt_BR.yaml @@ -22,7 +22,6 @@ adventures: ``` story_text_2: "### Exercício \nAgora crie sua própria história com pelo menos 6 linhas de código.\nEssa história não pode ser a mesma do código de exemplo.\nUse pelo menos um comando `{ask}` e um comando `{echo}`.\nVocê pode escolher qualquer tópico para a história.\nSe não conseguir pensar\ \ em um tópico, pode usar uma das nossas sugestões: ir ao cinema, uma partida esportiva ou um dia no zoológico.\n" - start_code: '{print} A sua história começa aqui' 2: story_text: | No nível 2 você pode tornar sua história mais divertida. O nome do seu personagem principal agora pode estar em qualquer lugar dentro da frase. @@ -48,7 +47,6 @@ adventures: 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} Sua história' 3: story_text: | No nível 3 você pode tornar sua história mais divertida. Você pode usar aleatoriedade para qualquer monstro, animal ou outro obstáculo, assim: @@ -77,7 +75,6 @@ adventures: lixo {is} {ask} Qual item deve ser descartado? {remove} lixo {from} mochila ``` - start_code: '{print} Sua história' 4: story_text: | Você deve ter notado que ainda há um problema nos níveis anteriores. Você tentou imprimir uma frase que continha a palavra nome? @@ -92,7 +89,6 @@ adventures: {print} 'Ele ouve o som de' animais {at} {random} {print} nome 'tem medo que esta seja uma floresta assombrada' ``` - start_code: '{print} ''Sua história será impressa aqui!''' 5: story_text: | Neste nível você pode programar finais diferentes, o que tornará sua história ainda mais divertida. @@ -115,7 +111,6 @@ adventures: {if} final {is} feliz {print} nome 'pega a espada e o monstro foge rapidamente' {else} {print} 'O monstro devora' nome ``` - start_code: '{print} ''Aqui a sua história vai começar!''' 7: story_text: | Em uma história, alguém diz a mesma palavra várias vezes. Por exemplo, quando alguém pede ajuda ou canta uma música. @@ -126,7 +121,6 @@ adventures: {repeat} 5 {times} {print} 'Socorro!' {print} 'Por que ninguém está me ajudando?' ``` - start_code: '{repeat} 5 {times} {print} ''Socorro!''' 8: story_text: | Neste nível você pode usar várias linhas em seus comandos {if}, desta forma você pode atualizar seu final feliz ou triste! @@ -144,7 +138,6 @@ adventures: {print} 'Mas Ricardo é muito lento...' {print} 'O T-rex se aproxima e o devora em uma grande mordida!🦖' ``` - start_code: '# coloque o seu código aqui' 9: story_text: | Neste nível você pode usar o encaixamento para colocar comandos {if}, {repeat} ou {for} dentro de outros comandos {if}, {repeat} ou {for}. Isso oferece muitas opções e realmente ajuda você a tornar sua história interativa. @@ -163,7 +156,6 @@ adventures: {else} {print} 'Roberta vai para casa' ``` - start_code: '# coloque o seu código aqui' 10: story_text: | Neste nível você pode usar o comando {for} em sua história. Desta forma, você poderia facilmente programar o livro infantil 'urso pardo, urso pardo, o que você vê'. @@ -180,7 +172,6 @@ adventures: {print} 'O que você vê?' {print} 'Vejo todos os animais olhando para mim!' ``` - start_code: '# coloque o seu código aqui' 12: story_text: Neste nível, você pode usar as aspas simples para salvar várias palavras em uma variável. example_code: | @@ -188,7 +179,6 @@ adventures: nome = 'A Rainha da Inglaterra' {print} nome 'estava comendo um pedaço de bolo, quando de repente...' ``` - start_code: '# coloque o seu código aqui' 13: story_text: | Usando os comandos `{and}` e `{or}`, você pode encurtar suas histórias. Por exemplo, confira a história do dragão. @@ -218,7 +208,6 @@ adventures: {print} 'Isso pode ser muito útil' espada = 'encontrada' ``` - start_code: '# coloque o seu código aqui' 15: story_text: | Usar o laço `{while}` pode tornar suas histórias mais interessantes. Por exemplo, você pode usar `{while} jogo == 'ligado'` para poder jogar até que o jogo termine. @@ -241,7 +230,6 @@ adventures: {print} 'Não, elas não estão no ' local {print} 'Agora você pode entrar na casa!' ``` - start_code: '# coloque o seu código aqui' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -262,7 +250,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -302,13 +289,6 @@ adventures: _ {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 @@ -326,11 +306,6 @@ adventures: {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 @@ -363,10 +338,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -394,11 +365,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -510,7 +476,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# coloque o seu código aqui' calculator: name: Calculadora default_save_name: Calculadora @@ -545,7 +510,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -564,7 +528,6 @@ adventures: 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! @@ -581,7 +544,6 @@ adventures: {else} {print} 'That is wrong. The right answer is ' correct ``` - start_code: '# coloque o seu código aqui' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -597,7 +559,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -608,7 +569,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' _ ``` - start_code: '# coloque o seu código aqui' 13: story_text: | ### Exercise 1 @@ -625,7 +585,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -650,11 +609,7 @@ adventures: 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 @@ -686,7 +641,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# coloque o seu código aqui' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -735,17 +689,6 @@ adventures: 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 @@ -768,12 +711,6 @@ adventures: {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. @@ -793,14 +730,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -822,16 +751,6 @@ adventures: 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 @@ -846,13 +765,6 @@ adventures: {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 @@ -875,17 +787,7 @@ adventures: {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' @@ -912,19 +814,7 @@ adventures: 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: @@ -940,11 +830,6 @@ adventures: 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 @@ -969,10 +854,7 @@ adventures: {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} @@ -1009,19 +891,7 @@ adventures: 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: @@ -1036,11 +906,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1080,26 +945,6 @@ adventures: 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 @@ -1128,27 +973,6 @@ adventures: 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 @@ -1181,31 +1005,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1235,9 +1034,7 @@ adventures: 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?' @@ -1294,36 +1091,6 @@ adventures: 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 @@ -1473,7 +1240,6 @@ adventures: Experimente o código você mesmo com o botão 'Executar código' verde debaixo do campo de programação. Preparado? Então vá para a próxima aba para aprender o seu primeiro comando! - start_code: '{print} olá mundo!' 2: story_text: | Parabéns! Você chegou ao nível 2.Você provavelmente já fez alguns códigos incríveis! @@ -1493,14 +1259,12 @@ adventures: Isso muda no nível 2. No nível 2 você vai aprender a trabalhar com variáveis, que lhe permitem salvar múltiplos pedaços de informações e imprimi-los onde você quiser. Então vamos para a próxima aba! - start_code: '{print} olá mundo!' 3: story_text: | No último nível você aprendeu o que é uma variável e como usá-las para fazer sua aventura mais interativa. Mas... isso não é a única coisa que você pode fazer com variáveis! Você também pode usar variáveis para fazer listas. E você pode até deixar a Hedy escolher uma palavra aleatória da lista, o que lhe permite criar jogos de verdade! Dê uma olhada na próxima aba! - start_code: '{print} olá mundo!' 4: story_text: | No nível 4, `{ask}` e `{print}` foram alterados. @@ -1516,7 +1280,6 @@ adventures: resposta {is} {ask} 'O que precisamos usar de agora em diante?' {print} 'Precisamos usar ' resposta ``` - start_code: '{print} ''Olá mundo''' 5: story_text: | No nível 5 há algo novo, o `{if}`! Com o `{if}` você pode escolher entre duas opções diferentes. @@ -1527,9 +1290,6 @@ adventures: nome {is} {ask} 'qual o seu nome?' {if} nome {is} Hedy {print} 'legal' {else} {print} 'não tão legal' ``` - start_code: |- - nome {is} {ask} 'qual o seu nome?' - {if} nome {is} Hedy {print} 'legal!' {else} {print} 'não tão legal' 6: story_text: | Neste nível você aprende algo novo: agora você também pode calcular. @@ -1552,7 +1312,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy é divertida!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy é divertida!''' 8: story_text: | Os comandos `{ask}` e `{print}` ainda funcionam da mesma forma, mas `{if}`, `{else}`, `{pressed}` e `{repeat}` mudaram! @@ -1576,10 +1335,6 @@ adventures: {print} 'INVASOR!' {print} 'Você não pode usar esse computador' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Olá pessoal' - {print} 'Isso vai ser impresso 5 vezes' 9: story_text: | Neste nível você pode não só usar múltiplas linhas com `{if}` e `{repeat}`, mas também juntar os dois! @@ -1595,13 +1350,6 @@ adventures: {else} {print} 'pizza é melhor' ``` - start_code: |- - {repeat} 3 {times} - comida = {ask} 'O que você deseja?' - {if} comida {is} 'pizza' - {print} 'excelente!' - {else} - {print} 'pizza é melhor' 10: story_text: |- Neste nível vamos aprender um novo comando chamado `{for}`. Com `{for}` você pode fazer uma lista e usar todos os elementos. @@ -1612,17 +1360,10 @@ adventures: {for} animal {in} animais {print} 'Eu adoro ' animal ``` - start_code: |- - animais {is} cachorro, gato, peixe - {for} animal {in} animais - {print} 'Eu adoro ' 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. 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: |- - {for} contador {in} {range} 1 {to} 5 - {print} contador 12: story_text: |- **Números decimais** @@ -1632,8 +1373,7 @@ adventures: {print} 'Dois e meio mais dois e meio é...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'números decimais agora precisam de um ponto' + {print} 2.5 + 2.5 13: story_text: Agora vamos aprender `{and}` e `{or}`! Se você quiser verificar duas declarações, você não precisa usar dois `{if}`s, mas pode usar `{and}` e `{or}`. Se você usar `{and}`, ambas as declarações, à esquerda e à direita de `{and}` precisam ser verdadeiras. Também podemos usar @@ -1645,11 +1385,6 @@ adventures: {if} nome {is} 'Hedy' {and} idade {is} 2 {print} 'Você é a verdadeira Hedy!' ``` - start_code: |- - nome = {ask} 'qual o seu nome?' - idade = {ask} 'qual a sua idade?' - {if} nome {is} 'Hedy' {and} idade {is} 2 - {print} 'Você é realmente a Hedy!' 14: story_text: | Vamos aprender mais novos itens. Você já deve conhecê-los da matemática, os `<` e `>`. @@ -1664,8 +1399,7 @@ adventures: {if} idade > 12 {print} 'Você é mais velho(a) do que eu!' ``` - start_code: |- - idade = {ask} 'Quantos anos você tem?' + {if} idade < 13 {print} 'Você é mais novo(a) do que eu!' {else} @@ -1684,11 +1418,6 @@ adventures: resultado = {ask} 'Quanto é 5 vezes 5?' {print} 'Uma resposta correta foi dada' ``` - start_code: |- - resultado = 0 - {while} resultado != 25 - resultado = {ask} 'Quanto é 5 vezes 5?' - {print} 'Foi dada uma boa resposta' 16: story_text: |- Vamos fazer listas do jeito Python, com colchetes ao redor das listas! Também mantemos as aspas simples em torno de cada item, como aprendemos nos níveis anteriores. @@ -1715,9 +1444,8 @@ adventures: {print} i {print} 'Preparado(a) ou não, aqui vou eu!' 18: - story_text: Chegamos ao código Python real! Isso significa que precisamos usar parênteses com {print} e {range} de agora em diante. - start_code: |- - nome = 'Hedy' + story_text: |- + Chegamos ao código Python real! Isso significa que precisamos usar parênteses com {print} e {range} de agora em diante. {print}('Meu nome é ', nome) dice: name: Dado @@ -1745,12 +1473,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1765,7 +1491,6 @@ adventures: _ 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. @@ -1782,7 +1507,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1794,7 +1518,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1806,7 +1529,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# coloque o seu código aqui' 15: story_text: | ### Exercise @@ -1831,7 +1553,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# coloque o seu código aqui' dishes: name: Pratos? default_save_name: Pratos @@ -1849,7 +1570,6 @@ adventures: ``` story_text_2: | Não sente vontade de lavar a louça sozinho? Hackeie o programa para remover seu nome da lista. - start_code: '{print} Quem lava os pratos?' 4: story_text: | Com as aspas simples você pode deixar seu planejamento de lavagem de louça mais bonito. @@ -1865,7 +1585,6 @@ adventures: {sleep} {print} pessoas {at} _ ``` - start_code: '{print} ''Quem lava os pratos?''' 5: story_text: | Com o `{if}` agora você pode se divertir mais com a escolha do programa. Você pode fazer com que seu programa responda à escolha que o computador fez. @@ -1878,7 +1597,6 @@ adventures: lavador {is} pessoas {at} {random} {if} lavador {is} Sofia {print} _ pena que tenho que lavar os pratos _ {else} {print} 'felizmente sem pratos porque' _ 'já está lavando' ``` - start_code: '{print} ''Quem lava os pratos?''' 6: story_text: | Quantas vezes todo mundo vai lavar a louça? Isso é justo? Você pode contá-lo neste nível. @@ -1911,7 +1629,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1920,7 +1637,6 @@ adventures: 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 could make an even better dish washing shedule. @@ -1931,7 +1647,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# coloque o seu código aqui' elif_command: name: '{elif}' default_save_name: elif @@ -1979,10 +1694,6 @@ adventures: {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: |- 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. @@ -1994,10 +1705,6 @@ adventures: {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: 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. @@ -2036,7 +1743,6 @@ adventures: A Hedy agora apenas diz o seu nome. Você pode expandir o código para que a Hedy possa prever mais coisas sobre você? Obviamente, a Hedy ainda não é uma vidente muito boa, pois ela só pode repetir as respostas que foram dadas pelos jogadores! Dê uma olhada no nível 2 para melhorar sua cartomante. - start_code: '# coloque o seu código aqui' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2054,7 +1760,6 @@ adventures: story_text_2: | ### Exercises Now, Hedy can only answer yes, no or maybe. Can you give Hedy more answer options, like 'definitely' or '{ask} again'. - start_code: '# coloque o seu código aqui' 4: story_text: | This level has no new functions, but allows you to practice with using the quotation marks. @@ -2076,7 +1781,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# coloque o seu código aqui' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2092,7 +1796,6 @@ adventures: {if} person {in} friends {print} good_answer {at} {random} {else} {print} bad_answer {at} {random} ``` - start_code: '# coloque o seu código aqui' 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. @@ -2110,7 +1813,6 @@ adventures: {sleep} {print} kids ' kids!' ``` - start_code: '# coloque o seu código aqui' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2122,7 +1824,6 @@ adventures: options = they love you, they love you not _ _ _ _ options {at} {random} ``` - start_code: '# coloque o seu código aqui' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2139,7 +1840,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# coloque o seu código aqui' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2155,7 +1855,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# coloque o seu código aqui' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2167,7 +1866,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# coloque o seu código aqui' functions: name: functions default_save_name: functions @@ -2207,21 +1905,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2250,13 +1933,6 @@ adventures: {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. @@ -2280,17 +1956,6 @@ adventures: 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 @@ -2319,7 +1984,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2341,7 +2005,6 @@ adventures: _ {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: Casa mal-assombrada default_save_name: Casa mal-assombrada @@ -2370,7 +2033,6 @@ adventures: ``` story_text_2: | Você pode terminar a história assustadora? Ou inventar sua própria história de casa mal-assombrada? - start_code: '{print} Como eu cheguei aqui?' 2: story_text: | In this haunted house you can choose your monsters with emojis. Of course you could also use words. @@ -2428,7 +2090,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# coloque o seu código aqui' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2444,7 +2105,6 @@ adventures: {sleep} {print} monsters {at} {random} ``` - start_code: '# coloque o seu código aqui' 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. @@ -2463,7 +2123,6 @@ adventures: _ _ _ _ {print} 'Great! Youve escaped!' {else} {print} 'Oh no! You are being eaten by a...' monsters {at} {random} ``` - start_code: '# coloque o seu código aqui' 9: story_text: | In this level you can use nesting, which allows you to make the haunted house even more interactive! @@ -2488,7 +2147,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2500,7 +2158,6 @@ adventures: {print} 'Room ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2529,7 +2186,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2563,7 +2219,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2594,18 +2249,7 @@ adventures: {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?' @@ -2644,10 +2288,6 @@ adventures: _ _ _ 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... @@ -2664,11 +2304,6 @@ adventures: {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. @@ -2684,16 +2319,6 @@ adventures: {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 @@ -2722,11 +2347,6 @@ adventures: _ 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 @@ -2752,10 +2372,6 @@ adventures: 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: @@ -2764,8 +2380,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2797,8 +2412,7 @@ adventures: {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} @@ -2821,7 +2435,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# coloque o seu código aqui' 16: story_text: | ### Exercise @@ -2842,7 +2455,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# coloque o seu código aqui' maths: name: maths default_save_name: maths @@ -2882,8 +2494,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Papagaio @@ -2909,7 +2520,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Eu sou Hedy a papagaio' 2: story_text: | Crie seu próprio papagaio de estimação online que irá copiar você! @@ -2926,7 +2536,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Eu sou Hedy a papagaio!' 3: story_text: | Ensine ao seu papagaio uma nova palavra com `{add}`. @@ -2939,7 +2548,6 @@ adventures: {print} 🧒 Diga nova_palavra , Hedy! {print} 🦜 palavras {at} {random} ``` - start_code: '# coloque o seu código aqui' 4: story_text: | In this level we have to use quotation marks with the commands `{ask}` and `{print}`. @@ -2953,7 +2561,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Recompense seu papagaio se ele disser a palavra correta! @@ -2969,7 +2576,6 @@ adventures: {if} palavra_dita {is} nova_palavra {print} '🧒 Ótimo trabalho, Hedy! 🍪' {else} {print} '🧒 Não, Hedy! Diga ' nova_palavra ``` - start_code: '# coloque o seu código aqui' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -2989,7 +2595,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# coloque o seu código aqui' 14: story_text: | ### Exercise @@ -3013,7 +2618,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3042,7 +2646,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3055,7 +2658,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3075,7 +2677,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3101,8 +2702,6 @@ adventures: ``` _ 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. @@ -3119,8 +2718,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3152,7 +2750,6 @@ adventures: {if} points_b > points_a {print} 'You belong to the B club' ``` - start_code: '# coloque o seu código aqui' quotation_marks: name: '''quotation marks''' default_save_name: quotation_marks @@ -3182,10 +2779,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3220,10 +2813,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3257,9 +2846,6 @@ adventures: 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. @@ -3308,11 +2894,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3326,10 +2907,6 @@ adventures: {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! @@ -3344,13 +2921,6 @@ adventures: {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 @@ -3376,10 +2946,6 @@ adventures: 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? @@ -3397,11 +2963,6 @@ adventures: _ {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 @@ -3420,7 +2981,6 @@ adventures: ``` story_text_2: | Você consegue pensar em mais linhas para adicionar ao código do seu restaurante? Por exemplo, você pode usar {ask} para perguntar aos convidados o que eles gostariam de beber, dizer o preço ou desejar uma refeição agradável? - start_code: '# coloque o seu código aqui' 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. @@ -3440,7 +3000,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# coloque o seu código aqui' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3463,7 +3022,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# coloque o seu código aqui' 4: story_text: |- In this level you have to use quotation marks when using the `{print}` command. @@ -3483,7 +3041,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# coloque o seu código aqui' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3495,7 +3052,6 @@ adventures: {if} drink {in} drinks_in_stock {print} 'One ' drink 'coming up!' {else} {print} 'Sorry, we do not sell that' ``` - start_code: '# coloque o seu código aqui' 6: 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. @@ -3514,7 +3070,6 @@ adventures: {print} 'That will be ' price ' dollars, please' {print} 'Thank you, enjoy your meal!' ``` - start_code: '# coloque o seu código aqui' 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. @@ -3533,7 +3088,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - start_code: '# coloque o seu código aqui' 8: story_text: | In this level you can make your virtual restaurant more elaborate by repeating multiple lines of code. Like this: @@ -3554,7 +3108,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add as many options as you like! - start_code: '# coloque o seu código aqui' 9: story_text: | In this level you can use nesting to make your restaurant more realistic and more fun! @@ -3582,7 +3135,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# coloque o seu código aqui' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3612,7 +3164,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# coloque o seu código aqui' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3631,7 +3182,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# coloque o seu código aqui' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3646,7 +3196,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# coloque o seu código aqui' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3662,7 +3211,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# coloque o seu código aqui' rock: name: Pedra, papel, tesoura default_save_name: Pedra @@ -3699,7 +3247,6 @@ adventures: choice {is} rock {print} I choose _ ``` - start_code: '# coloque o seu código aqui' 3: story_text: | You can use the `{at} {random}` command to let the computer pick rock, paper or scissors! @@ -3721,12 +3268,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3746,7 +3291,6 @@ 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. Can you finish the code? @@ -3766,7 +3310,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# coloque o seu código aqui' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3776,7 +3319,6 @@ adventures: players = _ {for} _ ``` - start_code: '# coloque o seu código aqui' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3795,7 +3337,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# coloque o seu código aqui' 15: story_text: | ### Exercise @@ -3818,7 +3359,6 @@ adventures: won = 'yes' _ ``` - start_code: '# coloque o seu código aqui' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3835,7 +3375,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3859,7 +3398,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# coloque o seu código aqui' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3872,7 +3410,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# coloque o seu código aqui' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3888,10 +3425,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Cante uma canção! default_save_name: Canção @@ -3925,7 +3458,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Bebê tubarão''' 7: story_text: | As músicas geralmente contêm muita repetição. Por exemplo... Bebê Tubarão! Se você canta, você continua cantando a mesma coisa: @@ -3943,7 +3475,6 @@ adventures: ``` Depois do Bebê Tubarão, você também pode programar outras músicas. Há muitas músicas com repetição. - start_code: '{print} ''Bebê Tubarão''' 8: story_text: | Em um nível anterior você programou a música 'Garrafas de cerveja'. Você fez um verso e depois teve que copiar os versos 99 vezes. No nível 7 você pode repetir a música 99 vezes, apenas adicionando uma linha simples! @@ -3957,7 +3488,6 @@ adventures: verso = verso - 1 {print} verso 'garrafas de cerveja na parede' ``` - start_code: '# coloque o seu código aqui' 10: story_text: | Neste nível, você pode facilmente fazer a música infantil 'Cinco macaquinhos'. Você pode fazer o último refrão? @@ -4009,7 +3539,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# coloque o seu código aqui' 11: story_text: | Neste nível você pode usar o comando `{for} i {in} {range}` para fazer músicas que usam contagem. @@ -4024,7 +3553,6 @@ adventures: {else} {print} 'CHEGA DE MACACOS PULANDO NA CAMA!' ``` - start_code: '# coloque o seu código aqui' 12: story_text: | Nesta música podemos tornar ainda mais fácil programar '{if} você está feliz e sabe disso, bata palmas'. Uma vez que podemos colocar todas as ações em uma variável, confira: @@ -4039,7 +3567,6 @@ adventures: {print} 'se você está feliz e sabe disso' {print} ação ``` - start_code: '# coloque o seu código aqui' 13: 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? @@ -4056,16 +3583,6 @@ adventures: {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: | Neste nível, você pode programar uma música como Velho MacDonald ainda mais rapidamente. Você pode conectar o animal certo ao som certo simplesmente colocando-os no mesmo lugar na lista. @@ -4098,7 +3615,6 @@ adventures: {print} 'e assim se levanta a âncora' {print} 'no início da manhã' ``` - start_code: '# coloque o seu código aqui' 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. @@ -4120,7 +3636,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4142,15 +3657,6 @@ adventures: {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: Jogo da velha default_save_name: Tic @@ -4219,7 +3725,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# coloque o seu código aqui' 14: 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. @@ -4282,7 +3787,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# coloque o seu código aqui' 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. @@ -4344,7 +3848,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# coloque o seu código aqui' 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. @@ -4431,7 +3934,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# coloque o seu código aqui' turtle: name: Tartaruga default_save_name: Tartaruga @@ -4453,9 +3955,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | Neste nível você pode usar variáveis para tornar a tartaruga interativa. Por exemplo, você pode perguntar ao jogador quantos passos a tartaruga deve dar. @@ -4479,11 +3978,6 @@ adventures: {turn} ângulo {forward} 25 ``` - start_code: |- - {print} Corrida de tartaruga! - ângulo {is} 90 - {turn} ângulo - {forward} 25 3: story_text: | Neste nível você pode usar `{at} {random}` com a tartaruga de desenho. Uma escolha aleatória faz com que a tartaruga percorra um caminho diferente a cada vez. @@ -4494,10 +3988,6 @@ adventures: {turn} ângulos {at} {random} {forward} 25 ``` - start_code: |- - ângulos {is} 10, 50, 90, 150, 250 - {turn} ângulos {at} {random} - {forward} 25 4: story_text: | No nível 4 você tem que usar aspas com `{print}` e `{ask}`. Também ao desenhar! @@ -4524,11 +4014,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Desenhando figuras' - ângulo {is} 90 - {turn} ângulo - {forward} 25 5: story_text: | No nível 5 você pode fazer uma escolha com `{if}`. Por exemplo, entre diferentes tipos de figuras. @@ -4561,12 +4046,6 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: |- - {print} 'Desenhando Figuras' - figura {is} {ask} 'Você quer um quadrado ou um triângulo?' - {if} figura {is} triângulo ângulo {is} 120 {else} ângulo {is} 90 - {turn} ângulo - {forward} 25 6: story_text: | Neste nível você pode usar cálculos para desenhar figuras diferentes. @@ -4590,7 +4069,6 @@ adventures: {forward} 50 {turn} ângulo ``` - start_code: '{print} ''Desenhando figuras''' 8: story_text: | Agora que podemos repetir várias linhas, podemos fazer figuras com mais facilidade. @@ -4633,7 +4111,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4654,7 +4131,6 @@ adventures: {forward} distance ``` ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4679,16 +4155,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4704,7 +4170,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4715,7 +4180,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4726,7 +4190,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4744,7 +4207,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4763,7 +4225,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4783,7 +4244,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4794,7 +4254,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4807,7 +4266,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4838,7 +4296,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4879,7 +4336,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4902,7 +4358,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4931,7 +4386,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4955,7 +4409,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -4983,7 +4436,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5017,7 +4469,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5037,11 +4488,6 @@ adventures: 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 @@ -5059,4 +4505,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/pt_PT.yaml b/content/adventures/pt_PT.yaml index d8aac376de9..6c0e76d57dd 100644 --- a/content/adventures/pt_PT.yaml +++ b/content/adventures/pt_PT.yaml @@ -17,7 +17,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: print A tua história começa aqui 2: story_text: | No nível 2 podes tornar a tua história ainda mais divertida. O nome da tua personagem principal pode agora aparecer em qualquer parte da frase. @@ -42,7 +41,6 @@ adventures: 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 A tua história 3: story_text: | Podes também acrescentar algo aleatório à tua história. Pode ser um monstro, um animal ou qualquer outro obstáculo. @@ -73,7 +71,6 @@ adventures: dump {is} {ask} Which item should he dump? {remove} dump {from} bag ``` - start_code: print 'A tua história será escrita aqui!' 4: story_text: | Podes ter notado que ainda existe um erro no nível 2. @@ -93,7 +90,6 @@ adventures: print 'Ele ouve um som de uma' animais at random print nome 'tem medo que a floresta seja assombrada' ``` - start_code: print 'A tua história será escrita aqui!' 5: story_text: | In this level you can program different endings, which will make your story even more fun. @@ -116,7 +112,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -127,7 +122,6 @@ adventures: {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! @@ -142,7 +136,6 @@ adventures: {print} 'Oh no! Richard is too slow...' {print} _ ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -161,12 +154,10 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. example_code: "```\nanimals = _ , _ , _ \n{print} 'Brown bear, Brown bear'\n{print} 'What do you see?'\n```\n" - start_code: '# place your code here' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -175,7 +166,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -188,7 +178,6 @@ adventures: {if} path {is} 'left' {and} weapon {is} 'sword' _ ``` - start_code: '# place your code here' 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. @@ -211,7 +200,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -232,7 +220,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -272,13 +259,6 @@ adventures: _ {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 @@ -296,11 +276,6 @@ adventures: {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 @@ -333,10 +308,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -364,11 +335,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -480,7 +446,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -515,7 +480,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -534,7 +498,6 @@ adventures: 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! @@ -551,7 +514,6 @@ adventures: {else} {print} 'That is wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -567,7 +529,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -578,7 +539,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' _ ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -595,7 +555,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 14: story_text: | In this level you can programm the game 'Guess which number' @@ -616,7 +575,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' 15: story_text: | You can add the `{while}` loop to the calculator game you've learned to make in a previous level. @@ -643,7 +601,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -692,17 +649,6 @@ adventures: 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 @@ -725,12 +671,6 @@ adventures: {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. @@ -750,14 +690,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -779,16 +711,6 @@ adventures: 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 @@ -803,13 +725,6 @@ adventures: {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 @@ -832,17 +747,7 @@ adventures: {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' @@ -869,19 +774,7 @@ adventures: 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: @@ -897,11 +790,6 @@ adventures: 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 @@ -926,10 +814,7 @@ adventures: {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} @@ -966,19 +851,7 @@ adventures: 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: @@ -993,11 +866,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1037,26 +905,6 @@ adventures: 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 @@ -1085,27 +933,6 @@ adventures: 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 @@ -1138,31 +965,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1192,9 +994,7 @@ adventures: 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?' @@ -1251,36 +1051,6 @@ adventures: 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 @@ -1426,7 +1196,6 @@ adventures: 1: story_text: "No nível 1 pode usar os comandos `{print}`, `{ask}` e `{echo}`. \nEscreve o teu código no painel de programação. Ou pressiona o botão verde no bloco do código exemplo, e o código será digitado para ti! \nExperimenta o código com o botão verde 'Executar código', por baixo do\ \ painel de programação. \n \nPodes imprimir o texto no ecrã usando o comando `{print}`. \n" - start_code: print Olá mundo! 2: story_text: | No nível 2 vamos aprender algo novo. Podemos atribuir um nome a uma palavra utilizando `is`. @@ -1439,13 +1208,11 @@ adventures: {print} name is age years old ``` story_text_2: '`print` funciona tal e qual como no nível 1 e já não precisas de usar `echo`. Nota: `ask` mudou, também podes guardar a resposta com um nome, da seguinte maneira.' - start_code: print Olá mundo! 3: story_text: | No nível 3 também podes criar uma lista. Podes fazer o computador escolher algo aleatório (ou seja, uma coisa ao calhas) dessa lista. Fazes isso utilizando 'at random'. Encontras todos os códigos do nível 3 na barra esquerda. Temos também separadores com tarefas. - start_code: print Olá mundo! 4: story_text: | `ask` funciona no nível 4 tal como funcionava no nível 3, mas `print` está diferente agora. @@ -1464,7 +1231,6 @@ adventures: answer is ask 'What do we need to use from now on?' print 'We need to use ' answer ``` - start_code: print 'Olá mundo!' 5: story_text: | `ask` e `print` funcionam como no nível 4. @@ -1480,9 +1246,6 @@ adventures: nome is ask 'Como te chamas?' if nome is Hedy print 'Fixe!' else print 'boo!' ``` - start_code: |- - nome is ask 'Como te chamas?' - if nome is Hedy print 'Fixe!' else print 'pff' 6: story_text: | `ask`, `print` e `if` ainda funcionam como nos nível 5. @@ -1509,7 +1272,6 @@ adventures: ``` repeat 3 times print 'Hedy é divertida!' ``` - start_code: repeat 3 times print 'Hedy é divertida!' 8: story_text: | `ask` e `print` ainda funcionam como já conheces. Mas `if` e `repeat` mudaram! @@ -1523,10 +1285,6 @@ adventures: print 'Olá a todos!' print 'Tudo isto é repetido 5 vezes.' ``` - start_code: |- - repeat 5 times - print 'Olá amigos!' - print 'Isto vai ser escrito 5 vezes.' 9: story_text: | In this level you can not only use multiple lines with `if` and `repeat`, but you can also put them together! @@ -1541,13 +1299,6 @@ adventures: 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' 10: story_text: | In this level we learn a new code called `for`. With `for` you can make a list and use all elements. @@ -1558,17 +1309,10 @@ adventures: for animal in animals print 'I love ' animal ``` - start_code: |- - animals is 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. 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: |- - for counter in range 1 to 5 - print counter 12: story_text: |- **Decimal numbers** @@ -1578,8 +1322,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 13: story_text: Vamos agora aprender `and` e `or`! Se queres verificar duas instruções, não precisas de usar dois `if` mas podes usar `and` e `or`. Se utilizares `and`, ambas as instruções, à esquerda e à direita do `and` têm de ser verdadeiras. Podemos também utilizar `or`. Neste caso, apenas @@ -1591,11 +1334,6 @@ adventures: 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!' 14: story_text: Vamos aprender mais coisas novas! Podes já ter aprendido sobre elas na Matemática, o `<` e `>`. O `<` verifica se o primeiro número é menor que o segundo, como `4 < 5`. O `>` verifica se o primeiro número é maior que o segundo, como `6 > 5`. example_code: | @@ -1604,8 +1342,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - idade = ask 'Quantos anos tens?' + if idade < 13 print 'És mais novo a do que eu!' else @@ -1619,11 +1356,6 @@ adventures: answer = ask 'What is 5 times 5?' print 'A correct answer has been given' ``` - start_code: |- - resultado = 0 - while resultado != 25 - resultado = ask 'Quanto é 5 vezes 5?' - print 'Foi dada a resposta correcta.' 16: story_text: "Nós vamos criar listas do jeito do Python, com parêntesis reto ao redor das listas! Nós também mantemos as aspas em torno de cada item, como nós aprendemos nos níveis anteriores. \nTambém pode usar os parêntesis para indicar um lugar nas listas." example_code: | @@ -1648,9 +1380,8 @@ adventures: print i print 'Preparados ou não, aqui vou eu!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dice @@ -1678,12 +1409,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1698,7 +1427,6 @@ adventures: _ 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. @@ -1715,7 +1443,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1727,7 +1454,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1739,7 +1465,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1764,7 +1489,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1782,7 +1506,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1798,7 +1521,6 @@ adventures: {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. @@ -1812,7 +1534,6 @@ adventures: _ 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: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1845,7 +1566,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1854,7 +1574,6 @@ adventures: 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 could make an even better dish washing shedule. @@ -1865,7 +1584,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1913,10 +1631,6 @@ adventures: {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: |- 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. @@ -1928,10 +1642,6 @@ adventures: {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: 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. @@ -1971,7 +1681,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -1990,7 +1699,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2012,7 +1720,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2028,7 +1735,6 @@ adventures: {if} person {in} friends {print} good_answer {at} {random} {else} {print} bad_answer {at} {random} ``` - start_code: '# place your code here' 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. @@ -2046,7 +1752,6 @@ adventures: {sleep} {print} kids ' kids!' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2058,7 +1763,6 @@ adventures: options = they love you, they love you not _ _ _ _ options {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2075,7 +1779,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2091,7 +1794,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2103,7 +1805,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2143,21 +1844,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2186,13 +1872,6 @@ adventures: {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. @@ -2216,17 +1895,6 @@ adventures: 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 @@ -2255,7 +1923,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2277,7 +1944,6 @@ adventures: _ {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 @@ -2306,7 +1972,6 @@ adventures: ``` story_text_2: | Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2353,7 +2018,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2369,7 +2033,6 @@ adventures: {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. @@ -2388,7 +2051,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2416,7 +2078,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2442,7 +2103,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2471,7 +2131,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2505,7 +2164,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2536,18 +2194,7 @@ adventures: {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?' @@ -2586,10 +2233,6 @@ adventures: _ _ _ 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... @@ -2606,11 +2249,6 @@ adventures: {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. @@ -2626,16 +2264,6 @@ adventures: {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 @@ -2664,11 +2292,6 @@ adventures: _ 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 @@ -2694,10 +2317,6 @@ adventures: 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: @@ -2706,8 +2325,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2739,8 +2357,7 @@ adventures: {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} @@ -2763,7 +2380,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2784,7 +2400,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2824,8 +2439,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2851,7 +2465,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2868,7 +2481,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2881,7 +2493,6 @@ adventures: {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}`. @@ -2895,7 +2506,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -2911,7 +2521,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -2931,7 +2540,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -2955,7 +2563,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -2984,7 +2591,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -2997,7 +2603,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3017,7 +2622,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3043,8 +2647,6 @@ adventures: ``` _ 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. @@ -3061,8 +2663,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3094,7 +2695,6 @@ adventures: {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 @@ -3124,10 +2724,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3162,10 +2758,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3199,9 +2791,6 @@ adventures: 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. @@ -3250,11 +2839,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3268,10 +2852,6 @@ adventures: {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! @@ -3286,13 +2866,6 @@ adventures: {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 @@ -3318,10 +2891,6 @@ adventures: 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? @@ -3339,11 +2908,6 @@ adventures: _ {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 @@ -3362,7 +2926,6 @@ adventures: ``` story_text_2: | Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3382,7 +2945,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3414,7 +2976,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3434,7 +2995,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3455,7 +3015,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3474,7 +3033,6 @@ adventures: {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. @@ -3486,7 +3044,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3503,7 +3060,6 @@ adventures: ``` story_text_2: | Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3531,7 +3087,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3576,7 +3131,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3595,7 +3149,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3610,7 +3163,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3627,7 +3179,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3654,7 +3205,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3663,7 +3213,6 @@ adventures: 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! @@ -3685,12 +3234,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3710,7 +3257,6 @@ 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. Can you finish the code? @@ -3730,7 +3276,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3740,7 +3285,6 @@ adventures: players = _ {for} _ ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3759,7 +3303,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3782,7 +3325,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3799,7 +3341,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3823,7 +3364,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3836,7 +3376,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3852,10 +3391,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3888,7 +3423,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3904,7 +3438,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3918,7 +3451,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -3970,7 +3502,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -3985,7 +3516,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4000,7 +3530,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4017,16 +3546,6 @@ adventures: {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. @@ -4062,7 +3581,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4084,7 +3602,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4106,15 +3623,6 @@ adventures: {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 @@ -4183,7 +3691,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4246,7 +3753,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4308,7 +3814,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4395,7 +3900,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: turtle @@ -4419,9 +3923,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | In level 1 the turtle could only turn left or right. That is a bit boring! @@ -4449,11 +3950,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: | - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4464,10 +3960,6 @@ adventures: {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! @@ -4494,11 +3986,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: | - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4531,12 +4018,6 @@ adventures: 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. @@ -4560,8 +4041,6 @@ adventures: {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. @@ -4584,8 +4063,6 @@ adventures: {turn} _ {forward} _ ``` - start_code: | - hoeken = {ask} 'How many angles should I draw?' 9: story_text: | Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures. @@ -4605,7 +4082,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4623,7 +4099,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4648,16 +4123,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4673,7 +4138,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4684,7 +4148,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4695,7 +4158,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4713,7 +4175,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4732,7 +4193,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4752,7 +4212,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4763,7 +4222,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4776,7 +4234,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4807,7 +4264,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4848,7 +4304,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4871,7 +4326,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4900,7 +4354,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4924,7 +4377,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -4952,7 +4404,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -4986,7 +4437,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5006,11 +4456,6 @@ adventures: 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 @@ -5028,4 +4473,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/ro.yaml b/content/adventures/ro.yaml index b0cf2deb660..06124f9da6f 100644 --- a/content/adventures/ro.yaml +++ b/content/adventures/ro.yaml @@ -22,7 +22,6 @@ adventures: ``` story_text_2: "### Exercițiu\nCrează acum povestea ta cu cel puțin 6 line de cod.\nAceastă poveste nu poate fi la fel ca si codul din examplu. \nUtilizează cel puțin o dată comanda `{ask}` și o comandă `{echo}` .\nPoți scrie ceva despre ceea ce iți place ție. \nDacă nu ai idei, alege unul\ \ din următoarele subiecte: cinema, meci de fotbal sau o zi la grădina zoologică.\n" - start_code: '{print} Povestea ta începe aici' 2: story_text: "In nivelul 2 poți face o poveste mai frumoasă și interesantă. Numele personajului principal poate fi oriunde în propoziție.\n\nPentru a crea asta trebuie să programezi un pic mai mult de data asta. Trebuie să decizi numele personajului principal. \n\nPoți pune acum numele\ \ oriunde vrei in propoziție.\n" @@ -44,7 +43,6 @@ adventures: 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: @@ -78,7 +76,6 @@ adventures: 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. @@ -100,7 +97,6 @@ adventures: {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. @@ -126,7 +122,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -141,7 +136,6 @@ adventures: {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! @@ -164,7 +158,6 @@ adventures: {print} 'Oo nu! Richard se mișcă prea încet...' {print} _ ``` - start_code: '# place your code here' 9: story_text: "In acest nivel poți folosi comenzile `{if}` și `{repeat}` in interiorul altor `{if}` și `{repeat}` comenzi. \nAceasta posibilitate iți oferă mai multe opțiuni si te ajută sa creezi o poveste interactivă.\n\n### Exercițiu 1\nCompletează programul astfel incât comanda `{if}`\ \ funcționează corect.\n\n### Exercițiul 2\nAdaugă `{if}` și `{else}` in partea din poveste in care Robin merge acasă.\n\n### Exercițiul 3\nIntoarce-te la povestea de la nivelul și folosește cel puțin de două ori comanda `{if}`s în interiorul altei comenzi `{if}`.\n" @@ -183,7 +176,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -192,7 +184,6 @@ adventures: 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' 12: story_text: |- In this level quotation marks will be needed to save multiple words in a variable. @@ -205,7 +196,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -238,7 +228,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -261,7 +250,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -282,7 +270,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -322,13 +309,6 @@ adventures: _ {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 @@ -346,11 +326,6 @@ adventures: {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 @@ -383,10 +358,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -414,11 +385,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -530,7 +496,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -567,7 +532,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. @@ -588,7 +552,6 @@ adventures: 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! @@ -606,7 +569,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -622,7 +584,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -633,7 +594,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -650,7 +610,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -675,11 +634,7 @@ adventures: 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 @@ -711,7 +666,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -760,17 +714,6 @@ adventures: 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 @@ -793,12 +736,6 @@ adventures: {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. @@ -818,14 +755,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -847,16 +776,6 @@ adventures: 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 @@ -871,13 +790,6 @@ adventures: {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 @@ -900,17 +812,7 @@ adventures: {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' @@ -937,19 +839,7 @@ adventures: 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: @@ -965,11 +855,6 @@ adventures: 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 @@ -994,10 +879,7 @@ adventures: {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} @@ -1034,19 +916,7 @@ adventures: 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: @@ -1061,11 +931,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1105,26 +970,6 @@ adventures: 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 @@ -1153,27 +998,6 @@ adventures: 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 @@ -1206,31 +1030,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1260,9 +1059,7 @@ adventures: 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?' @@ -1319,36 +1116,6 @@ adventures: 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 @@ -1498,7 +1265,6 @@ adventures: Încearcă singur codul cu butonul verde 'Rulează codul' sub câmpul de programare. Poți afișa text pe ecran folosind comanda `{print}`. - start_code: '{print} salutări!' 2: story_text: | În nivelul 2 învățăm două comenzi noi: `{is}` și `{sleep}`. @@ -1513,11 +1279,9 @@ adventures: ``` story_text_2: | `{print}` funcționează în continuare la fel, dar comanda `{ask}` s-a schimbat. Trebuie să folosiți o variabilă și în comanda `{ask}`. Arată așa: - start_code: '{print} salutări!' 3: story_text: | În nivelul 3 poți face o listă. Poți lăsa calculatorul să aleagă ceva aleatoriu din listă. Faci acest lucru cu `{at} {random}`. - start_code: '{print} salutări!' 4: story_text: | In nivelul 4 `{ask}` și `{print}` s-au schimbat. @@ -1530,7 +1294,6 @@ adventures: răspuns {is} {ask} 'Ce trebuie să folosim de acum înainte?' {print} 'Trebuie să folosim' răspuns ``` - start_code: '{print} ''Salutări''' 5: story_text: | La nivelul 5 există ceva nou, `{if}`! Cu `{if}` puteți alege între două opțiuni diferite. @@ -1541,9 +1304,6 @@ adventures: nume {is} {ask} 'cum te numești?' {if} nume {is} Hedy {print} 'frumos' {else} {print} 'bau!' ``` - start_code: |- - nume {is} {ask} 'Cum te numești?' - {if} nume {is} Hedy {print} 'super!' {else} {print} 'moa' 6: story_text: | In acest nivel inveți ceva nou: poți face calcule aritmetice. @@ -1566,7 +1326,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy e distractiv!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy e distractiv!''' 8: story_text: | `{ask}` și `{print}` funcționează în continuare așa cum le cunoști. Dar `{if}`, `{else}` și `{repeat}` s-au schimbat! @@ -1590,10 +1349,6 @@ adventures: {print} 'INTRUS!' {print} 'Nu puteți folosi acest calculator!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Salutări' - {print} 'Aceasta va fi afișată de 5 ori' 9: story_text: | În acest nivel nu numai că poți folosi mai multe linii cu `{if}` și `{repeat}`, dar le și poți combina! @@ -1608,13 +1363,6 @@ adventures: {else} {print} 'pizza e mai bună' ``` - start_code: |- - {repeat} 3 {times} - mâncare = {ask} 'Ce dorești?' - {if} mâncare {is} pizza - {print} 'grozav!' - {else} - {print} 'pizza e mai bună' 10: story_text: |- În acest nivel învățăm un nouă comandă numită `{for}`. Cu `{for}` poți face o listă și poți folosi toate elementele. @@ -1625,17 +1373,10 @@ adventures: {for} animal {in} animale {print} 'Îmi place' animal ``` - start_code: |- - animale {is} câine, pisică, pește - {for} animal {in} animale - {print} 'Îmi place' 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. 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: |- - {for} număr {in} {range} 1 {to} 5 - {print} număr 12: story_text: |- **Numere zecimale** @@ -1645,8 +1386,7 @@ adventures: {print} 'Doi și jumătate plus doi și jumătate face...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'numerele zecimale au acum nevoie de un punct' + {print} 2.5 + 2.5 13: story_text: |- @@ -1660,11 +1400,6 @@ adventures: {if} nume {is} 'Hedy' {and} vârsta {is} 2 {print} 'Tu ești adevăratul program Hedy!' ``` - start_code: |- - nume = {ask} 'cum te numești?' - vârsta = {ask} 'ce vârsta ai?' - {if} nume {is} 'Hedy' {and} vârsta {is} 2 - {print} 'Tu ești adevăratul program Hedy!' 14: story_text: | Vom invăța comenzi noi. Probabil le stii deja de la matematică: simbolurile: `<` și `>`. @@ -1679,8 +1414,7 @@ adventures: {if} vârsta > 12 {print} 'Ești mai în vârstă decât mine!' ``` - start_code: |- - vârsta = {ask} 'Ce vârsta ai?' + {if} vârsta < 13 {print} 'Ești mai tânăr(ă) decât mine!' {else} @@ -1699,11 +1433,6 @@ adventures: răspuns = {ask} 'Cât face 5 ori 5?' {print} 'Am dat un răspuns corect' ``` - start_code: |- - răspuns = 0 - {while} răspuns != 25 - răspuns = {ask} 'Cât face 5 ori 5?' - {print} 'Am dat un răspuns corect' 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. @@ -1733,8 +1462,7 @@ adventures: story_text: |- We arrived at real Python code! That means we need to use parentheses with 1`{print}` and 2`{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. - start_code: |- - nume = 'Hedy' + {print}('Numele meu este ', nume) dice: name: Dice @@ -1762,12 +1490,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1781,7 +1507,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1801,7 +1526,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1813,7 +1537,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1826,7 +1549,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1851,7 +1573,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1869,7 +1590,6 @@ adventures: ``` story_text_2: | 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: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1885,7 +1605,6 @@ adventures: {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. @@ -1893,7 +1612,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1926,7 +1644,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1935,7 +1652,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1946,7 +1662,6 @@ adventures: _ day _ days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1994,10 +1709,6 @@ adventures: {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: |- In acest nivel, adăugăm o nouă formă a comenzii `{for}`. În nivelurile anterioare, am folosit `{for}` cu o listă, dar putem folosi `{for}` și cu numere. @@ -2010,10 +1721,6 @@ adventures: {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: 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. @@ -2053,7 +1760,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2071,7 +1777,6 @@ adventures: 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. @@ -2096,7 +1801,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2109,7 +1813,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2144,7 +1847,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2156,7 +1858,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2176,7 +1877,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2192,7 +1892,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2204,7 +1903,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2244,21 +1942,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2287,13 +1970,6 @@ adventures: {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. @@ -2317,17 +1993,6 @@ adventures: 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 @@ -2356,7 +2021,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2378,7 +2042,6 @@ adventures: _ {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 @@ -2408,7 +2071,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2455,7 +2117,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2472,7 +2133,6 @@ adventures: {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. @@ -2494,7 +2154,6 @@ adventures: _ _ _ _ {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! @@ -2523,7 +2182,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2552,7 +2210,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2581,7 +2238,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2615,7 +2271,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2646,18 +2301,7 @@ adventures: {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?' @@ -2696,10 +2340,6 @@ adventures: _ _ _ 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... @@ -2716,11 +2356,6 @@ adventures: {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. @@ -2736,16 +2371,6 @@ adventures: {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 @@ -2774,11 +2399,6 @@ adventures: _ 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 @@ -2804,10 +2424,6 @@ adventures: 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: @@ -2816,8 +2432,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2849,8 +2464,7 @@ adventures: {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} @@ -2876,7 +2490,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2897,7 +2510,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2937,8 +2549,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2964,11 +2575,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Im Hedy the parrot - {ask} What is your name? - {echo} - {echo} 2: story_text: | Create your own online pet parrot that will copy you! @@ -2985,7 +2591,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3000,7 +2605,6 @@ adventures: {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}`. @@ -3014,7 +2618,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3031,7 +2634,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3052,7 +2654,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3076,7 +2677,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3105,7 +2705,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3118,7 +2717,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3138,7 +2736,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3164,8 +2761,6 @@ adventures: ``` _ 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. @@ -3182,8 +2777,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3215,7 +2809,6 @@ adventures: {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 @@ -3245,10 +2838,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3283,10 +2872,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3320,9 +2905,6 @@ adventures: 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. @@ -3371,11 +2953,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3389,10 +2966,6 @@ adventures: {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! @@ -3407,13 +2980,6 @@ adventures: {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 @@ -3439,10 +3005,6 @@ adventures: 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? @@ -3460,11 +3022,6 @@ adventures: _ {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 @@ -3484,7 +3041,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3501,7 +3057,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3535,7 +3090,6 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - 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. @@ -3555,7 +3109,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3576,7 +3129,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3595,7 +3147,6 @@ adventures: {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. @@ -3610,7 +3161,6 @@ adventures: {repeat} _ {times} food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3628,7 +3178,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3661,7 +3210,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3709,7 +3257,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3731,7 +3278,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3746,7 +3292,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3763,7 +3308,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3790,9 +3334,6 @@ adventures: {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! @@ -3801,7 +3342,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3823,12 +3363,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3848,7 +3386,6 @@ 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. Can you finish the code? @@ -3868,7 +3405,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3880,7 +3416,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3899,7 +3434,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3922,7 +3456,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3939,7 +3472,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3966,7 +3498,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3979,7 +3510,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3995,10 +3525,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4036,7 +3562,6 @@ adventures: {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: @@ -4054,7 +3579,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In this level you can repeat the song 99 times, just by adding one simple line! @@ -4069,7 +3593,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4130,7 +3653,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting, like the 5 little monkeys. @@ -4148,7 +3670,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4167,7 +3688,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4184,16 +3704,6 @@ adventures: {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. @@ -4229,7 +3739,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4251,7 +3760,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4273,15 +3781,6 @@ adventures: {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 @@ -4317,7 +3816,6 @@ adventures: {else} player = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4380,7 +3878,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4442,7 +3939,6 @@ adventures: {else} simbol = 'x' ``` - start_code: '# scrie programul tău aici' 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. @@ -4529,7 +4025,6 @@ adventures: {else}: simbol = 'x' ``` - start_code: '# scrie programul tău aici' turtle: name: Turtle default_save_name: Turtle @@ -4553,9 +4048,6 @@ adventures: {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. @@ -4581,11 +4073,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4598,10 +4085,6 @@ adventures: {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! @@ -4628,11 +4111,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4665,12 +4143,6 @@ adventures: 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. @@ -4694,7 +4166,6 @@ adventures: {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. @@ -4737,7 +4208,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4755,7 +4225,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4780,16 +4249,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4805,7 +4264,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4816,7 +4274,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4827,7 +4284,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4845,7 +4301,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4864,7 +4319,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4884,7 +4338,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4895,7 +4348,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4908,7 +4360,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4939,7 +4390,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4980,7 +4430,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5003,7 +4452,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5032,7 +4480,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5056,7 +4503,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5084,7 +4530,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5118,7 +4563,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5138,11 +4582,6 @@ adventures: 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 @@ -5160,4 +4599,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/ru.yaml b/content/adventures/ru.yaml index 90e04a855bd..7ecafe753fc 100644 --- a/content/adventures/ru.yaml +++ b/content/adventures/ru.yaml @@ -22,7 +22,6 @@ adventures: ``` story_text_2: | Можете ли вы создать свою собственную историю в Hedy, используя `{print}`, `{ask}` и `{echo}`? - start_code: '{print} Ваша история начинается здесь' 2: story_text: | На уровне 2 вы можете сделать свой рассказ более интересным. Теперь имя вашего главного героя может находиться в любом месте предложения. @@ -49,7 +48,6 @@ adventures: Измените команды `{ask}` и `{echo}` в их правильную форму, которую вы изучили на этом уровне **(дополнительно)** Добавьте команду `{sleep}`, чтобы добавить напряжения вашему уровню. - start_code: '{print} Ваша история' 3: story_text: | На уровне 3 вы можете сделать свою историю более увлекательной. Вы можете использовать случайность для любого монстра, животного или другого препятствия, например, так: @@ -80,7 +78,6 @@ adventures: dump {is} {ask} Which item should he dump? {remove} dump {from} bag ``` - start_code: '{print} Ваша история' 4: story_text: | Возможно, вы заметили, что в предыдущих уровнях все еще существует проблема. Вы пытались напечатать предложение, содержащее слово имя? Например, `{print}` моё имя есть имя. @@ -105,7 +102,6 @@ adventures: {print} _ Он слышит звуки _ животных {at} {random} {print} имя _ боится, что это лес с привидениями _ ``` - start_code: '{print} ''Ваша история будет напечатана здесь!''' 5: story_text: | На этом уровне вы можете запрограммировать различные концовки, которые сделают вашу историю еще более увлекательной. @@ -128,7 +124,6 @@ adventures: {if} end {is} good {print} name 'достаёт свой меч, и монстр быстро убегает' {else} {print} 'Монстр съел' name ``` - start_code: '{print} ''Здесь начнется ваша история!''' 7: story_text: | В рассказе кто-то произносит слова несколько раз. Например, когда кто-то зовет на помощь или поет песню. @@ -141,7 +136,6 @@ adventures: {repeat} 5 {times} {print} 'Help!' {print} 'Why is nobody helping me?' ``` - start_code: '{repeat} 5 {times} {print} ''Help!''' 8: story_text: | В этом уровне вы можете использовать несколько строк в командах `{if}`, таким образом вы можете улучшить счастливый или грустный конец! @@ -168,7 +162,6 @@ adventures: {print} 'Но Ричард очень медленный...' {print} 'И Т-Рекс приближается и с одного укуса сьедает его!🦖' ``` - start_code: '# разместите здесь свой код' 9: story_text: | На этом уровне вы можете использовать вложенность, чтобы поместить команды `{if}`, `{repeat}` или `{for}` внутри других команд `{if}`, `{repeat}` или `{for}`. Это дает вам множество возможностей и действительно помогает сделать вашу историю интерактивной. @@ -187,7 +180,6 @@ adventures: {else} {print} 'Робин идёт домой' ``` - start_code: '# разместите здесь свой код' 10: story_text: | На этом уровне вы можете использовать команду {for} в своем рассказе. Таким образом, вы можете легко запрограммировать детскую книгу "Бурый медведь, бурый медведь, что ты видишь" @@ -208,7 +200,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# разместите здесь свой код' 12: story_text: На этом уровне вы можете использовать кавычки для сохранения нескольких слов в переменной. example_code: | @@ -216,7 +207,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# разместите здесь свой код' 13: story_text: | Используя команды `{and}` и `{or}`, вы можете сократить свои истории. Например, посмотрите историю о драконе. @@ -248,7 +238,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# разместите здесь свой код' 15: story_text: | Использование цикла `{while}` может сделать ваши истории более интересными. Например, вы можете использовать `{while} game == 'on'`, чтобы можно было играть до тех пор, пока игра не закончится. @@ -271,7 +260,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# разместите здесь свой код' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -292,7 +280,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -332,13 +319,6 @@ adventures: _ {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 @@ -356,11 +336,6 @@ adventures: {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 @@ -393,10 +368,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -424,11 +395,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -540,7 +506,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# разместите здесь свой код' calculator: name: Калькулятор default_save_name: Калькулятор @@ -577,7 +542,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Добро пожаловать в этот калькулятор!''' 9: story_text: | На предыдущих уровнях вы научились создавать калькулятор, а на этом уровне вы можете расширить этот код и превратить его в небольшую математическую игру. @@ -597,7 +561,6 @@ adventures: оценка = оценка + 1 {print} 'Отличная работа! Ваша оценка... ' оценка ' из 10! ``` - start_code: '{print} ''Добро пожаловать в этот калькулятор!''' 10: story_text: | Эта игра на калькуляторе поможет вам отработать таблицу умножения! @@ -615,7 +578,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# разместите здесь свой код' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -631,7 +593,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Теперь вы можете сделать калькулятор, который работает для десятичных чисел. Заполните пробелы, чтобы он работал правильно! @@ -642,7 +603,6 @@ adventures: ответ = _ {print} число1 ' плюс ' число2 ' есть ' ответ ``` - start_code: '# разместите здесь свой код' 13: story_text: | ### Exercise 1 @@ -659,7 +619,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -684,11 +643,7 @@ adventures: 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 @@ -720,7 +675,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# разместите здесь свой код' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -769,17 +723,6 @@ adventures: 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 @@ -802,12 +745,6 @@ adventures: {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. @@ -827,14 +764,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -856,16 +785,6 @@ adventures: 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 @@ -880,13 +799,6 @@ adventures: {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 @@ -909,17 +821,7 @@ adventures: {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' @@ -946,19 +848,7 @@ adventures: 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: @@ -974,11 +864,6 @@ adventures: 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 @@ -1003,10 +888,7 @@ adventures: {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} @@ -1043,19 +925,7 @@ adventures: 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: @@ -1070,11 +940,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1114,26 +979,6 @@ adventures: 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 @@ -1162,27 +1007,6 @@ adventures: 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 @@ -1215,31 +1039,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1269,9 +1068,7 @@ adventures: 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?' @@ -1328,36 +1125,6 @@ adventures: 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 @@ -1507,7 +1274,6 @@ adventures: Попробуйте выполнить код самостоятельно с помощью зеленой кнопки "Выполнить код" под полем программирования. Вы Готовы? Тогда перейдите на следующую вкладку чтобы выучить вашу первую команду! - start_code: '{print} привет мир!' 2: story_text: | In level 2 we learn two new commands: `{is}` and `{sleep}`. @@ -1522,11 +1288,9 @@ adventures: ``` story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: '{print} hello world!' 3: story_text: | In level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`. - start_code: '{print} Здравствуй мир!' 4: story_text: | На уровне 4 `{ask}` и `{print}` изменились. @@ -1542,7 +1306,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Привет, мир''' 5: story_text: | На 5 уровне есть что-то новенькое, `{if}`! С помощью `{if}` ты можешь выбирать между двумя разными опциями. @@ -1553,9 +1316,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - start_code: |- - имя {is} {ask} 'как тебя зовут?' - {if} имя {is} Хеди {print} 'круто!' {else} {print} 'meh' 6: story_text: | На этом уровне вы узнаете кое-что новое: теперь вы также можете вычислять. @@ -1578,7 +1338,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` и `{print}` по-прежнему работают так, как вы знаете. Но `{if}`, `{else}`, `{pressed}` и `{repeat}` изменились! @@ -1602,10 +1361,6 @@ adventures: {print} 'INTRUDER!' {print} 'Вы не можете использовать этот компьютер!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {print} 'Это будет напечатано 5 раз' 9: story_text: | На этом уровне вы можете не только использовать несколько строк с `{if}` и `{repeat}`, но и соединять их вместе! @@ -1620,13 +1375,6 @@ adventures: {else} {print} 'pizza is better' ``` - start_code: |- - {repeat} 3 {times} - еда = {ask} 'Что вы хотите?' - {if} еда {is} пицца - {print} 'отлично!' - {else} - {print} 'пицца лучше' 10: story_text: |- На этом уровне мы изучаем новый код под названием `{for}`. С помощью `{for}` вы можете создать список и использовать все элементы. @@ -1645,9 +1393,6 @@ adventures: 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: |- - {for} счетчик {in} {range} 1 {to} 5 - {print} счетчик 12: story_text: |- **Десятичные числа** @@ -1657,8 +1402,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'В десятичных числах теперь нужно использовать точку' + {print} 2.5 + 2.5 13: story_text: Сейчас мы изучим `{and}` и `{or}`! Если вы хотите проверить два утверждения, вам не обязательно использовать два {if}, но можно использовать `{and}` и `{or}`. Если вы используете `{and}`, оба утверждения, слева и справа от `{and}`, должны быть истинными. Можно также использовать @@ -1670,11 +1414,6 @@ adventures: {if} имя {is} 'Хеди' {and} возраст {is} 2 {print} 'Ты настоящая Хеди!' ``` - start_code: |- - имя = {ask} 'как вас зовут?' - возраст = {ask} 'каков ваш возраст?' - {if} имя {is} 'Хеди' {and} возраст {is} 2 - {print} 'Ты настоящая Хеди!' 14: story_text: | Сейчас мы познакомимся с новыми предметами. Возможно, вы уже знаете их из математики: `<` и `>`. @@ -1689,8 +1428,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - возраст = {ask} 'Сколько тебе лет?' + {if} возраст < 13 {print} 'Ты младше меня!' {else} @@ -1709,11 +1447,6 @@ adventures: answer = {ask} 'Сколько будет 5 раз по 5?' {print} 'Был дан правильный ответ' ``` - start_code: |- - ответ = 0 - {while} ответ != 25 - ответ = {ask} 'Сколько будет 5 раз по 5?' - {print} 'Был дан правильный ответ' 16: story_text: |- Мы будем создавать списки, как в Python, с квадратными скобками вокруг списков! Мы также сохраним кавычки вокруг каждого элемента, как мы учили на предыдущих уровнях. @@ -1743,9 +1476,8 @@ adventures: {print} i {print} 'Готов или нет, но я иду!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - имя = 'Хеди' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('Меня зовут ', имя) dice: name: Кубики @@ -1773,12 +1505,10 @@ adventures: ``` выбор {is} _ ``` - start_code: '{print} Что покажет кубик на этот раз?' 4: story_text: | В этом уровне мы можем составлять предложения со значением кубика в предложении, разумеется, с кавычками. На этот раз пример кода не совсем полный. Сможете ли вы закончить код? - start_code: '{print} ''Что покажет кубик на этот раз?''' 5: story_text: | В этом уровне вы также можете сделать кубик еще раз, используя сайт `{if}`. @@ -1792,7 +1522,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear it again!' ``` - start_code: '{print} ''Что покажет кубик на этот раз?''' 6: story_text: | Здесь вы можете снова сделать кубик земляного червя, но теперь вы также можете подсчитать, сколько очков выпало. @@ -1812,7 +1541,6 @@ adventures: ``` example_code_2: | Удалось ли вам рассчитать счет для 8 кубиков? Это потребовало много вырезания и вставки, верно? В 7 уровне мы сделаем это еще проще! - start_code: '{print} ''Что покажет кубик на этот раз?''' 7: story_text: | На пятом уровне вы также можете снова сделать кубик. С помощью кода `{repeat}` вы можете легко бросить целую руку игральных костей. @@ -1824,7 +1552,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''Что покажет кубик на этот раз?''' 10: story_text: | Все слишком долго бросают кубики? В этом уровне вы можете позволить Хеди бросить все кубики сразу! @@ -1837,7 +1564,6 @@ adventures: {print} игрок ' бросает ' выбор {at} {random} {sleep} ``` - start_code: '# разместите здесь свой код' 15: story_text: | ### Exercise @@ -1862,7 +1588,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# разместите здесь свой код' dishes: name: Блюда? default_save_name: Блюда @@ -1880,7 +1605,6 @@ adventures: ``` story_text_2: | Не хочется самому мыть посуду? Взломайте программу, удалив свое имя из списка с помощью команды `{remove}` `{from}`. - start_code: '{print} Кто моет посуду?' 4: story_text: | С помощью кавычек вы можете сделать планирование мытья посуды более красивым. @@ -1896,7 +1620,6 @@ adventures: {sleep} {print} люди {at} _ ``` - start_code: '{print} ''Кто моет посуду?''' 5: story_text: | С помощью сайта `{if}` вы можете получить больше удовольствия от выбора в программе. Вы можете сделать так, чтобы ваша программа реагировала на выбор, который сделал компьютер. @@ -1904,7 +1627,6 @@ adventures: Можете ли вы дописать код так, чтобы он печатал "жаль", когда наступает ваша очередь, а в противном случае - "да!"? Не забывайте о кавычках! example_code: "```\nлюди {is} мама, папа, Эмма, Софи\nпосудомоечная_машина {is} люди {at} {random}\n{if} посудомоечная_машина {is} Софи {print} _ слишком плохо, что я должна мыть посуду _ \n{else} {print} 'к счастью, посуды нет, потому что' _ 'уже моет посуду'\n```\n" - start_code: '{print} ''Кто моет посуду?''' 6: story_text: | Как часто каждый будет мыть посуду? Справедливо ли это? Вы можете посчитать это на этом уровне. @@ -1937,7 +1659,6 @@ adventures: {remove} посудомоечная_машина {from} люди посудомоечная_машина = люди {at} {random} ``` - start_code: '{print} ''Кто моет посуду?''' 7: story_text: | На сайте `{repeat}` вы можете повторять фрагменты кода. С его помощью можно рассчитать, кто будет мыть посуду в течение всей недели. @@ -1946,7 +1667,6 @@ adventures: люди = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Кто моет посуду?''' 10: story_text: | На этом уровне вы сможете сделать еще более совершенный сарай для мытья посуды. @@ -1957,7 +1677,6 @@ adventures: _ день _ дни {print} имена {at} {random} ''моет посуду в '' день ``` - start_code: '# разместите здесь свой код' elif_command: name: '{elif}' default_save_name: elif @@ -2005,10 +1724,6 @@ adventures: {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: |- 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. @@ -2020,10 +1735,6 @@ adventures: {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: 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. @@ -2062,7 +1773,6 @@ adventures: Сейчас Хеди говорит вам только ваше имя. Можете ли вы расширить код, чтобы Хеди могла предсказывать больше вещей о вас? Очевидно, что Хеди еще не очень хорошая гадалка, так как она может только повторять ответы, которые были даны игроками! Загляните на уровень 2, чтобы улучшить свою гадалку. - start_code: '# разместите здесь свой код' 3: story_text: | В предыдущих уровнях вы создали свою первую машину для гадания, но Хеди не могла ничего предсказать, только {echo}. @@ -2079,7 +1789,6 @@ adventures: ``` story_text_2: | Сейчас Хеди может ответить только "да", "нет" или "может быть". Можете ли вы дать Хеди больше вариантов ответа, например, "определенно" или "переспросить" - start_code: '# разместите здесь свой код' 4: story_text: | Этот уровень не содержит новых функций, но позволяет потренироваться в использовании кавычек. @@ -2104,7 +1813,6 @@ adventures: {sleep} 2 {print} ответы {at} {random} ``` - start_code: '# разместите здесь свой код' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2117,7 +1825,6 @@ adventures: человек {is} {ask} 'Кто вы?' {if} человек {is} Хеди {print} 'Вы обязательно выиграете! 🤩' {else} {print} 'Не повезло! Выиграет кто-то другой! 😭' ``` - start_code: '# разместите здесь свой код' 6: story_text: | На этом уровне вы можете использовать математику в своих предсказаниях в качестве гадалки. Это позволяет вам придумывать (глупые) формулы для расчета будущего. @@ -2162,7 +1869,6 @@ adventures: ответ = да, нет, может быть {repeat} 3 {times} {print} 'Мой хрустальный шар говорит...' ответ {at} {random} ``` - start_code: '# разместите здесь свой код' 8: story_text: | В предыдущих уровнях вы узнали, как с помощью команды `{repeat}` заставить гадалку ответить на 3 вопроса подряд, но у нас возникла проблема с печатью вопросов. @@ -2181,7 +1887,6 @@ adventures: {sleep} {print} 'Мой хрустальный шар говорит...' ответы {at} {random} ``` - start_code: '# разместите здесь свой код' 10: story_text: | В этом уровне вы узнаете, как программировать игру MASH (mansion, apartement, shack, house). В этой игре вы можете предсказать всем игрокам сразу, каким будет их будущее. @@ -2197,7 +1902,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# разместите здесь свой код' 12: story_text: | В этом уровне вы можете составлять гадания из нескольких слов. Сможете ли вы добавить в список больше различных предсказаний? @@ -2209,7 +1913,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# разместите здесь свой код' functions: name: functions default_save_name: functions @@ -2249,21 +1952,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2292,13 +1980,6 @@ adventures: {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. @@ -2322,17 +2003,6 @@ adventures: 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 @@ -2361,7 +2031,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2383,7 +2052,6 @@ adventures: _ {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: Дом с привидениями default_save_name: Дом с привидениями @@ -2412,7 +2080,6 @@ adventures: ``` story_text_2: | Сможете ли вы закончить страшную историю? Или придумать свою собственную историю о доме с привидениями? - start_code: '{print} Как я сюда попал?' 2: story_text: | В этом доме с привидениями вы можете выбрать себе монстров с помощью эмодзи. Конечно, вы также можете использовать слова. @@ -2459,7 +2126,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# разместите здесь свой код' 4: story_text: | В этом уровне вы узнаете, как использовать кавычки в своих играх. @@ -2475,7 +2141,6 @@ adventures: {sleep} {print} монстры {at} {random} ``` - start_code: '# разместите здесь свой код' 5: story_text: | До этого уровня игра "Дом с привидениями" всегда просила игрока выбрать дверь, но, как вы могли заметить, ответ не обязательно должен быть правильным. @@ -2496,7 +2161,6 @@ adventures: _ _ _ _ _ {print} 'Отлично! Ты сбежал! {else} {print} 'О нет! Вас съедает...' монстры {at} {random} ``` - start_code: '# разместите здесь свой код' 9: story_text: "В этом уровне вы можете использовать вложенность, которая позволяет сделать дом с привидениями еще более интерактивным!\n\n### Упражнение\n Сейчас очень трудно выиграть в этой игре, можете ли вы сделать так, чтобы выиграть было легче?\nИзмените свой код так, чтобы в нем была\ \ только одна неправильная дверь и две правильные, а не одна правильная дверь и две неправильные? \nПодсказка: Это означает замену переменной correct_door на wrong_door, а также изменение кода `{if}` и `{else}`.\nИ, конечно, вы можете изменить историю и сделать ее своей. Измените монстров\ @@ -2522,7 +2186,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Побег из дома с привидениями!''' 11: story_text: "В этом уровне мы изменили команду `{for}`, чтобы сообщить игроку, где он находится. \n\n### Упражнение 1\nЗавершите программу, чтобы игрок знал, в какой комнате он находится.\n\n### Упражнение 2\nПревратите программу в приключение, выполнив следующие шаги:\n\n1. Составьте\ \ список вариантов действий (например: борьба или бегство).\n2. Убедитесь, что игрок может выбрать вариант с `{ask}`\n3. Ответ правильный? Тогда они могут перейти к следующему монстру. Ответили неправильно? Сообщите игроку об этом с помощью `{print}`. \n\n**(дополнительно)** Если вы\ @@ -2549,7 +2212,6 @@ adventures: {if} игрок {is} живой {print} 'Отлично! Вы выжили! ``` - start_code: '{print} ''Побег из дома с привидениями!''' 14: story_text: | ### Exercise @@ -2578,7 +2240,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2612,7 +2273,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2643,18 +2303,7 @@ adventures: {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?' @@ -2693,10 +2342,6 @@ adventures: _ _ _ 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... @@ -2713,11 +2358,6 @@ adventures: {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. @@ -2733,16 +2373,6 @@ adventures: {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 @@ -2771,11 +2401,6 @@ adventures: _ 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 @@ -2801,10 +2426,6 @@ adventures: 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: @@ -2813,8 +2434,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2846,8 +2466,7 @@ adventures: {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} @@ -2872,7 +2491,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# разместите здесь свой код' 16: story_text: | ### Exercise @@ -2893,7 +2511,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# разместите здесь свой код' maths: name: maths default_save_name: maths @@ -2933,8 +2550,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Попугай @@ -2962,11 +2578,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Я попугай Хейди - {ask} Как тебя зовут? - {echo} - {echo} 2: story_text: | Создайте своего собственного онлайн-попугая, который будет копировать вас! @@ -2983,7 +2594,6 @@ adventures: story_text_2: | ### Задача Вы можете использовать переменные, чтобы заставить попугая произносить не только ваше имя. Можете ли вы дописать эту программу? - start_code: '{print} Я попугай Хеди!' 3: story_text: | Научите своего попугая новому слову с помощью `{add}`. @@ -2998,7 +2608,6 @@ adventures: {print} 🧒 Скажи новое_слово, Хеди! {print} 🦜 слова {at} {random} ``` - start_code: '# разместите здесь свой код' 4: story_text: | На этом уровне мы должны использовать кавычки с командами `{ask}` и `{print}`. @@ -3014,7 +2623,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Напишите здесь свой код' 5: story_text: | Вознаградите своего попугая, если он произнесет правильное слово! @@ -3033,7 +2641,6 @@ adventures: _ said_word {is} new_word _ '🧒 Отличная работа, Хеди! 🍪' _ _ '🧒 Нет, Хеди! Скажи новое_слово ``` - start_code: '# разместите свой код здесь' piggybank: name: Копилка default_save_name: Копилка @@ -3054,7 +2661,6 @@ adventures: недели = экономия / пособие {print} 'Ты можешь купить _ за _ недель' ``` - start_code: '# разместите здесь свой код' 14: story_text: | ### Exercise @@ -3078,7 +2684,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3107,7 +2712,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3120,7 +2724,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3140,7 +2743,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3166,8 +2768,6 @@ adventures: ``` _ 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. @@ -3184,8 +2784,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Викторина @@ -3216,7 +2815,6 @@ adventures: {if} points_b > points_a {print} 'You belong to the B club' ``` - start_code: '# разместите здесь свой код' quotation_marks: name: '''quotation marks''' default_save_name: quotation_marks @@ -3246,10 +2844,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3284,10 +2878,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3321,9 +2911,6 @@ adventures: 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. @@ -3372,11 +2959,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3390,10 +2972,6 @@ adventures: {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! @@ -3408,13 +2986,6 @@ adventures: {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 @@ -3440,10 +3011,6 @@ adventures: 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? @@ -3461,11 +3028,6 @@ adventures: _ {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: Ресторан default_save_name: Ресторан @@ -3485,7 +3047,6 @@ adventures: story_text_2: | ### Упражнение Можете ли вы придумать больше строк, которые можно добавить в код ресторана? Например, вы можете {ask} гостям, что они хотели бы выпить, сообщить им цену или пожелать приятного аппетита? - start_code: '# разместите здесь свой код' 2: story_text: | На уровне 2 вы можете расширить свой ресторан, используя переменные. В первом уровне Хеди могла сделать заказ только один раз {echo} и запомнить только то, что было заказано последним. @@ -3510,7 +3071,6 @@ adventures: Теперь добавьте свой список еды и напитков, заказанных клиентом. **Дополнительное задание** Теперь, когда вы уже узнали как можно использовать переменные, вы способны использовать сколько угодно переменных в одной строке. Можете добавить больше переменных в свой код, вроде был ли заказ на вынос или для ресторана, оплата картой или наличными, с трубочкой для напитка или без? - start_code: '# разместите здесь свой код' 3: story_text: | Не можете решить, что хотите съесть на ужин? Вы можете позволить Хеди выбрать за вас! @@ -3542,7 +3102,6 @@ adventures: _ {print} Вы получаете молочный коктейль со вкусом {at} {random}. ``` - start_code: '# разместите здесь свой код' 4: story_text: | На этом уровне вы должны использовать кавычки при использовании команды `{print}` или `{ask}`. @@ -3561,7 +3120,6 @@ adventures: {print} Спасибо за ваш заказ. {print} Ваша еда и напитки будут доставлены прямо сейчас! ``` - start_code: '# разместите здесь свой код' 5: story_text: | На этом уровне команда `{if}` позволяет вам `{ask}` задавать вопросы клиентам и давать различные ответы на них. @@ -3582,7 +3140,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# разместите здесь свой код' 6: story_text: | В этом уровне вы можете использовать математику для подсчета общей стоимости заказа клиента, что может сделать ваш виртуальный ресторан более реалистичным. @@ -3601,7 +3158,6 @@ adventures: {print} 'Это будет стоить ' цена ' долларов, пожалуйста' {print} 'Спасибо, приятного аппетита!' ``` - start_code: '# разместите здесь свой код' 7: story_text: | На этом уровне вы узнали, как использовать команду `{repeat}` для повторения строки кода определенное количество раз. @@ -3615,7 +3171,6 @@ adventures: {repeat} _ {times} еда = {ask} 'Что бы вы хотели съесть?' {print} 'Спасибо за ваш заказ! Его сейчас принесут! ``` - start_code: '# разместите здесь свой код' 8: story_text: | На этом уровне вы можете сделать свой виртуальный ресторан более сложным, повторяя несколько строк кода. Например: @@ -3635,7 +3190,6 @@ adventures: Конечно, этот код можно расширить, добавив больше позиций в меню, предложив напитки и/или несколько блюд. **Дополнительное задание** Добавьте ещё больше вариантов - столько, сколько вам нравится! - start_code: '# разместите здесь свой код' 9: story_text: "В этом уровне вы можете использовать вложенность, чтобы сделать ваш ресторан более реалистичным и веселым!\n\n### Упражнение\nВ коде примера были удалены отступы. \nМожете ли вы определить, сколько отступов должно быть в каждой строке, чтобы код работал правильно?\nЕсли клиент\ \ заказывает пиццу, Хеди не должна спрашивать, какой соус хочет клиент.\n\n**(экстра)** В ресторане не все соусы имеются в наличии. Составьте список доступных соусов и при каждом заказе отвечайте, продаете ли вы его.
\n**(дополнительно)** У пиццы есть начинка. Спросите клиентов,\ @@ -3662,7 +3216,6 @@ adventures: {print} 'Это будет стоить ' цена ' доллар' {print} 'Приятного аппетита!' ``` - start_code: '# разместите здесь свой код' 10: story_text: | На этом уровне вы узнаете, как легко {ask} заказы ваших гостей в виде короткого кода. @@ -3708,7 +3261,6 @@ adventures: цена = 4 * человек {print} 'Это будет ' цена ' долларов, пожалуйста!' ``` - start_code: '# разместите здесь свой код' 12: story_text: | Начиная с этого уровня вы можете использовать десятичные числа, чтобы сделать ваше меню более реалистичным. @@ -3729,7 +3281,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# разместите здесь свой код' 13: story_text: | В этом уровне мы можем использовать новые команды для модернизации нашего ресторана. @@ -3744,7 +3295,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# разместите здесь свой код' 15: story_text: | С помощью `{while}` вы можете убедиться, что ваши клиенты могут продолжать добавлять заказы, пока они не будут выполнены. @@ -3760,7 +3310,6 @@ adventures: more = {ask} 'Вы хотите заказать что-нибудь еще?' {print} 'Спасибо!' ``` - start_code: '# разместите здесь свой код' rock: name: Камень, ножницы, бумага default_save_name: Камень @@ -3798,7 +3347,6 @@ adventures: {is} {ask} камень, бумага или ножницы? {print} Я выбираю _ ``` - start_code: '# разместите здесь свой код' 3: story_text: | В этом уровне мы можем вводить списки и выбирать из них предметы. @@ -3862,7 +3410,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# разместите здесь свой код' 10: story_text: | Лень играть в игру самому? Позвольте Хеди сыграть за вас! @@ -3874,7 +3421,6 @@ adventures: {for} игрок {in} игроки {print} игрок ' выбирает ' выбор {at} {random} ``` - start_code: '# разместите здесь свой код' 13: story_text: | С помощью команды `{and}` вы можете сократить свой код "Камень, ножницы, бумага"! Посмотрите приведенный ниже пример кода и попробуйте закончить его. @@ -3893,7 +3439,6 @@ adventures: {print} 'Компьютер победил!' _ ``` - start_code: '# разместите здесь свой код' 15: story_text: | ### Задача @@ -3916,7 +3461,6 @@ adventures: выиграл = 'да' _ ``` - start_code: '# разместите здесь свой код' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3933,7 +3477,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: СуперШпион default_save_name: СуперШпион @@ -3959,7 +3502,6 @@ adventures: b = 'сегодня в 10.00' {print} a + b ``` - start_code: '# разместите здесь свой код' 13: story_text: | Можете ли вы заполнить правильную команду на бланке? Разум: Супершпион должен правильно ответить на ОБА вопроса, прежде чем он получит конфиденциальную информацию! @@ -3972,7 +3514,6 @@ adventures: {else} {print} 'Отправиться на вокзал в 10.00' ``` - start_code: '# поместите свой код здесь' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3988,10 +3529,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Спойте песню! default_save_name: Песня @@ -4029,7 +3566,6 @@ adventures: print 'Больше никаких обезьян, прыгающих на кровати!' sleep ``` - start_code: '{print} ''Давай петь!''' 7: story_text: | Песни часто содержат много повторений. Например... Детеныш акулы! Если вы поете ее, вы продолжаете петь одно и то же: @@ -4047,7 +3583,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Малыш акула''' 8: story_text: | В предыдущем уровне вы запрограммировали песню "Бутылки пива". Вы сочинили один куплет, а затем должны были скопировать его 99 раз. В этом уровне вы можете повторить песню 99 раз, просто добавив одну простую строчку! @@ -4062,7 +3597,6 @@ adventures: стих = стих - 1 {print} стих ' бутылки пива на стене' ``` - start_code: '# разместите здесь свой код' 10: story_text: | На этом уровне вы легко сможете исполнить детскую песенку "Пять маленьких обезьянок". Сможете ли вы сделать последний припев? @@ -4122,7 +3656,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# разместите здесь свой код' 11: story_text: | На этом уровне вы можете использовать команду `{for} i {in} {range}`{in} {range}` для создания песен, в которых используется счет, например, 5 маленьких обезьянок. @@ -4139,7 +3672,6 @@ adventures: {else} {print} "БОЛЬШЕ НИКАКИХ ОБЕЗЬЯНОК, ПРЫГАЮЩИХ НА КРОВАТИ! ``` - start_code: '# разместите здесь свой код' 12: story_text: | В этой песне мы можем еще проще запрограммировать "если ты счастлив и знаешь это, хлопай в ладоши". Поскольку мы можем поместить все действия в переменную, проверьте это: @@ -4157,7 +3689,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} действие ``` - start_code: '# разместите здесь свой код' 13: 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? @@ -4174,16 +3705,6 @@ adventures: {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: | На этом уровне вы сможете еще быстрее запрограммировать песню типа OldMacDonald. Вы можете соединить нужное животное с нужным звуком, просто поместив их в одно и то же место в списке. @@ -4216,7 +3737,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# разместите здесь свой код' 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. @@ -4238,7 +3758,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4260,15 +3779,6 @@ adventures: {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: Крестики-нолики default_save_name: Тик @@ -4336,7 +3846,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# Напишите свой код здесь' 14: story_text: | В предыдущих уровнях вы создали игру "Крестики-нолики". Теперь вы научились использовать знаки =, == и !=. @@ -4399,7 +3908,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# разместите здесь свой код' 15: story_text: | В этом уровне вы можете улучшить свою игру в Крестики-нолики с помощью цикла {while}. С помощью этого цикла вы можете объединить `{if} game != 'over'` и `{for} i {in} {range} 1 {to} 9` в одну простую линию. @@ -4461,7 +3969,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# разместите здесь свой код' 17: story_text: | В предыдущих уровнях игра "Крестики-нолики" имела раздражающую особенность. После каждого хода вы должны были сами заполнить, выиграли вы или нет. @@ -4548,7 +4055,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# разместите здесь свой код' turtle: name: Черепаха default_save_name: Черепаха @@ -4572,9 +4078,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | В этом уровне вы можете использовать переменные, чтобы сделать черепаху интерактивной. Например, вы можете спросить игрока, сколько шагов должна сделать черепаха. @@ -4600,11 +4103,6 @@ adventures: {turn} угол {forward} 25 ``` - start_code: |- - {print} Черепашьи бега! - угол {is} 90 - {turn} угол - {forward} 25 3: story_text: | В этом уровне вы можете использовать `{at} {random}`{random}` с рисующей черепахой. Случайный выбор заставляет черепаху каждый раз идти по разному пути. @@ -4616,10 +4114,6 @@ adventures: {turn} angles {at} {random} {forward} 25 ``` - start_code: |- - углы {is} 10, 50, 90, 150, 250 - {turn} углы {at} {random} - {forward} 25 4: story_text: | В четвертом уровне вы должны использовать кавычки с `{print}` и `{ask}`. Также при рисовании! @@ -4646,11 +4140,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Рисование фигур' - угол {is} 90 - {turn} угол - {forward} 25 5: story_text: | На уровне 5 вы можете сделать выбор с помощью `{if}`. Например, между разными типами фигур. @@ -4683,12 +4172,6 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: |- - {print} 'Рисуем фигуры' - рисунок {is} {ask} 'Вам нужен квадрат или треугольник?' - {if} рисунок {is} угол треугольника {is} 120 {else} угол {is} 90 - {turn} угол - {forward} 25 6: story_text: | На этом уровне вы можете использовать вычисления для рисования различных фигур. @@ -4712,7 +4195,6 @@ adventures: {forward} 50 {turn} angle ``` - start_code: '{print} ''Рисование фигур''' 8: story_text: | Теперь, когда мы можем повторять несколько линий, нам легче строить фигуры. @@ -4755,7 +4237,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4773,7 +4254,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4798,16 +4278,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4823,7 +4293,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4834,7 +4303,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4845,7 +4313,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4863,7 +4330,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4882,7 +4348,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4902,7 +4367,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4913,7 +4377,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4926,7 +4389,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4957,7 +4419,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4998,7 +4459,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5021,7 +4481,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5050,7 +4509,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5074,7 +4532,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5102,7 +4559,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5136,7 +4592,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5156,11 +4611,6 @@ adventures: 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: Новый год default_save_name: Новогодний отсчет @@ -5178,4 +4628,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# разместите здесь свой код' diff --git a/content/adventures/sq.yaml b/content/adventures/sq.yaml index af27e4d76ad..73f64bd2243 100644 --- a/content/adventures/sq.yaml +++ b/content/adventures/sq.yaml @@ -22,7 +22,6 @@ adventures: ``` story_text_2: | A mund ta bëni historinë tuaj në Hedy tani duke përdorur `{print}`, `{ask}` dhe `{echo}`? - start_code: '{print} Tregimi yt fillon këtu' 2: story_text: | Në nivelin e 2, ju mund ta bëni tregimin më jetë më argëtues. Emri i personazhit tuaj kryesor mund të jetë kudo në fjali. @@ -51,7 +50,6 @@ adventures: 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} Tregimi yt' 3: story_text: | Në nivelin e 3-të, ju mund ta bëni tregimin më argëtues. Tani mund të përdorni rastësinë për çfarëdo bishe, kafshe ose pengesë tjetër, si kështu: @@ -83,7 +81,6 @@ adventures: hiqeni {is} {ask} Cilin artikull doni ta hiqni? {remove} hiqeni {from} çanta ``` - start_code: '{print} Tregimi juaj' 4: story_text: | Mund ta keni vërejtur se ka një problem në nivelet e mëparshëm. A provuat të printoni një fjali që ka fjalën emri në të? P.sh `{print}` emri im është emri. @@ -98,7 +95,6 @@ adventures: {print} _ Ai dëgjon një zë të _ kafshët {at} {random} {print} emri _ është i frikësuar sepse ky është një pyll me fantazma _ ``` - start_code: '{print} ''Tregimi juaj to dë printohet këtu!''' 5: story_text: | Në këtë nivel mund të programoni përfundime të ndryshme, që do ta bëje tregimin tuaj më argëtues. @@ -122,7 +118,6 @@ adventures: {if} përfundimi {is} lumtur {print} emri ' merë shpatën dhe bisha ikën menjëherë' {else} {print} 'Bisha hanë ' emri ``` - start_code: '{print} ''Tregimi juaj do të fillojë këtu!''' 7: story_text: | Në tregim, dikush përmend një fjalë disa herë. Si për shembull, kur dikush thirrën për ndihmë apo këndon një këngë. @@ -136,7 +131,6 @@ adventures: {repeat} 5 {times} {print} 'Ndihmë!' {print} 'Pse askush nuk më ndihmon?' ``` - start_code: '{repeat} 5 {times} {print} ''Ndihmë!''' 8: story_text: | Në këtë nivel mund të përdorni shumë rreshta në komandat {if}, në këtë mënyrë mund ti përmirësoni përfundimet e lumtura ose të këqija! @@ -157,7 +151,6 @@ adventures: {print} 'Por Rinori është shumë i ngadaltë...' {print} 'T-Rex afrohet dhe e hanë me një të gëlltitur!🦖' ``` - start_code: '# Vendoseni kodin tuaj këtu' 9: story_text: | Në këtë nivel mund të përdorni komandat një mbi një `{if}`, `{repeat}` ose `{for}` komandat brenda komandave tjera si `{if}`, `{repeat}` ose `{for}`. Kjo ju lejon shumë opsione dhe u ndihmon ta bëni tregimin tuaj më interaktive. @@ -176,7 +169,6 @@ adventures: {else} {print} 'Rina shkon në shtëpi' ``` - start_code: '# Vendoseni kodin tuaj këtu' 10: story_text: | Në këtë nivel ju mund të përdorni komandën {for} në tregimin tuaj. Në këtë mënyrë lehtësisht mund ta programoni librin e fëmijëve 'ariu i murrmë, ariu i murrmë, çfarë po sheh?'. @@ -193,7 +185,6 @@ adventures: {print} 'Çfarë po sheh?' {print} 'Un i shoh të gjitha kafshët që më shikojnë!' ``` - start_code: '# Vendoseni kodin tuaj këtu' 12: story_text: Në këtë nivel ju mund të përdorni thonjëza për të ruajtur disa fjalë në një variabël. example_code: | @@ -201,7 +192,6 @@ adventures: emri = 'Mbretëresha e Anglisë' {print} emri ' ishte duke ngrënë një copë torte, duke papritur...' ``` - start_code: '# Vendoseni kodin tuaj këtu' 13: story_text: | Duke përdorur komandën `{and}` dhe `{or}`, ju mund ta shkurtoni tregimin tuaj. Si për shembull, shikoni tregimin e dragonit. @@ -234,7 +224,6 @@ adventures: {print} 'Kjo mund të jetë e dobishme' shpata = 'gjetur' ``` - start_code: '# Vendoseni kodin tuaj këtu' 15: story_text: | Duke përdorur komandën `{while}` mund ta bëni tregimin më interesante. Për shembull, ju mund të përdorni `{while} game == 'on'` kështu që ju mund të luani derisa loja të mbarojë. @@ -257,7 +246,6 @@ adventures: {print} 'Jo, nuk janë në' vendi {print} 'Tani mund të hyni në shtëpi!' ``` - start_code: '# Vendoseni kodin tuaj këtu' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -278,7 +266,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -318,13 +305,6 @@ adventures: _ {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 @@ -342,11 +322,6 @@ adventures: {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 @@ -379,10 +354,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -410,11 +381,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -526,7 +492,6 @@ adventures: {elif} pikë > pikët_e_tregtarit {and} pikë < 21: {print} 'Ti fiton!' ``` - start_code: '# Vendoseni kodin tuaj këtu' calculator: name: Kalkulatori default_save_name: Kalkulatori @@ -562,7 +527,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Mirë se erdhët në këtë kalkulator!''' 9: story_text: | Në nivelet e mëparshme ju keni mësuar se si të bëni një kalkulator, në këtë nivel mund ta zgjeroni atë kod dhe ta shndërroni atë në një lojë të vogël matematikore. @@ -583,7 +547,6 @@ adventures:         pikë = pikë + 1 {print} 'Punë mirë! Pikët tuaja janë... ' pikë ' nga 10!' ``` - start_code: '{print} ''Mirë se erdhët në këtë kalkulator!''' 10: story_text: | Kjo lojë llogaritëse ju ndihmon të praktikoni tabelat tuaja të shumëzimit! @@ -601,7 +564,6 @@ adventures: {else} {print} 'Ajo është gabim. Përgjigja e saktë është ' saktë ``` - start_code: '# Vendoseni kodin tuaj këtu' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -617,7 +579,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Tani mund të bëni një kalkulator që punon me numra decimal. Plotësoni vendet bosh që të funksionojë siç duhet! @@ -628,7 +589,6 @@ adventures: përgjigja = _ {print} numri1 ' plus ' numri2 ' është ' përgjigja ``` - start_code: '# Vendoseni kodin tuaj këtu' 13: story_text: | ### Exercise 1 @@ -645,7 +605,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -670,11 +629,7 @@ adventures: 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 @@ -706,7 +661,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# Vendoseni kodin tuaj këtu' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -755,17 +709,6 @@ adventures: 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 @@ -788,12 +731,6 @@ adventures: {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. @@ -813,14 +750,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -842,16 +771,6 @@ adventures: 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 @@ -866,13 +785,6 @@ adventures: {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 @@ -895,17 +807,7 @@ adventures: {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' @@ -932,19 +834,7 @@ adventures: 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: @@ -960,11 +850,6 @@ adventures: 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 @@ -989,10 +874,7 @@ adventures: {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} @@ -1029,19 +911,7 @@ adventures: 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: @@ -1056,11 +926,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1100,26 +965,6 @@ adventures: 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 @@ -1148,27 +993,6 @@ adventures: 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 @@ -1201,31 +1025,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1255,9 +1054,7 @@ adventures: 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?' @@ -1314,36 +1111,6 @@ adventures: 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 @@ -1489,7 +1256,6 @@ adventures: 1: story_text: "Në level 1 mund ti përdorni komandat `{print}`, `{ask}` dhe `{echo}`.\n Shkruani kodin në fushën e programimit. Ose shtypeni butonin e gjelbër në bllokun që tregon shembull, dhe kodi do të shkruhet për ju!\nProvojeni kodin tuaj duke shtypur butonin 'Ekzekuto kodin' ndër fushën\ \ e programimit.\n\n Mund të printoni tekst në ekran duke përdorur komandën `{print}`. \n" - start_code: '{print} përshëndetje botë!' 2: story_text: | Në level 2 do të mësojmë komandat: `{is}` dhe `{sleep}`. @@ -1504,11 +1270,9 @@ adventures: ``` story_text_2: | `{print}` punon ende njëlloj, por `{ask}` komanda ka ndryshuar. Ju duhet ta përdorni një variabël në komandën `{ask}` gjithashtu. Duket si kjo: - start_code: '{print} përshëndetje botë!' 3: story_text: | Në level 3 ju mund të bëni një listë. Ju mund ta lejoni kompjuterin të zgjedhë një rastësisht. Ju mund ta bëni këtë me `{at} {random}`. - start_code: '{print} përshëndetje botë!' 4: story_text: | Në nivelin 4 `{ask}` dhe `{print}` komandat kanë ndryshuar. @@ -1524,7 +1288,6 @@ adventures: përgjigja {is} {ask} 'Çfarë duhet të përdorim prej tani e tutje?' {print} 'Ne duhet të përdorim ' përgjigja ``` - start_code: '{print} ''Përshëndetje botë''' 5: story_text: | Në nivel 5 kemi diçka të re, `{if}` komanda! Me `{if}` komandën ju mund të zgjidhni një nga dy opsione . @@ -1535,9 +1298,6 @@ adventures: emri {is} {ask} 'si e keni emrin?' {if} emri {is} Hedy {print} 'mirë' {else} {print} 'boo!' ``` - start_code: |- - emri {is} {ask} 'si e ke emrin?' - {if} emri {is} Hedy {print} 'mirë!' {else} {print} 'meh' 6: story_text: | Në këtë nivel ju do të mësoni diçka të re: ju tash mund të kalkuloni. @@ -1560,7 +1320,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy është qejf!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy është qejf!''' 8: story_text: | `{ask}` dhe `{print}` punojnë siç i mbani mend. Por `{if}`, `{else}` dhe `{repeat}` kanë ndryshuar! @@ -1584,10 +1343,6 @@ adventures: {print} 'HAJDUT!' {print} 'Nuk mund ta përdorni këtë kompjuter!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Përshëndetje njerëz' - {print} 'Kjo do të printohet 5 herë' 9: story_text: | Në këtë nivel jo veçse mund të përdorni shumë rreshta me komandat `{if}` dhe `{repeat}`, por mund ti vendoseni së bashku! @@ -1602,13 +1357,6 @@ adventures: {else} {print} 'pica është më mirë' ``` - start_code: |- - {repeat} 3 {times} - ushqimi = {ask} 'Çfarë doni?' - {if} ushqimi {is} pica - {print} 'bukur!' - {else} - {print} 'pica është më mirë' 10: story_text: |- Në këtë nivel do mësojmë për komandë të re që quhet `{for}`. Me komandën`{for}` mund të bëni një listë dhe ti përdoreni të gjitha elementet. @@ -1619,17 +1367,10 @@ adventures: {for} kafsha {in} kafshët {print} 'Un e dua ' kafsha ``` - start_code: |- - kafshët {is} qeni, maca, peshku - {for} kafsha {in} kafshët - {print} 'Un e dua' kafsha 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: |- - {for} numëruesi {in} {range} 1 {to} 5 - {print} numëruesi 12: story_text: |- **Numrat decimal** @@ -1639,8 +1380,7 @@ adventures: {print} 'Dy e gjysmë plus dy e gjysme është...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'numrat decimal duhet të kenë pika' + {print} 2.5 + 2.5 13: story_text: Ne tash do të mësojmë për komandën `{and}` dhe `{or}`! Nëse doni të kontrolloni dy deklarata, nuk ka nevojë për dy komanda {if} por mund të përdorni `{and}` dhe `{or}`. Nëse përdorni `{and}`, të dyja deklaratat, majtë edhe djathtë `{and}` duhet të jenë të vërteta. Ne gjithashtu @@ -1652,11 +1392,6 @@ adventures: {if} emri {is} 'Hedy' {and} mosha {is} 2 {print} 'Ju jeni Hedy i vërtetë!' ``` - start_code: |- - emri = {ask} 'Si e ke emrin?' - mosha = {ask} 'Sa vjeçar jeni?' - {if} emri {is} 'Hedy' {and} mosha {is} 2 - {print} 'Ju jeni Hedy i vërtetë!' 14: story_text: | Ne do të mësojmë më shumë gjëra. Ju veçse mund ti dini nga matematika, `<` edhe `>`. @@ -1671,8 +1406,7 @@ adventures: {if} mosha > 12 {print} 'Ju jeni më të vjetër se unë!' ``` - start_code: |- - mosha= {ask} 'Sa vjeçar jeni?' + {if} mosha< 13 {print} 'Ju jeni më të ri se unë!' {else} @@ -1691,11 +1425,6 @@ adventures: rezultati = {ask} 'Sa bëjnë 5 herë 5?' {print} 'Është dhënë përgjigje e saktë' ``` - start_code: |- - rezultati = 0 - {while} rezultati != 25 - rezultati = {ask} 'Sa bëjnë 5 herë 5?' - {print} 'Është dhënë përgjigje e saktë' 16: story_text: |- Ne do ta bëjmë një listë si në Python, me kllapa katrore para dhe pas listës! Ne gjithashtu i mbajmë thonjëzat në secilin artikull siç e kemi mësuar në nivelet e mëparshme. @@ -1722,9 +1451,8 @@ adventures: {print} i {print} 'Gati apo jo, ja ku vi!' 18: - story_text: Ne mbërritëm në kodin e vërtetë të gjuhës Python! Kjo do të thotë se duhet të përdorim kllapa në komandën {print} dhe {range} prej tani. - start_code: |- - emri = 'Hedy' + story_text: |- + Ne mbërritëm në kodin e vërtetë të gjuhës Python! Kjo do të thotë se duhet të përdorim kllapa në komandën {print} dhe {range} prej tani. {print}('Emri im është ', emri) dice: name: Zare @@ -1751,12 +1479,10 @@ adventures: ``` zgjedhjet {is} _ ``` - start_code: '{print} Çfarë do të tregojë zari këtë herë?' 4: story_text: | Në këtë nivel ne mund ta bëjmë që fjalia të ketë vlerën e zarit, me thonjëza sigurisht. Këtë herë shembulli i dhënë nuk është i plotësuar. A mund ta përfundoni kodin? - start_code: '{print} ''Çfarë do të tregojë zari këtë herë''' 5: story_text: | Mund ta bëni prapë zarin në këtë nivel me komandën `{if}`. @@ -1770,7 +1496,6 @@ adventures: {print} 'ti ke hedhur' _ {if} _ {is} krimb_toke {print} 'Mund të ndaloni së hedhuri.' _ {print} 'Duhet ta hidhni përsëri!' ``` - start_code: '{print} ''Çfarë do të tregojë zari këtë herë''' 6: story_text: | Mund përsëri të bëni zarin e krimbit të tokës, por tani gjithashtu mund ta kalkuloni sa pikë keni hedhur. @@ -1790,7 +1515,6 @@ adventures: ``` example_code_2: | A mundët që të kalkuloni pikët për 8 zare? U desh të kopjoni shumë apo? Ne do ta bëjmë më të lehtë në nivelin 7! - start_code: '{print} ''Çfarë do të tregojë zari këtë herë''' 7: story_text: | Ju mund përsëri ta bëni një zare në nivelin 5. Me komandën `{repeat}` ju mund lehtë të hidhni një dorë me zare. @@ -1802,7 +1526,6 @@ adventures: zgjedhjet = 1, 2, 3, 4, 5, krimi_tokes {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''Çfarë do të tregojë zari këtë herë''' 10: story_text: | A është secilit duke i marrë shumë kohë hedhja e zareve? Në këtë nivel ju mund ta bëni që Hedy ti hedhë të gjitha zaret në të njëjtën kohë! @@ -1815,7 +1538,6 @@ adventures:     {print} lojtari ' ka hedhur' zgjedhjet {at} {random}     {sleep} ``` - start_code: '# Vendoseni kodin tuaj këtu' 15: story_text: | ### Exercise @@ -1840,7 +1562,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# Vendoseni kodin tuaj këtu' dishes: name: Enët? default_save_name: Enët @@ -1858,7 +1579,6 @@ adventures: ``` story_text_2: | A nuk doni që ti lani enët? Ndryshoni programin që të hiqni emrin tuaj nga lista me komandën `{remove}` `{from}`. - start_code: '{print} Kush i lanë enët?' 4: story_text: | Me thonjëza mund ta bëni planin e larjeve të enëve më të bukur. @@ -1874,7 +1594,6 @@ adventures: {sleep} {print} njerëzit {at} _ ``` - start_code: '{print} ''Kush i lanë enët?''' 5: story_text: | Me komandën `{if}` ju tani mund të argëtoheni më shumë me zgjedhje në program. Ju tani mund ta keni programim që i përgjigjet zgjedhjes së bërë nga kompjuteri. @@ -1882,7 +1601,6 @@ adventures: A mund ta përfundoni kodin i cili printon 'shumë keq' kur është radha e juaj ndërsa në të kundërt 'po!'? Mos harroni thonjëzat! example_code: "```\nnjerëzit {is} nëna, babi, Erza, Sara\nlarësiEnëve {is} njerëzit {at} {random}\n{if} larësiEnëve {is} Sara {print} _ shumë keq un e kam ti lajë enët _ \n{else} {print} 'fatmirësisht nuk ka enë sepse ' _ ' është veçse duke i larë'\n```\n" - start_code: '{print} ''Kush i lanë enët?''' 6: story_text: | Sa shpesh duhet që secili ti lajë enët? A është e drejtë? Mund të numëroni në këtë nivel. @@ -1915,7 +1633,6 @@ adventures: {remove} larësi_enëve {from} njerëzit larësi_enëve = njerëzit {at} {random} ``` - start_code: '{print} ''Kush i lanë enët?''' 7: story_text: | Me komandën `{repeat}` mund të përsëritni pjesë nga kodi. Mund ta përdorni që të kalkuloni kush do ti lajë enët për të gjithë javën. @@ -1924,7 +1641,6 @@ adventures: njerëzit = nëna, babi, Erza, Sara {repeat} _ _ {print} 'larësi i enëve është' _ ``` - start_code: '{print} ''Kush i lanë enët?''' 10: story_text: | Në këtë nivel, ju mund të bëni një orar më të mirë të larjes së enëve. @@ -1935,7 +1651,6 @@ adventures: _ dita _ ditët     {print} emrat {at} {random} ' i lanë enët në ditën e ' dita ``` - start_code: '# Vendoseni kodin tuaj këtu' elif_command: name: '{elif}' default_save_name: elif @@ -1983,10 +1698,6 @@ adventures: {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: |- 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. @@ -1998,10 +1709,6 @@ adventures: {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: 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. @@ -2040,7 +1747,6 @@ adventures: Hedy tani ju tregon vetëm emrin tuaj. A mund ta zgjeroni kodin në mënyrë që Hedy të mund të parashikojë më shumë gjëra për ju? Natyrisht, Hedy nuk është ende një fallxhore shumë e mirë, pasi ajo mund të përsërisë vetëm përgjigjet që janë dhënë nga lojtarët! Hidhni një sy në nivelin 2 për të përmirësuar parashikuesin tuaj të fatit. - start_code: '# Vendoseni kodin tuaj këtu' 3: story_text: | Në nivelet e mëparshme ju keni krijuar makinën tuaj të parë të tregimit të fatit, por Hedy nuk mund të parashikonte asgjë, vetëm {echo}. @@ -2058,7 +1764,6 @@ adventures: ``` story_text_2: | Tani, Hedy mund të përgjigjet vetëm po, jo ose ndoshta. A mund t'i jepni Hedy-t më shumë opsione përgjigjeje, si 'definitivisht' ose '{ask}(pyet) përsëri'. - start_code: '# Vendoseni kodin tuaj këtu' 4: story_text: | Ky nivel nuk ka funksione të reja, por ju lejon të praktikoni përdorimin e thonjëzave. @@ -2083,7 +1788,6 @@ adventures: {sleep} 2 {print} përgjigja {at} {random} ``` - start_code: '# Vendoseni kodin tuaj këtu' 5: story_text: | Në këtë nivel do të mësoni të (fshehurazi) t'i ktheni shanset në favorin tuaj, kur përdorni fallxhoren! @@ -2096,7 +1800,6 @@ adventures: person {is} {ask} 'Kush jeni ju?' {if} person {is} Hedy {print} 'Ju sigurisht do të fitoni!🤩' {else} {print} 'Fat i keq! Dikush tjetër do të fitojë!😭' ``` - start_code: '# Vendoseni kodin tuaj këtu' 6: story_text: | Në këtë nivel ju mund të përdorni matematikën në parashikimet tuaja si një fallxhor. Kjo ju lejon të krijoni formula (të pamenda) për të llogaritur të ardhmen. @@ -2131,7 +1834,6 @@ adventures: rezultati = rezultati * futboll {print} 'Ju jeni ' rezultati ' përqind të zgjuar.' ``` - start_code: '# Vendoseni kodin tuaj këtu' 7: story_text: | Në këtë nivel mund të përdorni komandën `{repeat}`(përsërit) për ta bërë kompjuterin tuaj të tregojë fate të shumta në të njëjtën kohë. @@ -2143,7 +1845,6 @@ adventures: përgjigja = po, jo, ndoshta {repeat} 3 {times} {print} 'Topi im i kristaltë thotë... ' përgjigja {at} {random} ``` - start_code: '# Vendoseni kodin tuaj këtu' 8: story_text: | Në nivelet e mëparshme keni mësuar se si të përdorni `{repeat}` për ta bërë fallxhoren t'u përgjigjet 3 pyetjeve me radhë, por ne patëm një problem me printimin e pyetjeve. @@ -2163,7 +1864,6 @@ adventures:    {sleep}    {print} 'Topi im i kristaltë thotë...' përgjigja {at} {random} ``` - start_code: '# Vendoseni kodin tuaj këtu' 10: story_text: | Në këtë nivel do të mësoni se si të programoni lojën MASH (rezidencë, apartament, kasolle, shtëpi). Në këtë lojë ju mund të parashikoni për të gjithë lojtarët menjëherë se si do të duket e ardhmja e tyre. @@ -2179,7 +1879,6 @@ adventures: {print} emri ' do të ketë ' kafshë_shtëpiake {at} {random} ' si kafshën e tyre shtëpiake.' {sleep} ``` - start_code: '# Vendoseni kodin tuaj këtu' 12: story_text: | Në këtë nivel ju mund të bëni fatin tuaj me fjalë të shumta. Mund të shtoni më shumë pasuri të ndryshme në listë? @@ -2191,7 +1890,6 @@ adventures: {sleep} {print} fati {at} {random} ``` - start_code: '# Vendoseni kodin tuaj këtu' functions: name: functions default_save_name: functions @@ -2231,21 +1929,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2274,13 +1957,6 @@ adventures: {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. @@ -2304,17 +1980,6 @@ adventures: 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 @@ -2343,7 +2008,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2365,7 +2029,6 @@ adventures: _ {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: Shtëpia e përhumbur default_save_name: Shtëpia e përhumbur @@ -2394,7 +2057,6 @@ adventures: ``` story_text_2: | Mund ta përfundoni historinë e frikshme? Apo krijoni historinë tuaj të shtëpisë së përhumbur? - start_code: '{print} Si arrita këtu?' 2: story_text: | Në këtë shtëpi të përhumbur ju mund të zgjidhni përbindëshat tuaja me emoji. Sigurisht që mund të përdorësh edhe fjalë. @@ -2440,7 +2102,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# Vendoseni kodin tuaj këtu' 4: story_text: | Në këtë nivel ju mësoni se si të përdorni thonjëza në lojërat tuaja. @@ -2456,7 +2117,6 @@ adventures: {sleep} {print} përbindëshit {at} {random} ``` - start_code: '# Vendoseni kodin tuaj këtu' 5: story_text: | Deri në këtë nivel, loja e shtëpisë së përhumbur gjithmonë i kërkonte lojtarit të zgjidhte një derë, por siç mund ta keni vënë re, ata nuk duhej të përgjigjeshin saktë. @@ -2478,7 +2138,6 @@ adventures: _ _ _ _ {print} 'Shkëlqyeshëm! Ju keni shpëtuar!' {else} {print} 'Oh jo! Ju jeni duke u ngrënë nga një...' përbindëshit {at} {random} ``` - start_code: '# Vendoseni kodin tuaj këtu' 9: story_text: | Në këtë nivel mund të përdorni folenë, e cila ju lejon ta bëni shtëpinë e përhumbur edhe më ndërvepruese! @@ -2507,7 +2166,6 @@ adventures: {if} lojtari {is} gjallë {print} 'Shkëlqyeshëm! Ju mbijetuat!' ``` - start_code: '{print} ''Ik nga shtëpia e përhumbur!''' 11: story_text: | Në këtë nivel ne kemi ndryshuar komandën e përsëritjes dhe kemi shtuar një linjë në shtëpinë tonë të përhumbur që i tregon lojtarit në cilën dhomë janë. @@ -2536,7 +2194,6 @@ adventures: {if} lojtari {is} gjallë     {print} 'Shkëlqyeshëm! Ju mbijetuat!' ``` - start_code: '{print} ''Ik nga shtëpia e përhumbur!''' 14: story_text: | ### Exercise @@ -2565,7 +2222,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2599,7 +2255,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2630,18 +2285,7 @@ adventures: {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?' @@ -2680,10 +2324,6 @@ adventures: _ _ _ 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... @@ -2700,11 +2340,6 @@ adventures: {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. @@ -2720,16 +2355,6 @@ adventures: {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 @@ -2758,11 +2383,6 @@ adventures: _ 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 @@ -2788,10 +2408,6 @@ adventures: 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: @@ -2800,8 +2416,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2833,8 +2448,7 @@ adventures: {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} @@ -2860,7 +2474,6 @@ adventures: {if} bretkocë {is} grenouille {print} 'Super!' {else} {print} 'Jo, bretkosa është grenuille' ``` - start_code: '# Vendoseni kodin tuaj këtu' 16: story_text: | ### Exercise @@ -2881,7 +2494,6 @@ adventures: {print} 'E gabuar, 'fjalë_franceze[i]' do të thotë 'përkthimi[i] {print} 'Ju dhatë ' rezultati ' përgjigje të sakta.' ``` - start_code: '# Vendoseni kodin tuaj këtu' maths: name: maths default_save_name: maths @@ -2921,8 +2533,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Papagalli @@ -2947,7 +2558,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Jam Hedy papagalli' 2: story_text: | Krijo papagallin tuaj online që do të ju kopjojë! @@ -2963,7 +2573,6 @@ adventures: ``` story_text_2: | Ju mund të përdorni variabla për ta bërë papagallin të thotë më shumë se vetëm emrin tuaj. A mund ta plotësoni këtë kod? - start_code: '{print} Jam Hedy papagalli!' 3: story_text: | Mëso papagallin tënd fjalë të re me komandën `{add}`. @@ -2978,7 +2587,6 @@ adventures: {print} 🧒 Thuaj fjala_re, Hedy! {print} 🦜 fjalët {at} {random} ``` - start_code: '# Vendoseni kodin tuaj këtu' 4: story_text: | In this level we have to use quotation marks with the commands `{ask}` and `{print}`. @@ -2992,7 +2600,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Shpërbleni papagallin tuaj nëse thot një fjalë të saktë! @@ -3009,7 +2616,6 @@ adventures: _ fjala_thënë {is} fjala_re _'🧒 Punë e mrekullueshme, Hedy! 🍪' _ _ '🧒 Jo, Hedy! Thuaj ' fjala_re ``` - start_code: '# Vendoseni kodin tuaj këtu' piggybank: name: Kutia kursimit default_save_name: Kutia kursimit @@ -3028,7 +2634,6 @@ adventures: javë = për_të_ruajtur / kompensim {print} 'Mund të blesh një ' _' në ' _ ' javë.' ``` - start_code: '# Vendoseni kodin tuaj këtu' 14: story_text: | ### Exercise @@ -3052,7 +2657,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3081,7 +2685,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3094,7 +2697,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3114,7 +2716,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3140,8 +2741,6 @@ adventures: ``` _ 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. @@ -3158,8 +2757,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Drejtues konkursi @@ -3190,7 +2788,6 @@ adventures: {if} pikë_b > pikë_a {print} 'Ti i përket klubit B' ``` - start_code: '# Vendoseni kodin tuaj këtu' quotation_marks: name: '''quotation marks''' default_save_name: quotation_marks @@ -3220,10 +2817,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3258,10 +2851,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3295,9 +2884,6 @@ adventures: 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. @@ -3346,11 +2932,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3364,10 +2945,6 @@ adventures: {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! @@ -3382,13 +2959,6 @@ adventures: {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 @@ -3414,10 +2984,6 @@ adventures: 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? @@ -3435,11 +3001,6 @@ adventures: _ {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: Restorant default_save_name: Restorant @@ -3458,7 +3019,6 @@ adventures: ``` story_text_2: | A mendoni rreshta tjerë që mund të shtoni në kodin e restorantit? Si për shembull, a mund ta {ask}(pyesni) klientit se çfarë do të pijë, tregojuni çmimin, ose uroj atyre një vakt të këndshëm? - start_code: '# Vendoseni kodin tuaj këtu' 2: story_text: | Në nivelin 2 mund ta zmadhoni kodin e restorantin duke përdorur variabla. Në nivelin 1 Hedy vetëm mund të përdorte komandën {echo} dhe të shfaq porosinë një herë dhe vetëm e mban mend porosinë e fundit. @@ -3474,7 +3034,6 @@ adventures: ``` story_text_2: | A mund ta bëni këtë kod më të përpunuar? Për shembull duke shtuar pije në porosi? Apo...? - start_code: '# Vendoseni kodin tuaj këtu' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3506,7 +3065,6 @@ adventures: _ {print} Ju keni shijet {at} {random} koktej me qumësht ``` - start_code: '# Vendoseni kodin tuaj këtu' 4: story_text: | Në këtë nivel duhet të përdorni thonjëza me komandën `{print}` pse `{ask}`. @@ -3526,7 +3084,6 @@ adventures: {print} Faleminderit per porosinë. {print} ushqimi  juaj dhe  pije  do të jenë këtu!' ``` - start_code: '# Vendoseni kodin tuaj këtu' 5: story_text: | Në këtë nivel komanda `{if}` ju lejon që të `{ask}`(pyesni) klientët tuaj dhe të trajtoni përgjigje të ndryshme. @@ -3547,7 +3104,6 @@ adventures: {if} çfarëdo {is} jo {print} 'Kjo ishte!' {else} {print} 'Një ' çfarëdo {print} 'Faleminderit për porosinë tuaj dhe shijoni ushqimin tuaj!' ``` - start_code: '# Vendoseni kodin tuaj këtu' 6: story_text: | Në këtë nivel mund të përdorni matematikën për të kalkuluar çmimin total të klientit tuaj, e cila do ta bëjë restorantin tuaj më reale. @@ -3566,7 +3122,6 @@ adventures: {print} 'Kjo do të kushtojë ' çmimi ' lekë.' {print} 'Faleminderit, shijoni vaktin tuaj!' ``` - start_code: '# Vendoseni kodin tuaj këtu' 7: story_text: | Në këtë nivel keni mësuar të përdorni komandën `{repeat}` që të përsëritni një rresht kodi disa herë. @@ -3581,7 +3136,6 @@ adventures: {repeat} _ {times} ushqimi = {ask} 'Çfarë doni të hani?' {print} 'Faleminderit për porosinë tuaj. Është duke u bërë!' ``` - start_code: '# Vendoseni kodin tuaj këtu' 8: story_text: | Në këtë nivel mund ta bëni restorantin tuaj virtual më të përpunuar duke përsëritur disa rreshta kodi. Si kështu: @@ -3598,7 +3152,6 @@ adventures: ``` story_text_2: | Sigurisht, ky kod mund të zgjerohet me më shumë artikuj në meny, duke ofruar pije dhe/ose kurse të shumta, kështu që mos ngurroni të shtoni sa më shumë opsione që dëshironi! - start_code: '# Vendoseni kodin tuaj këtu' 9: story_text: | Në këtë nivel ju mund të përdorni komandë ndër komandë për ta bërë restorantin tuaj më realist dhe më argëtues! @@ -3631,7 +3184,6 @@ adventures: {print} 'Kjo do të jetë ' çmimi ' lekë' {print} 'Të bëftë mirë!' ``` - start_code: '# Vendoseni kodin tuaj këtu' 10: story_text: | Në këtë nivel do të mësoni se si të {ask} (pyesni) me lehtësi për porositë e mysafirëve tuaj në një kod të shkurtër. @@ -3678,7 +3230,6 @@ adventures: çmimi = 4 * njerëzit {print} 'Kjo do të jetë ' çmimi ' lekë!' ``` - start_code: '# Vendoseni kodin tuaj këtu' 12: story_text: | Nga ky nivel e tutje, mund të përdorni numra dhjetorë për ta bërë menu-në tuaj më realiste. @@ -3700,7 +3251,6 @@ adventures: çmimi = çmimi + 2.35 {print} 'Kjo do të jetë ' çmimi ' lekë' ``` - start_code: '# Vendoseni kodin tuaj këtu' 13: story_text: | Në këtë nivel ne mund të përdorim komandat e reja për të përmirësuar restorantin tonë. @@ -3715,7 +3265,6 @@ adventures: çmimi = çmimi - 3 {print} 'Kjo do të jetë ' çmimi ' lekë' ``` - start_code: '# Vendoseni kodi tuaj këtu' 15: story_text: | Me komandën `{while}` mund të siguroheni që klientët tuaj të mund të vazhdojnë të shtojnë porosi derisa të mbarojnë. @@ -3731,7 +3280,6 @@ adventures: më_shumë = {ask} 'A dëshironi diçka {else}(tjetër)?' {print} 'Falemenderit!' ``` - start_code: '# Vendoseni kodin tuaj këtu' rock: name: Gur, letër, gërshërë default_save_name: Gur @@ -3757,7 +3305,6 @@ adventures: {ask} zgjidhni nga _ {echo} kështu që zgjedhja juaj ishte: ``` - start_code: '{print} Mirë se erdhët në lojën tuaj gur, letër, gërshërë!' 2: story_text: | Në këtë nivel mund ti praktikoni variablat, kështu që mund ta bëni lojën gur, letër, gërshërë në nivelin tjetër! @@ -3766,7 +3313,6 @@ adventures: _ {is} {ask} gur, letër, ose gërshërë? {print} Unë zgjedh _ ``` - start_code: '# Vendoseni kodin tuaj këtu' 3: story_text: | Në këtë nivel mund të futni një listë and të zgjidhni nga ajo. @@ -3786,12 +3332,10 @@ adventures: {print} lojtari 1 zgjedh... zgjedhje {at} {random} {print} lojtari 2 _ ``` - start_code: '{print} Mirë se erdhët në lojën tuaj gur, letër, gërshërë!' 4: story_text: | Në këtë nivel mund të programoni më shumë lojën gur, letër, gërshërë. Por {if} (nëse) doni të shtoni tekst, duhet të shtoni thonjëzat gjithashtu. A e përfundoni kodin duke shtuar komandat e sakta ose shkronjat në vizat e poshtme? - start_code: '{print} ''Mirë se erdhët në lojën tuaj gur, letër, gërshërë!''' 5: story_text: | Në këtë nivel mund ta përcaktoni kush fitoi. @@ -3811,7 +3355,6 @@ adventures: ``` Mbusheni boshllëqet {if} (nëse) është barazim. - start_code: '{print} ''Mirë se erdhët në lojën tuaj gur, letër, gërshërë!''' 9: story_text: | Në këtë nivel mund ta programi gjithë lojën gur, letër, gërshërë duke përdorur komandën {if} një mbi një. A mund ta përfundoni kodin? @@ -3831,7 +3374,6 @@ adventures: {print} 'Ju humbët!' # përfundoni kodin ``` - start_code: '# Vendoseni kodin tuaj këtu' 10: story_text: | Ju mërzitet që të luani lojën vetë? Lëreni Hedy të luajë për ju! @@ -3843,7 +3385,6 @@ adventures: {for} lojtari {in} lojtarët      {print} lojtari ' ka zgjedhur ' zgjedhjet {at} {random} ``` - start_code: '# Vendoseni kodin tuaj këtu' 13: story_text: | Me komandën `{and}` mund ta shkurtoni kodin tuaj për gur, letër, gërshërë! Shikoni shembullin më poshtë dhe tentoni ta përfundoni. @@ -3862,7 +3403,6 @@ adventures: {print} 'Kompjuteri fiton!' _ ``` - start_code: '# Vendoseni kodin tuaj këtu' 15: story_text: | Luani derisa ta fitoni kompjuterin! Por fillimisht, përfundoni shembullin e dhënë... @@ -3884,7 +3424,6 @@ adventures: fituat = 'po' _ ``` - start_code: '# Vendoseni kodin tuaj këtu' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3901,7 +3440,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: Super spiuni default_save_name: Super spiuni @@ -3928,7 +3466,6 @@ adventures: b = 'sot në orën 10:00' {print} a + b ``` - start_code: '# Vendoseni kodin tuaj këtu' 13: story_text: | A mund të plotësoni komandën e duhur në vendin bosh? Mendja: Superspiuni duhet t'u përgjigjet saktë të DY pyetjeve, përpara se të marrë informacionin konfidencial! @@ -3941,7 +3478,6 @@ adventures: {else} {print} 'Shko në stacionin e trenit në orën 10:00' ``` - start_code: '# Vendoseni kodin tuaj këtu' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3957,10 +3493,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Këndo një këngë! default_save_name: Këngë @@ -3998,7 +3530,6 @@ adventures: print 'JO MË MAJMUNE QË KËRREN NË SHTRAT!' sleep ``` - start_code: '{print} ''Le të këndojmë''' 7: story_text: | Këngët shpesh herë kanë përsëritje. Për shembull... Peshkaqeni i vogël! Nëse e këndoni, ju vazhdoni të këndoni të njëjtën gjë: @@ -4016,7 +3547,6 @@ adventures: ``` Pas Peshkani i vogël, ju mund të programi këngë të tjera. Ka shumë këngë me përsëritje. - start_code: '{print} ''Peshkaqeni i vogël''' 8: story_text: | Në nivelin e mëparshëm, ju e keni programuar këngën 'Shishe birre'. Ju e bëtë një varg dhe u deshtë që të kopjoni vargun 99 herë. Në nivelin 7 ju mund të përsëritni këngën 99 herë, vetëm duke shtuar një rresht kodi! @@ -4031,7 +3561,6 @@ adventures: vargu = vargu - 1 {print} vargu ' shishe birre në murr' ``` - start_code: '# Vendoseni kodin tuaj këtu' 10: story_text: | Në këtë nivel ju mund thjeshtë të bëni këngën për fëmijë ' këngën 'Pesë fëmijët majmun'. A mund ta bëni korin e fundit? @@ -4091,7 +3620,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# Vendoseni kodin tuaj këtu' 11: story_text: | Në këtë nivel ju mund të përdorni komandën `{for} i {in} {range}` të bëni muzika që përdorin numërim, si në 5 majmunët e vegjël. @@ -4109,7 +3637,6 @@ adventures: {else} {print} 'Jo më majmunët të kërcejnë në shtrat' ``` - start_code: '# Vendoseni kodin tuaj këtu' 12: story_text: | Në këtë këngë ne mund ta bëjmë ende më të lehtë të programojmë '{if} jeni të lumtur dhe e dini, duartrokitni'. Sepse mund ti vendosim të gjitha veprimet në një variabël, shiheni: @@ -4128,7 +3655,6 @@ adventures: _ {print} 'Nëse jeni të lumtur dhe e dini' _ {print} veprim ``` - start_code: '# Vendoseni kodin tuaj këtu' 13: 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? @@ -4145,16 +3671,6 @@ adventures: {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: | Në këtë nivel, ju mund ta programoni një këngë si Mek Donald i vjetër edhe më shpejtë. Ju mund ta lidhni kafshën e saktë me zërin e saktë thjeshtë duke i vënë me një vend në listë. @@ -4187,7 +3703,6 @@ adventures: {print} 'Eheei dhe ja ku ngritet' {print} 'herët në mëngjes' ``` - start_code: '# Vendoseni kodin tuaj këtu' 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. @@ -4209,7 +3724,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4231,15 +3745,6 @@ adventures: {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: Tik tak tou default_save_name: Tik @@ -4307,7 +3812,6 @@ adventures: {else} shenja = 'x' ``` - start_code: '# Vendoseni kodin tuaj këtu' 14: story_text: | Në nivelet e mëparshme ju keni bërë një lojë Tik tak tou. Tani keni mësuar se si të përdorni shenjën =, shenjën == dhe shenjën !=. @@ -4370,7 +3874,6 @@ adventures: {else} shenja = 'x' ``` - start_code: '# Vendoseni kodin tuaj këtu' 15: story_text: | Në këtë nivel ju mund të përmirësoni lojën tuaj Tik Tak Tou me komandën {while}. Me këtë lak ju mund të kombinoni lojën `{if} game != 'over'` dhe `{for} i {in} {range} 1 to 9` në një rresht të thjeshtë. @@ -4432,7 +3935,6 @@ adventures: {else} shenja = 'x' ``` - start_code: '# Vendoseni kodin tuaj këtu' 17: story_text: | Në nivelet e mëparshme loja tik tak tou kishte një veçori të bezdisshme. Pas çdo lëvizjeje, duhej të plotësoje veten nëse kishe fituar apo jo. @@ -4519,7 +4021,6 @@ adventures: {else}: shenja = 'x' ``` - start_code: '# Vendoseni kodin tuaj këtu' turtle: name: Breshka default_save_name: Breshka @@ -4543,9 +4044,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | Në këtë nivel ju mund të përdorni variabla që të bëni breshkën interaktive. Si për shembull mund ta pyetni lojtarin sa hapa duhet që të bëje breshka. @@ -4571,11 +4069,6 @@ adventures: {turn} këndi {forward} 25 ``` - start_code: |- - {print} Garë breshkash! - këndi {is} 90 - {turn} këndi - {forward} 25 3: story_text: "Në këtë nivel ju mund të përdorni komandën `{at} {random}` me vizatimin e breshkës. Një zgjedhje random e bën breshkën të ecë rrugë të ndryshme çdo herë. Përdorni `{at} {random}` për të zgjedhur një vlerë nga një listë. \n\n### Sfidë\nA mund të bëni kopjoni rreshtat 2 dhe\ \ 3 për të krijuar një rrugë më të gjatë random.\n" @@ -4585,10 +4078,6 @@ adventures: {turn} kënde {at} {random} {forward} 25 ``` - start_code: |- - kënde {is} 10, 50, 90, 150, 250 - {turn} kënde {at} {random} - {forward} 25 4: story_text: | Në nivelin 4 do duhet të përdorni thonjëza me komandën `{print}` dh `{ask}`. Gjithashtu duke vizatuar! @@ -4615,11 +4104,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Duke vizatuar figura' - këndi {is} 90 - {turn} këndi - {forward} 25 5: story_text: | Në nivelin 5 ju mund të bëni një zgjidhje me komandën `{if}`. Si për shembull ndërmjet dy lloje të figurave. @@ -4652,12 +4136,6 @@ adventures: if direction is right turn _ forward 100 ``` - start_code: |- - {print} 'Duke vizatuar figurë' - figura {is} {ask} 'A doni një katror apo një trekëndësh?' - {if} figura {is} trekëndësh këndi {is} 120 {else} këndi {is} 90 - {turn} këndi - {forward} 25 6: story_text: | Në këtë nivel mund të përdorni kalkulime për të vizatuar figura të ndryshme. @@ -4681,7 +4159,6 @@ adventures: {forward} 50 {turn} këndi ``` - start_code: '{print} ''Duke vizatuar figura''' 8: story_text: | Tani që mund të përsërisim shumë rreshta, mund të bëjmë figura më lehtë. @@ -4717,7 +4194,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4735,7 +4211,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4760,16 +4235,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4785,7 +4250,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4796,7 +4260,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4807,7 +4270,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4825,7 +4287,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4844,7 +4305,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4864,7 +4324,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4875,7 +4334,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4888,7 +4346,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4919,7 +4376,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4960,7 +4416,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4983,7 +4438,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5012,7 +4466,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5036,7 +4489,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5064,7 +4516,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5098,7 +4549,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5118,11 +4568,6 @@ adventures: 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 @@ -5140,4 +4585,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/sr.yaml b/content/adventures/sr.yaml index 540961606a2..4a6e76a0151 100644 --- a/content/adventures/sr.yaml +++ b/content/adventures/sr.yaml @@ -27,7 +27,6 @@ adventures: Koristi bar jednu komandu `{ask}` i jednu komandu `{echo}`. Možeš odabrati bilo koju temu. Ako ne možeš da smisliš baš ni jednu, upotrebi neku od naših tema: odlazak u bioskop, sportska utakmica ili dan u zološkom vrtu. - start_code: '{print} Tvoja priča počinje ovde' 2: story_text: | U nivou 2 možeš učiniti da tvoje priče budu još zabavnijim. Ime tvog glavnog junaka se sada može nalaziti bilo gde u rečenici. @@ -53,7 +52,6 @@ adventures: Promeni komande `{ask}` i `{echo}` u svom kodu u tačan oblik koji si naučio u ovom nivou. **Dodatno** Dodaj komandu sleep u svoj kod da bi podigao napetost u svojoj priči. - start_code: '{print} Tvoja priča' 3: story_text: | U nivou 3 možeš osmisliti priču da bude još zanimljivija. Možeš odabrati bilo koje čudovište, životinju ili bilo koju drugu prepreku, ovako: @@ -87,7 +85,6 @@ adventures: otpad {is} {ask} Šta bi iz torbe trebalo izbaciti? {remove} otpad {from} ranac ``` - start_code: '{print} Tvoja priča' 4: story_text: | Možda si primetio da još uvek postoji problem u prethodnim nivoima. Da li si probao da ištampaš rečenicu koja u sebi sadrži reč ime? `{print}` moje ime je ime. @@ -109,7 +106,6 @@ adventures: {print} _ On čuje zvuk _ životinje {at} {random} {print} ime _ se boji da je šuma ukleta _ ``` - start_code: '{print} ''Tvoja priča će biti ištampana ovde!''' 5: story_text: | U ovom nivou možeš isprogramirati različite završetke, koji će učiniti da tvoja priča bude još zanimljivija. @@ -135,7 +131,6 @@ adventures: {if} kraj {is} srećan {print} ime ' uzima mač i čudovište beži glavom bez obzira' {else} {print} 'Čudovište pojede ' ime ``` - start_code: '{print} ''Ovde će tvoja priča početi!''' 7: story_text: "U priči, neko će ponoviti reči nekoliko puta. Na primer, kada neko zove u pomoć ili peva pesmu.\nU ovom nivou ovakva ponavljanja staviti u svoju priču sa`{repeat}`.\n\n### Vežbanje\nDodaj ponavljanja u svoju priču. Vrati se do svojih sačuvanih programa, odaberi priču iz nivoa\ \ 6 i \npronadji liniju sa komandom `{print}` i ponovi je!\n" @@ -145,7 +140,6 @@ adventures: {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!\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\ @@ -161,7 +155,6 @@ adventures: {print} 'Ooo ne! Rićard je previše spor...' {print} _ ``` - start_code: '# ispiši svoj kod ovde' 9: story_text: "U ovom nivou možeš koristiti komande `{if}` i `{repeat}` unutar comandi `{if}` i `{repeat}`. \nOvo ti daje mnoge opcije i zaista pomaže da tvoja priča bude što interaktivnija.\n\n### Vežbanje 1\nZavrši kod tako da `{if}` radi tačno.\n\n### Vežbanje 2\nDodaj `{if}` i `{else}`\ \ za deo priče gde Robin takodje ide kući.\n\n### Vežbanje 3\nIdi nazad na novo 8 tvoje priče i iskoristi bar dva puta `{if}`unutar drugog `{if}`.\n" @@ -180,7 +173,6 @@ adventures: {else} {print} 'Robin odlazi kući' ``` - start_code: '# ispiši svoj kod ovde' 10: story_text: | U ovom novou možeš koristiti komadnu {for} u svojoj priči. Na ovaj način možeš lako isprogramirati knjigu za decu 'Braon medo, braon medo, sta ti to vidiš'. @@ -189,7 +181,6 @@ adventures: Pogledaj priča ako je ne znaš i potrudi se da bude ištampana kao u knjizi. example_code: "```\nživotinje = _ , _ , _ \n{print} 'Braon medo, Braon medo'\n {print} 'Šta ti to vidiš?'\n```\n" - start_code: '# ispiši svoj kod ovde' 12: story_text: |- U ovom nivou znaci navoda će biti potrebni da sačuvaš više reči u promenljivoj. @@ -202,7 +193,6 @@ adventures: ime = 'Kraljica Engleske' {print} ime ' je jela parče torte, kada najednom...' ``` - start_code: '# ispiši svoj kod ovde' 13: story_text: | Sa komandama `{and}` i `{or}`, možes osmisliti svestranije priče. Možešeš postaviti dva pitanja i odgovoriti sa kombinacijom odgovora. @@ -221,7 +211,6 @@ adventures: {if} put {is} 'levo' {and} oružje {is} 'mač' _ ``` - start_code: '# ispiši svoj kod ovde' 15: story_text: | `{while} game == 'on'Koristeći petlju `{while}` tvoje priče mogu biti zanimljivije. Na primer, možeš koristiti `{while} game == 'on'` da bi mogao da igraš sve dok se igra ne završi. @@ -244,7 +233,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -265,7 +253,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -305,13 +292,6 @@ adventures: _ {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 @@ -329,11 +309,6 @@ adventures: {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 @@ -366,10 +341,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -397,11 +368,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -513,7 +479,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +515,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In level 6 you created a calculator, in this level you can expand that code so it asks multiple questions. @@ -575,7 +539,6 @@ adventures: 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! @@ -593,7 +556,6 @@ adventures: {else} {print} 'That is wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -609,7 +571,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -620,7 +581,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -637,7 +597,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -662,11 +621,7 @@ adventures: 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 @@ -698,7 +653,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -747,17 +701,6 @@ adventures: 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 @@ -780,12 +723,6 @@ adventures: {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. @@ -805,14 +742,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -834,16 +763,6 @@ adventures: 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 @@ -858,13 +777,6 @@ adventures: {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 @@ -887,17 +799,7 @@ adventures: {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' @@ -924,19 +826,7 @@ adventures: 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: @@ -952,11 +842,6 @@ adventures: 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 @@ -981,10 +866,7 @@ adventures: {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} @@ -1021,19 +903,7 @@ adventures: 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: @@ -1048,11 +918,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1092,26 +957,6 @@ adventures: 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 @@ -1140,27 +985,6 @@ adventures: 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 @@ -1193,31 +1017,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1247,9 +1046,7 @@ adventures: 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?' @@ -1306,36 +1103,6 @@ adventures: 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 @@ -1481,7 +1248,6 @@ adventures: 1: story_text: "U Nivou 1 možete koristiti komande `{print}`, `{ask}` i `{echo}`.\n Iskucaj svoj kod u programerskom polju. Ili pritisni zeleno dugme u primeru koda i kod će se iskucati za vas!\nIsprobaj sam kod tako što ćeš pritisnuti zeleno 'Run code' dugme ispod programerskog polja.\n\n\ Možeš ispisati tekst na ekranu koristeći `{print}` komandu. \n" - start_code: '{print} Zdravo svete!' 2: story_text: | U Nivou 2 ćemo učiti dve nove komande: `{is}` i `{sleep}`. @@ -1496,11 +1262,9 @@ adventures: ``` story_text_2: | `{print}` i dalje radi na isti način, ali komanda `{ask}` je promenjena. Treba takodje da koristiš promenljivu i u komandi `{ask}` . To izgleda ovako: - start_code: '{print} zdravo svete!' 3: story_text: | U nivou 3 možeš napraviti listu. Možeš dozvoliti da kompjuter odabere nasumično iz liste. To postižeš sa `{at} {random}`. - start_code: '{print} zdravo svete!' 4: story_text: | U nivou 4 `{ask}` i `{print}` su izmenjeni. @@ -1513,7 +1277,6 @@ adventures: odgovor {is} {ask} 'Šta treba da koristimo od sada pa nadalje?' {print} 'Treba da koristimo' odgovor ``` - start_code: '{print} ''Zdravo svete''' 5: story_text: | U nivou 5 se nalazi novina, zvana `{if}`! Sa `{if}` možeš birati izmedju dve različite opcije. @@ -1524,9 +1287,6 @@ adventures: ime {is} {ask} 'Kako se zoves?' {if} ime {is} Hedy {print} 'super!' {else} {print} 'bla!' ``` - start_code: |- - ime {is} {ask} 'Kako se zoveš?' - {if} ime {is} Hedy {print} 'super!' {else} {print} 'bla' 6: story_text: "U ovom nivou naučićeš nešto novo: sada možeš da vršiš i matematičke operacije.\n\nSabiranje je lako, pišeš isto kao i u matematici: `5 + 5` na primer. Oduzimanje je takodje lako, `5 - 5`.\n\nMnoženje je malo drugačije, jer ne postoji znak puta na tastaturi. \nZato množimo\ \ sa zvezdicom na tipki iznad broja 8: `5 * 5`. Čitaj kao \"5 puta 5\" to najbolje pomaže da zapamtiš.\n" @@ -1544,7 +1304,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy je zabava!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy je zabava!''' 8: story_text: | `{ask}` i `{print}` i dalje rade kao što ih znamo. Ali `{if}`, `{else}`, i `{repeat}` su promenjeni! @@ -1568,10 +1327,6 @@ adventures: {print} 'ULJEZ!' {print} 'Ne možeš koristiti ovaj računar!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Zdravo ljudi' - {print} 'Ovo će biti ištampano 5 puta' 9: story_text: | U ovom nivou ne samo da možeš da koristiš višebrojne linije sa `{if}` i `{repeat}`, nego možeš da ih koristis i zajedno! @@ -1586,13 +1341,6 @@ adventures: {else} {print} 'pica je bolja' ``` - start_code: |- - {repeat} 3 {times} - hrana = {ask} 'Sta želiš?' - {if} hrana {is} pica - {print} 'super!' - {else} - {print} 'pica je bolja' 10: story_text: |- U ovom nivou učimo novi kod zvani`{for}`. Sa `{for}` možeš napraviti listu i koristiti sve elemente. @@ -1603,17 +1351,10 @@ adventures: {for} životinja {in} životinje {print} 'Ja volim ' životinja ``` - start_code: |- - životinje {is} pas, mačka, riba - {for} životinja {in} životinje - {print} 'Ja volim ' životinja 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: |- - {for} brojač {in} {range} 1 {to} 5 - {print} brojač 12: story_text: |- **Decimalni brojevi** @@ -1623,8 +1364,7 @@ adventures: {print} 'Dva zarez pet plus dva zarez pet je...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'za decimalne brojeve sada treba da koristimo tačku' + {print} 2.5 + 2.5 13: story_text: |- @@ -1637,11 +1377,6 @@ adventures: {if} ime {is} 'Hedy' {and} uzrast {is} 2 {print} 'Ti si prava Hedy!' ``` - start_code: |- - ime = {ask} 'kako se zoves?' - uzrast = {ask} 'koliko imas godina?' - {if} ime {is} 'Hedy' {and} uzrast {is} 2 - {print} 'Ti si prava Hedy!' 14: story_text: | Naučićemo još novih stvari. Možda to već znate iz matematike, znaci manje `<` i veće `>`. @@ -1656,8 +1391,7 @@ adventures: {if} uzrast > 12 {print} 'Stariji si od mene!' ``` - start_code: |- - uzrast = {ask} 'Koliko imaš godina?' + {if} uzrast < 13 {print} 'Mladji si od mene!' {else} @@ -1676,11 +1410,6 @@ adventures: odgovor = {ask} 'Koliko je 5 puta 5?' {print} 'Tačan odgovor je dat' ``` - start_code: |- - odgovor = 0 - {while} odgovor != 25 - odgovor = {ask} 'Koliko je 5 puta 5?' - {print} 'Tačan odgovor je dat' 16: story_text: |- Sada ćemo da napravimo liste kao što se prave u programerskom jeziku Python, sa uglastim zagradama oko liste! Takodje nastavljamo da koristimo znake navoda oko svakog elementa, kao što smo u prethodnim nivoima naučili. @@ -1710,8 +1439,7 @@ adventures: story_text: |- Stigli smo do koda pravog programerskog jezika Python-a! To znači da moramo da koristimo navodnike sa {print} i {range} od sada pa nadalje. To takodje znači da od ovog nivoa možeš koristiti Hedy kod u bilo kom Python okruženju sve dok koristiš komande na Engleskom jeziku. Ako nisi do sada, možeš promeniti podešavanje u meniju komandi. - start_code: |- - ime = 'Hedy' + {print}('Moje ime je ', ime) dice: name: Dice @@ -1739,7 +1467,6 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level you can also create dice. But this time you can try it yourself, without an example code! @@ -1747,7 +1474,6 @@ adventures: ### 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: | You can also make a die again in this level using the `{if}`. @@ -1761,7 +1487,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1781,7 +1506,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a dice again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1793,7 +1517,6 @@ adventures: choices = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''What will the dice indicate this time?''' 10: story_text: "Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once!\n\n### Exercise \nChange the names into names of your friends or family, and finish the code so they each roll.\n" example_code: | @@ -1804,7 +1527,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1829,7 +1551,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1850,7 +1571,6 @@ adventures: 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: story_text: | With quotation marks you can make your dishwashing program even better. @@ -1865,7 +1585,6 @@ adventures: {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. @@ -1873,7 +1592,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1906,7 +1624,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 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! @@ -1918,7 +1635,6 @@ adventures: 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! @@ -1933,7 +1649,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1981,10 +1696,6 @@ adventures: {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: |- U ovom nivou, dodajemo novi oblik za `{for}`. U ranijim nivoima, koristili smo `{for}` sa listom, ali `{for}` možemo koristiti i sa brojevima. @@ -1997,10 +1708,6 @@ adventures: {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: 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. @@ -2039,7 +1746,6 @@ adventures: ### Exercise Copy the example code into your inputscreen 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: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2057,7 +1763,6 @@ adventures: 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. @@ -2082,7 +1787,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2095,7 +1799,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2130,7 +1833,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2142,7 +1844,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2162,7 +1863,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 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. @@ -2181,7 +1881,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2193,7 +1892,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2233,21 +1931,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2276,13 +1959,6 @@ adventures: {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. @@ -2306,17 +1982,6 @@ adventures: 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 @@ -2345,7 +2010,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2367,7 +2031,6 @@ adventures: _ {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 @@ -2399,7 +2062,6 @@ adventures: 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. @@ -2446,7 +2108,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2468,7 +2129,6 @@ adventures: {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. @@ -2490,7 +2150,6 @@ adventures: _ _ _ _ {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" @@ -2515,7 +2174,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - 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\ @@ -2528,7 +2186,6 @@ adventures: {print} 'Room ' i monster = monsters {at} {random} ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2557,7 +2214,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2591,7 +2247,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2622,18 +2277,7 @@ adventures: {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?' @@ -2672,10 +2316,6 @@ adventures: _ _ _ 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... @@ -2692,11 +2332,6 @@ adventures: {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. @@ -2712,16 +2347,6 @@ adventures: {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 @@ -2750,11 +2375,6 @@ adventures: _ 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 @@ -2780,10 +2400,6 @@ adventures: 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: @@ -2792,8 +2408,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2825,8 +2440,7 @@ adventures: {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} @@ -2853,7 +2467,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2874,7 +2487,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2914,8 +2526,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2943,11 +2554,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Im Hedy the parrot - {ask} What is your name? - {echo} - {echo} 2: story_text: | Create your own online pet parrot that will copy you! @@ -2964,7 +2570,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2979,7 +2584,6 @@ adventures: {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}`. @@ -2994,7 +2598,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3011,7 +2614,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3032,7 +2634,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3056,7 +2657,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3085,7 +2685,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3098,7 +2697,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3118,7 +2716,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3144,8 +2741,6 @@ adventures: ``` _ 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. @@ -3162,8 +2757,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3195,7 +2789,6 @@ adventures: {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 @@ -3225,10 +2818,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3263,10 +2852,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3300,9 +2885,6 @@ adventures: 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. @@ -3351,11 +2933,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3369,10 +2946,6 @@ adventures: {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! @@ -3387,13 +2960,6 @@ adventures: {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 @@ -3419,10 +2985,6 @@ adventures: 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? @@ -3440,11 +3002,6 @@ adventures: _ {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 @@ -3468,7 +3025,6 @@ adventures: 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. @@ -3493,7 +3049,6 @@ adventures: 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: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3521,7 +3076,6 @@ adventures: 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. @@ -3544,7 +3098,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3565,7 +3118,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3584,7 +3136,6 @@ adventures: {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. @@ -3598,7 +3149,6 @@ adventures: {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: @@ -3617,7 +3167,6 @@ adventures: ### 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 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)**\ @@ -3644,7 +3193,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily ask orders for different courses. @@ -3683,7 +3231,6 @@ adventures: {print} 'So you want to order for ' people ' people.' {print} "Let's go!" ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3705,7 +3252,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3725,7 +3271,6 @@ adventures: {print} 'What a healthy choice!' {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3742,7 +3287,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3769,9 +3313,6 @@ adventures: {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! @@ -3780,7 +3321,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3804,13 +3344,11 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. ### 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 who won. @@ -3830,7 +3368,6 @@ 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" @@ -3850,7 +3387,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3870,7 +3406,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3889,7 +3424,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3912,7 +3446,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3929,7 +3462,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3956,7 +3488,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3969,7 +3500,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3985,10 +3515,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4026,7 +3552,6 @@ adventures: {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: @@ -4045,7 +3570,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: 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. @@ -4063,7 +3587,6 @@ adventures: 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! @@ -4080,7 +3603,6 @@ adventures: ``` 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. @@ -4096,7 +3618,6 @@ adventures: {print} monkeys ' little monkeys jumping on the bed' _ ``` - start_code: '# place your code here' 12: 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: @@ -4115,7 +3636,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4132,16 +3652,6 @@ adventures: {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. @@ -4177,7 +3687,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4199,7 +3708,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4221,15 +3729,6 @@ adventures: {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 @@ -4297,7 +3796,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4360,7 +3858,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4422,7 +3919,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4509,7 +4005,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4533,9 +4028,6 @@ adventures: {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. @@ -4561,11 +4053,6 @@ adventures: {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. @@ -4578,10 +4065,6 @@ adventures: {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! @@ -4608,11 +4091,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4645,12 +4123,6 @@ adventures: 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. @@ -4674,7 +4146,6 @@ adventures: {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" @@ -4715,7 +4186,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4733,7 +4203,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4758,16 +4227,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4783,7 +4242,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4794,7 +4252,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4805,7 +4262,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4823,7 +4279,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4842,7 +4297,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4862,7 +4316,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4873,7 +4326,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4886,7 +4338,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4917,7 +4368,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4958,7 +4408,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4981,7 +4430,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5010,7 +4458,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5034,7 +4481,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5062,7 +4508,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5096,7 +4541,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5116,11 +4560,6 @@ adventures: 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 @@ -5138,4 +4577,3 @@ adventures: {print} number {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/sv.yaml b/content/adventures/sv.yaml index 2b7cf3eabe2..2dfc0487d91 100644 --- a/content/adventures/sv.yaml +++ b/content/adventures/sv.yaml @@ -27,7 +27,6 @@ adventures: Använd minst ett `{ask}` - och ett `{echo}` -kommando. Du kan göra den om vilket ämne som helst. Om du inte kan komma på något ämne kan du använda ett av våra val: ett biobesök, en sportmatch eller en dag i djurparken. - start_code: '{print} Din berättelse börjar här' 2: story_text: | På nivå 2 kan du göra din berättelse roligare. Huvudpersonens namn kan nu stå var som helst i meningen. @@ -53,7 +52,6 @@ adventures: Ändra kommandona `{ask}` och `{echo}` i din kod till rätt form som du har lärt dig på den här nivån. **Extra** Lägg till ett {sleep}-kommando i din kod för att bygga upp spänningen i berättelsen. - start_code: '{print} Din berättelse' 3: story_text: | I nivå 3 kan du göra din berättelse lite roligare. Du kan använda slumpen för monster, djur, eller annat hinder, så här: @@ -87,7 +85,6 @@ adventures: kasta {is} {ask} Vad ska han kasta bort? {remove} kasta {from} säck ``` - start_code: '{print} Din berättelse' 4: story_text: | Du kanske har märkt att det fortfarande finns ett problem i de tidigare nivåerna. Försökte du skriva ut en mening som innehöll ordet namn? Dvs. `{print}` mitt namn är namn. @@ -112,7 +109,6 @@ adventures: {print} _ Han hör ljudet av _ djur {at} {random} {print} namn _ är rädd för att detta är en trollskog _ ``` - start_code: '{print} ''Din berättelse skrivs ut här!''' 5: story_text: | På den här nivån kan du programmera olika slut, vilket gör din berättelse ännu roligare. @@ -138,7 +134,6 @@ adventures: {if} slutet {is} lyckligt {print} namn ' tar sitt svärd och monstret springer bort' {else} {print} 'Monstret äter upp ' namn ``` - start_code: '{print} ''Här börjar din berättelse!''' 7: story_text: | I en berättelse säger någon samma ord flera gånger. Till exempel när någon ropar på hjälp eller sjunger en sång. @@ -153,7 +148,6 @@ adventures: {repeat} 5 {times} {print} 'Hjälp!' {print} 'Varför hjälper ingen mig?' ``` - start_code: '{repeat} 5 {times} {print} ''Hjälp!''' 8: story_text: | På den här nivån kan du använda flera rader i dina `{if}` -kommandon; på så sätt kan du uppgradera ditt glada eller sorgliga slut! @@ -176,7 +170,6 @@ adventures: {print} 'Åh nej! Richard är för långsam ..." {print} _ ``` - start_code: '# Placera din kod här' 9: story_text: | På den här nivån kan du använda kommandona `{if}` och `{repeat}` inuti andra `{if}`- och `{repeat}`-kommandon. @@ -205,7 +198,6 @@ adventures: {else} {print} 'Robyn går hem' ``` - start_code: '# placera din kod här' 10: story_text: | På den här nivån kan du använda kommandot {for} i din berättelse. På detta sätt kan du enkelt programmera barnboken 'Brown bear, Brown bear, what do you see'. @@ -214,7 +206,6 @@ adventures: Titta på berättelsen om du inte känner till den, och se till att den skrivs ut som i boken. example_code: "```\ndjur = _ , _ , _ , _ \n{print} 'Brunbjörn, brunbjörn'\n {print} 'Vad ser du?'\n```\n" - start_code: '# placera din kod här' 12: story_text: |- På den här nivån behövs citattecken för att_spara flera ord i en variabel. @@ -227,7 +218,6 @@ adventures: namn = 'Drottningen av England' {print} namn ' åt en tårtbit, när plötsligt...' ``` - start_code: '# placera din kod här' 13: story_text: | Med kommandona `{and}` och `{or}` kan du göra dina berättelser mer flexibla. Du kan ställa två frågor och svara baserat på båda svaren. @@ -246,7 +236,6 @@ adventures: {if} väg {is} 'vänster' {and} vapen {is} 'svärd' _ ``` - start_code: '# placera din kod här' 15: story_text: | Med `{while}`-loopen kan du göra dina berättelser mer intressanta. Du kan t.ex. använda `{while} game == 'on'` så att du kan spela tills spelet är slut. @@ -269,7 +258,6 @@ adventures: {print} 'Nej, de är inte här: ' plats {print} 'Nu kan du gå in i huset!' ``` - start_code: '# placera din kod här' 18: story_text: | Vi ska skriva ut en annan historia, men nu måste vi använda parenteser med `{print}`. @@ -290,7 +278,6 @@ adventures: namn = {input}("Vad heter du?") {print}('Välkommen till den här berättelsen!') ``` - start_code: '# placera din kod här' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: kommandot_lägg_till_ta_bort @@ -330,13 +317,6 @@ adventures: _ {print} Du får en milkshake med smaker {at} {random} ``` - start_code: |- - djur {is} hund, katt, känguru - gillar {is} {ask} Vilket är ditt favoritdjur? - {add} gillar {to_list} djur - ogillar {is} {ask} Vilket djur gillar du inte? - {remove} ogillar {from} djur - {print} Jag väljer djur {at} {random} and_or_command: name: '{and} & {or}' default_save_name: och eller @@ -354,11 +334,6 @@ adventures: {if} namn {is} 'Hedy' {and} ålder {is} 2 {print} 'Du är den riktiga Hedy!' ``` - start_code: |- - namn = {ask} 'vad heter du?' - ålder = {ask} 'hur gammal är du?' - {if} namn {is} 'Hedy' {and} ålder {is} 2 - {print} 'Du är den riktiga Hedy!' ask_command: name: '{ask}' default_save_name: kommandot_fråga @@ -391,10 +366,6 @@ adventures: _ Hur mår du? _ ``` - start_code: | - {print} Hej! - {ask} Vad heter du? - {echo} hej 2: story_text: | ## Kommandot fråga @@ -422,11 +393,6 @@ adventures: favoritdjur is ask Vilket är ditt favoritdjur? print Jag gillar favoritdjur ``` - start_code: |- - namn {is} {ask} Vad heter du? - {print} Hej namn - ålder {is} {ask} Hur gammal är du? - {print} namn är ålder år gammal. 18: story_text: | Den sista ändringen vi behöver göra för att få Python-kod är att ändra `{ask}` till `{input}`. @@ -539,7 +505,6 @@ adventures: {elif} poäng > givens_poäng {and} poäng < 21: {print} 'Du vinner!' ``` - start_code: '# skriv din kod här' calculator: name: Kalkylator default_save_name: Kalkylator @@ -576,7 +541,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Välkommen till den här kalkylatorn!''' 9: story_text: | På nivå 6 gjorde du en miniräknare och på den här nivån kan du utöka den koden så att den ställer flera frågor. @@ -601,7 +565,6 @@ adventures: poäng = poäng + 1 {print} 'Bra jobbat! Du har ... ' poäng ' av 10 poäng!' ``` - start_code: '{print} ''Välkommen till den här kalkylatorn!''' 10: story_text: | Det här räknespelet hjälper dig att öva på multiplikationstabellerna! @@ -619,7 +582,6 @@ adventures: {else} {print} 'Det är fel. Rätt svar är ' rätt ``` - start_code: '# skriv din kod här' 11: story_text: | Med en `{for}` kan du förenkla övningsprogrammet för multiplikationstabeller. @@ -635,7 +597,6 @@ adventures: {for} i {in} {range} 1 till 10 {print} i * tal ``` - start_code: '# skriv din kod här' 12: story_text: | På den här nivån kan du göra en miniräknare som fungerar för decimaltal. @@ -654,7 +615,6 @@ adventures: svar = _ {print} tal1 ' plus ' tal2 ' är ' _ ``` - start_code: '# skriv din kod här' 13: story_text: | ### Övning 1 @@ -671,7 +631,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Skriv din kod här' 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. @@ -696,11 +655,7 @@ adventures: 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 @@ -732,7 +687,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# skriv din kod här' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -781,17 +735,6 @@ adventures: {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 @@ -814,12 +757,6 @@ adventures: {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. @@ -839,14 +776,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -868,16 +797,6 @@ adventures: 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 @@ -892,13 +811,6 @@ adventures: {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 @@ -921,17 +833,7 @@ adventures: {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' @@ -958,19 +860,7 @@ adventures: 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: @@ -986,11 +876,6 @@ adventures: 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 @@ -1015,10 +900,7 @@ adventures: {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} @@ -1055,19 +937,7 @@ adventures: 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: @@ -1082,11 +952,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1126,26 +991,6 @@ adventures: 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 @@ -1174,27 +1019,6 @@ adventures: 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 @@ -1227,31 +1051,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1281,9 +1080,7 @@ adventures: 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?' @@ -1340,36 +1137,6 @@ adventures: 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 @@ -1519,7 +1286,6 @@ adventures: Prova koden själv med den gröna 'Kör kod'-knappen under programmeringsfältet. Är du klar? Gå då till nästa flik och lär dig ditt första kommando! - start_code: '{print} hej världen!' 2: story_text: | Grattis! Du har nått nivå 2. Förhoppningsvis har du redan gjort lite fantastisk kod! @@ -1539,14 +1305,12 @@ adventures: Det ändras på nivå 2. På nivå 2 lär du dig att arbeta med variabler, som låter dig spara flera olika informationer och skriva ut dem var du vill. Så fortsätt nu till nästa flik! - start_code: '{print} hej världen!' 3: story_text: | På den föregående nivån har du lärt dig vad en variabel är och hur du kan använda den för att göra dina äventyr mer interaktiva. Men ... det är inte det enda du kan göra med variabler! Du kan också använda variabler för att skapa listor. Och du kan till och med låta Hedy välja ett slumpmässigt ord från en lista, vilket låter dig göra riktiga spel! Ta en snabb titt på nästa flik! - start_code: '{print} hej världen!' 4: story_text: | På de tidigare nivåerna har du övat på att använda variabler, men du kanske har stött på ett problem. @@ -1566,7 +1330,6 @@ adventures: namn {is} Sophie {print} Jag heter namn ``` - start_code: '{print} ''Hej världen''' 5: story_text: | På de tidigare nivåerna har du redan lärt dig att använda `{at} {random}` som gjorde dina spel annorlunda varje gång du körde koden. @@ -1578,9 +1341,6 @@ adventures: ``` lösenord {is} {ask} 'Vad är rätt lösenord?' ``` - start_code: |- - namn {is} {ask} 'Vad heter du?' - {if} namn {is} Hedy {print} 'cool!' {else} {print} 'meh' 6: story_text: | På föregående nivå har du övat med `{ask}` och `{if}`. Du kan till exempel fråga gästerna vad de skulle vilja äta. @@ -1604,7 +1364,6 @@ adventures: totalpris {is} food_price + drink_price {print} 'Det blir ' totalpris ' dollar, tack' ``` - start_code: '# placera din kod här' 7: story_text: | Bra jobbat! Du har nått nästa nivå, vilket betyder att du har tränat på `{if}` och `{else}`. Du har säkert märkt att din kod blir längre och längre. @@ -1618,11 +1377,6 @@ adventures: {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: | Nu har du lärt dig hur du upprepar en enstaka kodrad. Detta är praktiskt, men det räcker inte alltid. Ibland vill du upprepa flera rader samtidigt. @@ -1631,7 +1385,6 @@ adventures: ``` {repeat} 5 {times} {print} 'På nästa flik kan du upprepa flera rader kod samtidigt!' ``` - start_code: '{print} ''Vi forsätter till nästa flik!''' 9: story_text: | Bra jobbat! Du har nått en ny nivå! På den föregående nivån lärde du dig använda flera rader kod i ett {if}- eller {repeat}-kommando. Men du kan ännu inte kombinera dem ... @@ -1646,7 +1399,6 @@ adventures: {print} 'Hurra!' {else} {print} 'Kanske du ska öva lite mer på förra nivån' - start_code: '{print} Fortsätt till nästa flik!' 10: story_text: | Det här gå ju bra! På de tidigare nivåerna stod vi fortfarande inför ett litet problem. Du har lärt dig att repetera kodrader, men tänk om du skulle vilja ändra raden lite. @@ -1662,12 +1414,10 @@ adventures: {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} ''Vi forsätter till nästa flik!''' 11: story_text: | Du har nått nivå 11: bra jobbat! På de högre nivåerna fokuserar Hedy mer och mer på att lära dig programspråket Python. I Python finns inget `{repeat}` -kommando, men det finns ett kommando som fungerar som {repeat}. Är du nyfiken på hur man säger `{repeat}` på Python-språk? Fortsätt snabbt för att ta reda på det! - start_code: '{print} ''Fortsätt till nästa flik!''' 12: story_text: | Kanske du testade att använda decimaltal i ditt restaurangäventyr. Om du gjorde det märkte du förmodligen att Hedy inte förstod dem än och alltid avrundade. @@ -1680,7 +1430,6 @@ adventures: print 'Du har beställt en hamburgare och en dryck' print 'Det kostar' totalt 'dollar tack' ``` - start_code: '{print} ''Fortsätt till nästa flik!''' 13: story_text: | På de tidigare nivåerna lärde du dig hur man lägger två `{if}`-kommandon inuti varandra. Det här fungerar bra, men det ger dig väldigt lång och klumpig kod som den här: @@ -1700,7 +1449,6 @@ adventures: {else} {print} 'Tillträde förbjudet!' ``` - start_code: '{print} ''Fortsätt till nästa nivå!''' 14: story_text: | Med programmet här under kan du räkna ut om du har godkänt ett ämne i skolan (alltså ett betyg på sex eller högre). @@ -1717,7 +1465,6 @@ adventures: {else} {print} 'Bra! Du har klarat ämnet!' ``` - start_code: '{print} ''Fortsätt till nästa flik''' 15: story_text: | I det spelet här nedanför finns kod för att se till att spelaren kan spela så länge den vill ... @@ -1735,7 +1482,6 @@ adventures: {if} svar {is} 'ja' {print} 'Ok, vi fortsätter' ``` - start_code: '{print} ''Fortsätt till nästa nivå!''' 16: story_text: | På den här nivån kommer vi att växa lite mer mot riktig Python-kod. Du kommer också att lära dig hur du matchar två listor. @@ -1756,11 +1502,9 @@ adventures: {for} läte {in} läten {print} 'En 'vad' säger 'läte ``` - start_code: '{print} ''Fortsätt till nästa flik!''' 17: story_text: | Du har nästan nått sista nivån i Hedy – bra jobbat! På den här nivån kommer du att lära dig ett riktigt Python-sätt att använda `{print}`. - start_code: '{print} ''Fortsätt till nästa nivå!''' 18: story_text: | Grattis! Du har nått den sista nivån i Hedy! Koden du skrivit här kan kopieras till riktiga Python-miljöer som replit eller PyCharm och du kan fortsätta lära dig där! @@ -1792,7 +1536,6 @@ adventures: ``` val {is} _ ``` - start_code: '{print} Vad kommer tärningen att visa den här gången?' 4: story_text: | På den här nivån kan du också skapa tärningar. Men den här gången kan du prova det själv, utan exempelkod! @@ -1800,7 +1543,6 @@ adventures: ### Övning Gör dina egna tärningar i den här nivån. Tips: Om du inte har någon aning om hur man gör tärningar. Ta en titt på dina tärningar från föregående nivå, men glöm inte att lägga till citattecken. - start_code: '{print} ''Vad kommer tärningen att visa den här gången?''' 5: story_text: | Vi ska lägga till kommandona `{if}` och `{else}` till vår tärning! @@ -1816,7 +1558,6 @@ adventures: _ throw {is} daggmask {print} 'Du kan sluta kasta.' _ {print} 'Du måste kasta igen!' ``` - start_code: '{print} ''Vad kommer tärningen att visa den här gången?''' 6: story_text: | Du kan också låta en daggmask dö igen, men nu kan du också beräkna hur många poäng som har kastats. @@ -1836,7 +1577,6 @@ adventures: ``` example_code_2: | Lyckades du räkna ut poängen för åtta tärningar? Det behövdes en hel del klippande och klistrande, eller hur? Vi kommer att göra det enklare på nivå 7! - start_code: '{print} ''Vad kommer tärningen att visa den här gången?''' 7: story_text: | Du kan också göra en tärning igen på den här nivån. Med `{repeat}` -koden kan du enkelt kasta en handfull tärningar. @@ -1848,7 +1588,6 @@ adventures: val = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''Vad kommer tärningarna att visa den här gången?''' 10: story_text: | ### Övning @@ -1862,7 +1601,6 @@ adventures: {print} 'spelare ' kastar ' val {at} {random} {sleep} ``` - start_code: '# skriv din kod här' 15: story_text: | ### Exercise @@ -1887,7 +1625,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# skriv din kod här' dishes: name: Disk? default_save_name: Disk @@ -1908,7 +1645,6 @@ adventures: Tänk sedan ut en uppgift som måste göras och låt datorn bestämma vem som ska göra uppgiften med kommandot `{at} {random}`. **Extra** Känner du inte för att diska själv? Hacka programmet genom att ta bort ditt namn från listan med kommandot `{remove}` `{from}`. - start_code: '{print} Vem diskar?' 4: story_text: | Med citattecken kan du göra ditt diskprogram ännu bättre. @@ -1923,7 +1659,6 @@ adventures: {sleep} {print} personer {at} _ ``` - start_code: '{print} ''Vem diskar?''' 5: story_text: | Med `{if}` kan du nu ha roligare valmöjligheter i programmet. Du kan låta programmet reagera på datorns val. @@ -1937,7 +1672,6 @@ adventures: _ diskare {is} Sophie {print} _ synd att jag måste diska _ _ {print} 'lyckligtvis ingen disk eftersom ' _ ' redan diskar' ``` - start_code: '{print} ''Vem diskar?''' 6: story_text: | Hur ofta ska var och en diska? Är det rättvist? Du kan räkna ut det på den här nivån. @@ -1969,7 +1703,6 @@ adventures: {print} 'Tisdagsdisken sköts av: ' diskare {remove} diskare {from} personer ``` - start_code: '{print} ''Vem diskar?''' 7: story_text: | Med `{repeat}` kan du upprepa delar av koden. Du kan använda detta för att beräkna vem som kommer att diska under flera dagar! @@ -1981,7 +1714,6 @@ adventures: personer = mamma, pappa, Emma, Sophie {repeat} _ _ {print} 'Disken kommer att skötas av ' _ _ _ ``` - start_code: '{print} ''Vem diskar?''' 10: story_text: | På den här nivån kan du göra ett schema för hela veckan på ett enkelt sätt! @@ -1996,7 +1728,6 @@ adventures: {for} dag {in} dagar {print} namn {at} {random} ' diskar på ' dag ``` - start_code: '# skriv din kod här' elif_command: name: '{elif}' default_save_name: annarsom @@ -2044,10 +1775,6 @@ adventures: {for} djuret {in} djur {print} 'Jag älskar ' djuret ``` - start_code: |- - djur {is} hund, katt, marulk - {for} djuret {in} djur - {print} 'Jag älskar ' djuret 11: story_text: |- På den här nivån lägger vi till en ny form av `{for}`. På tidigare nivåer använde vi `{for}` med en lista, men vi kan också använda `{for}` med tal. @@ -2060,10 +1787,6 @@ adventures: {print} räknare {print} 'Redo eller icke, nu kommer jag!' ``` - start_code: |- - {for} räknare {in} {range} 1 {to} 10 - {print} räknare - {print} 'Redo eller icke, nu kommer jag!' 17: story_text: | Nu ska vi ändra reglerna för indragning lite. Varje gång vi behöver en indragning måste vi ha `:` på raden före indragningen. @@ -2102,7 +1825,6 @@ adventures: ### Övning Kopiera exempelkoden till din inmatningsskärm och fyll i de tomma rutorna så att koden fungerar. **Extra** Ändra koden och låt spådamen inte bara förutsäga ditt namn utan även din ålder, ditt favoritsportlag eller något annat om dig själv. - start_code: '# skriv din kod här' 3: story_text: | På de tidigare nivåerna har du skapat din första spåmaskin, men Hedy kunde inte förutsäga någonting, bara `{echo}`. @@ -2120,7 +1842,6 @@ adventures: story_text_2: | ### Övning Just nu kan Hedy bara svara ja, nej eller kanske. Kan du ge Hedy fler svarsalternativ, till exempel 'definitivt' eller 'fråga igen'. - start_code: '# skriv din kod här' 4: story_text: | Den här nivån har inga nya funktioner, men ger dig chansen att öva på att använda citattecken. @@ -2145,7 +1866,6 @@ adventures: {sleep} 2 {print} svar {at} {random} ``` - start_code: '# skriv din kod här' 5: story_text: | ### Övning @@ -2169,7 +1889,6 @@ adventures: {if} person {in} vänner {print} bra_svar {at} {random} {else} {print} dåligt_svar {at} {random} ``` - start_code: '# skriv din kod här' 6: story_text: | På den här nivån kan du använda matematik i dina förutsägelser som spåkvinna. Detta gör att du kan hitta på (fåniga) formler för att beräkna framtiden. @@ -2192,7 +1911,6 @@ adventures: {sleep} {print} barn ' barn!' ``` - start_code: '# skriv din kod här' 7: story_text: | ### Övning @@ -2205,7 +1923,6 @@ adventures: alternativ = de älskar dig, de älskar dig inte _ _ _ _ alternativ {at} {random} ``` - start_code: '# skriv din kod här' 8: story_text: | I nästa exempel kan du låta din spådam ställa flera frågor och även skriva ut dem! @@ -2223,7 +1940,6 @@ adventures: {sleep} {print} 'Min kristallkula säger ...' svar {at} {random} ``` - start_code: '# skriv din kod här' 10: story_text: | På den här nivån lär du dig att programmera spelet MASH (M=herrgård, A=lägenhet, S=stuga, H=hus). I det här spelet kan du förutsäga för alla spelare samtidigt hur deras framtid kommer att se ut. @@ -2242,7 +1958,6 @@ adventures: {print} namn ' kommer att få en ' husdjur {at} {random} ' som husdjur. {sleep} ``` - start_code: '# place your code here' 12: story_text: |- Från och med nivå 12 måste du också använda citattecken i listor, före och efter varje punkt. @@ -2257,7 +1972,6 @@ adventures: {sleep} {print} spådomar {at} {random} ``` - start_code: '# skriv din kod här' functions: name: functions default_save_name: functions @@ -2297,21 +2011,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2340,13 +2039,6 @@ adventures: {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. @@ -2370,17 +2062,6 @@ adventures: 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 @@ -2409,7 +2090,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2431,7 +2111,6 @@ adventures: _ {print} namn ' är bra på ' ämnen {at} {random} _ {print} namn 's största rädsla är ' rädslor {at} {random} ``` - start_code: '# skriv din kod här' haunted: name: Spökhuset default_save_name: Spökhuset @@ -2460,7 +2139,6 @@ adventures: Kopiera exempelkoden till din inmatningsskärm genom att klicka på den gula knappen. Avsluta nu berättelsen genom att lägga till minst fem rader kod. Kom ihåg att börja varje kodrad med ett `{print}`-kommando. - start_code: '{print} Hur kom jag hit?' 2: story_text: | I detta spökhus kan du välja dina monster med emoji. Naturligtvis kan du också använda ord. @@ -2515,7 +2193,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# skriv din kod här' 4: story_text: | På den här nivån lär du dig att använda citattecken i dina spel. @@ -2537,7 +2214,6 @@ adventures: {sleep} {print} monster {at} {random} ``` - start_code: '# skriv din kod här' 5: story_text: | Fram till den här nivån har Spökhusspelet alltid bett spelaren att välja en dörr, men som du kanske har märkt behöver spelaren inte svara rätt. @@ -2559,7 +2235,6 @@ adventures: _ _ _ _ {print} 'Bra! Du har rymt!' {else} {print} 'Åh nej! Du blir uppäten av en ...' monster {at} {random} ``` - start_code: '# skriv din kod här' 9: story_text: "På den här nivån kan du använda dig av nästlade satser, vilket gör spökhuset ännu mer interaktivt!\n\n### Övning\nNu är det väldigt svårt att vinna det här spelet; kan du göra det lättare att vinna?\nÄndra din kod så att den bara har en felaktig dörr och två korrekta dörrar\ \ istället för en korrekt dörr och två felaktiga? \nTips: Detta innebär att du ändrar variabeln korrekt_dörr till fel_dörr och byter ut koden `{if}` och `{else}`.\n Och naturligtvis kan du också ändra berättelsen och göra den mer personlig. Ändra monstren eller gör det till en glad\ @@ -2585,7 +2260,6 @@ adventures: {if} spelare {is} lever {print} 'Bra! Du överlevde!' ``` - start_code: '{print} ''Fly från spökhuset!''' 11: story_text: "På den här nivån har vi ändrat kommandot `{for}` så att vi kan berätta för spelaren var den befinner sig. \n\n### Övning 1\nAvsluta programmet så att spelaren vet vilket rum den befinner sig i.\n\n### Övning 2\nGör programmet till ett äventyr genom att följa dessa steg:\n\n\ 1. Gör en lista med valmöjligheter (till exempel: slåss eller fly).\n2. Se till att spelaren kan välja ett alternativ med `{ask}`\n3. Är svaret rätt? Då får den gå vidare till nästa monster. Ger den fel svar? Låt spelaren veta det med en `{print}`. \n\n**Extrauppgift** Om du väljer\ @@ -2598,7 +2272,6 @@ adventures: {print} 'Rum' i vilket_monster = monster {at} {random} ``` - start_code: '{print} ''Fly från spökhuset!''' 14: story_text: | ### Exercise @@ -2627,7 +2300,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2661,7 +2333,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2692,18 +2363,7 @@ adventures: {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?' @@ -2742,10 +2402,6 @@ adventures: _ _ _ 4 _ 'Bra jobbat!' _ _ 'Nej, 2 + 2 = 4' ``` - start_code: |- - namn {is} {ask} 'vad heter du?' - {if} namn {is} Hedy {print} 'nice' - {else} {print} 'bu!' 8: story_text: | ## Om … Annars … @@ -2762,11 +2418,6 @@ adventures: {print} 'Välkommen Hedy' {print} 'Du kan spela på din dator!' ``` - start_code: | - namn = {ask} 'Vad heter du?' - {if} namn {is} Hedy - {print} 'Välkommen Hedy' - {print} 'Du kan spela på din dator!' 9: story_text: | In this level you can also put an {if} command inside another {if} command. @@ -2782,16 +2433,6 @@ adventures: {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: kommandot_i @@ -2820,11 +2461,6 @@ adventures: _ svar _ djur _ 'Mitt också!' _ _ 'Mina favoritdjur är hundar, kor och får' ``` - start_code: |- - snygga_färger {is} grön, gul - favoritfärg {is} {ask} 'Vilken är din favoritfärg?' - {if} favoritfärg {in} snygga_färger {print} 'snyggt!' - {else} {print} 'meh' is_command: name: '{is}' default_save_name: kommandot_är @@ -2850,10 +2486,6 @@ adventures: favoritdjur är _ {print} Jag gillar favoritdjur ``` - start_code: |- - namn {is} Hedy - ålder {is} 15 - {print} namn är ålder år gammal 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: @@ -2862,8 +2494,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2895,8 +2526,7 @@ adventures: {if} namn != 'Hedy' {print} 'Du är inte Hedy' ``` - start_code: |- - ålder = {ask} 'Hur gammal är du?' + {if} ålder < 13 {print} 'Du är yngre än jag!' {else} @@ -2923,7 +2553,6 @@ adventures: {if} groda {is} grenouille {print} 'Superbt!' {else} {print} 'Nej, groda heter grenouille' ``` - start_code: '# skriv din kod här' 16: story_text: | ### Exercise @@ -2944,7 +2573,6 @@ adventures: {print} 'Fel, ' franska_ord[i] ' betyder ' översättning[i] {print} 'Du gav ' poäng ' rätta svar.' ``` - start_code: '# skriv din kod här' maths: name: matte default_save_name: matte @@ -2984,8 +2612,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimaltal behöver nu använda en punkt' + {print} 2.5 + 2.5 parrot: name: Papegoja @@ -3013,11 +2640,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Jag är papegojan Hedy - {ask} Vad heter du? - {echo} - {echo} 2: story_text: | På förra nivån skapade du en papegoja som härmar dig. På den här nivån kommer vi att göra papegojan interaktiv med en variabel och `{ask}`-kommandot. @@ -3038,7 +2660,6 @@ adventures: Fyll sedan i ett `{sleep}`-kommando på rad 4 och 6 för att låta papegojan vara tyst en liten stund. **Extrauppgift** Kan du få papegojan att fråga efter mer än bara ditt namn genom att lägga till fler rader kod? - start_code: '{print} Jag är papegojan Hedy!' 3: story_text: | Lär din papegoja ett nytt ord med `{add}`. @@ -3053,7 +2674,6 @@ adventures: {print} 🧒 Säg nytt_ord, Hedy! {print} 🦜 ord {at} {random} ``` - start_code: '# placera din kod här' 4: story_text: | På den här nivån måste vi använda citattecken i kommandona `{ask}` och `{print}`. @@ -3068,7 +2688,6 @@ adventures: {print} _ 🧒 Säg _nytt_ord _, hedy!_ {print} _ 🦜 _ ord {at} {random} ``` - start_code: '# Skriv din kod här' 5: story_text: | Belöna din papegoja om den säger rätt ord! @@ -3087,7 +2706,6 @@ adventures: _ sagt_ord {is} nytt_ord _ '🧒 Bra jobbat, Hedy! 🍪' _ _ '🧒 Nej, Hedy! Säg ' nytt_ord ``` - start_code: '# placera din kod här' piggybank: name: Spargris default_save_name: Spargris @@ -3111,7 +2729,6 @@ adventures: veckor = att_spara / fickpeng {print} 'Du kan köpa en ' _ ' om ' _ ' veckor.' ``` - start_code: '# skriv din kod här' 14: story_text: | ### Exercise @@ -3135,7 +2752,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Knapptryckningar default_save_name: Tryckt @@ -3164,7 +2780,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# skriv din kod här' 7: story_text: | Nu när du har lärt dig om `{repeat}`, kan vi trycka på tangenterna flera gånger. @@ -3177,7 +2792,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# skriv din kod här' 9: story_text: | Nu när du vet hur man kombinerar påståenden kan du skapa ett verktyg för att skriva på tangentbord med `{pressed}`-kommandot. @@ -3197,7 +2811,6 @@ adventures: _ _ ``` - start_code: '# skriv din kod här' print_command: name: '{print}' default_save_name: skriv @@ -3223,8 +2836,6 @@ adventures: ``` _ Hej! ``` - start_code: | - {print} Välkommen till Hedy! 18: story_text: |- Vi har kommit fram till riktig Python-kod! Det betyder att vi måste använda parenteser med `{print}` och `{range}` från och med nu. @@ -3241,8 +2852,7 @@ adventures: temperatur = 25 {print}('Det är ', temperatur, ' grader ute') ``` - start_code: |- - namn = 'Hedy' + {print}('Jag heter ', namn) quizmaster: name: Quizmästare @@ -3273,7 +2883,6 @@ adventures: {if} poäng_b > poäng_a {print} 'Du tillhör B-klubben' ``` - start_code: '# skriv din kod här' quotation_marks: name: '''citattecken''' default_save_name: citattecken @@ -3303,10 +2912,6 @@ adventures: {print} 'I'm babysitting my sister's kids' {print} 'What's more fun than that?' ``` - start_code: |- - {print} 'Du måste använda citattecken från och med nu!' - svar {is} {ask} 'Vad behöver vi använda från och med nu?' - {print} 'Vi måste använda ' svar 12: story_text: | **All text måste stå inom citattecken** @@ -3341,10 +2946,6 @@ adventures: poäng = 25 {print} 'Du har ' poäng ' poäng' ``` - start_code: |- - namn = {ask} 'Vad heter du?' - {if} namn = 'Roboten Hedy' - {print} 'Hej på dig!' random_command: name: random default_save_name: kommandot_random @@ -3378,9 +2979,6 @@ adventures: priser {is} _ _ ``` - start_code: | - djur {is} hund, katt, känguru - {print} djur {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. @@ -3430,11 +3028,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy är kul!' ``` - 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: | ### Upprepa-kommandon och indrag @@ -3448,10 +3041,6 @@ adventures: {print} 'Hej allihop' {print} 'Allt detta upprepas fem gånger' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hej allihop!' - {print} 'Detta kommer att skrivas ut fem gånger' 9: story_text: | På den här nivån kan du inte bara använda flera rader med `{if}` och `{repeat}`, utan du kan också sätta ihop dem! @@ -3466,13 +3055,6 @@ adventures: {else} {print} 'pizza är bättre' ``` - start_code: |- - {repeat} 3 {times} - mat = {ask} 'Vad vill du äta?' - {if} mat {is} pizza - {print} 'najs!' - {else} - {print} 'pizza är bättre' repeat_command_2: name: '{repeat} 2' default_save_name: kommandot_upprepa_2 @@ -3498,10 +3080,6 @@ adventures: ålder = {ask} 'Hur gammal är du nu?' {repeat} ålder {times} {print} 'Hipp hipp hurra!' ``` - start_code: |- - {repeat} 2 {times} svar = {ask} 'Visste du att du kan ställa en fråga flera gånger?' - {if} svar {is} ja {repeat} 2 {times} {print} 'Det visste du redan!' - {else} {repeat} 3 {times} {print} 'Du har lärt dig något nytt!' 8: story_text: | ### Inuti blocket eller inte? @@ -3519,8 +3097,7 @@ adventures: _ {print} 'The muffin man' _ {print} 'Do you know the muffin man, who lives on Drury Lane?' ``` - start_code: |- - {repeat} 3 {times} + {print} 'Den här raden kommer att upprepas …' {print} 'Den här också …' {print} 'men inte denna!' @@ -3547,7 +3124,6 @@ adventures: Lägg sedan till minst fyra rader kod till restaurangprogrammet. Fråga kunden vad han eller hon vill dricka och fråga om han eller hon vill betala med kontanter eller kort. Fundera till sist ut ett trevligt sätt att säga hejdå till din kund. - start_code: '# skriv din kod här' 2: story_text: | På nivå 2 kan du utöka din restaurang genom att använda variabler. På nivå 1 kunde Hedy bara `{echo}` beställningen en gång och bara komma ihåg det sista som beställdes. @@ -3572,7 +3148,6 @@ adventures: Lägg nu till din egen sammanfattning av den mat och dryck som kunden beställt. **Extra** Nu när du har lärt dig hur man använder variabler kan du använda så många variabler i en rad som du vill. Kan du lägga till fler variabler i din kod, till exempel äta på plats eller take away, kontant eller kort, med eller utan sugrör osv. - start_code: '# skriv din kod här' 3: story_text: | Har du svårt att bestämma vad du vill äta till middag? Du kan låta Hedy välja åt dig! @@ -3600,7 +3175,6 @@ adventures: priser {is} _ _ ``` - start_code: '# skriv din kod här' 4: story_text: | På den här nivån måste du använda citattecken när du använder kommandona `{print}` eller `{ask}`. @@ -3624,7 +3198,6 @@ adventures: {print} Tack för din beställning. {print} Din mat och dryck kommer strax! ``` - start_code: '# skriv din kod här' 5: story_text: | ### Övning @@ -3641,7 +3214,6 @@ adventures: {if} dryck {in} drycker_i_lager {print} 'En' dryck 'på väg!' {else} {print} 'Tyvärr, vi har inte det' ``` - start_code: '# skriv din kod här' 6: story_text: | På den här nivån kan du använda matematik för att beräkna det totala priset på din kunds beställning, vilket kan göra din virtuella restaurang mer realistisk. @@ -3669,7 +3241,6 @@ adventures: {print} 'Det blir ' pris ' dollar, tack' {print} 'Tack, smaklig måltid!' ``` - start_code: '# skriv din kod här' 7: story_text: | På den här nivån har du lärt dig hur du använder kommandot `{repeat}` för att upprepa en kodrad ett visst antal gånger. @@ -3683,7 +3254,6 @@ adventures: {print} 'Välkommen till restaurang Chez Hedy' people = {ask} 'Hur många personer är det i sällskapet?' ``` - start_code: '# skriv din kod här' 8: story_text: | På den här nivån kan du göra din virtuella restaurang mer avancerad genom att upprepa flera kodrader. Till exempel så här: @@ -3702,7 +3272,6 @@ adventures: ### Övning Den här koden kan utökas med fler alternativ på menyn, t.ex. drycker eller flera rätter eller efterrätter. Lägg till minst ett ytterligare alternativ. **Extrauppgift** Lägg till ännu fler artiklar, så många alternativ du vill! - start_code: '# skriv din kod här' 9: story_text: "På den här nivån kan du använda dig av nästlad kod för att göra din restaurang mer realistisk och roligare!\n\n### Övning\nIndragen (mellanslagen) togs bort i exempelkoden. \nKan du räkna ut hur mycket indrag varje rad behöver för att koden ska fungera korrekt?\nOm kunden\ \ beställer pizza ska Hedy inte fråga vilken sås kunden vill ha.\n\n**Extrauppgift** En restaurang har inte alla såser i lager. Gör en lista över tillgängliga såser och ge ett svar vid varje beställning om ni säljer den.
\n**Extrauppgift** Pizzor har en fyllning. Fråga kunderna\ @@ -3729,7 +3298,6 @@ adventures: {print} 'Det blir ' pris ' dollar' {print} 'Smaklig måltid!' ``` - start_code: '# skriv din kod här' 10: story_text: | På den här nivån lär du dig hur du enkelt tar upp beställningar för olika maträtter. @@ -3775,7 +3343,6 @@ adventures: {print} 'Du vill alltså beställa för ' människor ' människor.' {print} 'Då börjar vi!' ``` - start_code: '# skriv din kod här' 12: story_text: | Från och med den här nivån kan du använda decimaltal för att göra menyn mer realistisk. @@ -3797,7 +3364,6 @@ adventures: pris = pris + 2.35 {print} 'Det blir ' pris ' dollar, tack' ``` - start_code: '# skriv din kod här' 13: story_text: | På den här nivån kommer du att lära dig nya kommandon för att utöka din kod ytterligare. @@ -3817,7 +3383,6 @@ adventures: {print} 'Det är ett hälsosamt val' {print} 'Det kostar ' pris ' dollar' ``` - start_code: '# skriv din kod här' 15: story_text: | Med `{while}` kan du göra så att dina kunder kan fortsätta att lägga till beställningar tills de är klara. @@ -3833,7 +3398,6 @@ adventures: mer = {ask} 'Vill du beställa något mer?' {print} 'Tack!' ``` - start_code: '# skriv din kod här' rock: name: Sten, sax, påse default_save_name: Sten_2 @@ -3860,9 +3424,6 @@ adventures: {ask} välj bland _ {echo} så ditt val var: ``` - start_code: | - {print} Välkommen till din egen sten sax påse! - {ask} Vad väljer du? 2: story_text: | På den här nivån kan du öva på att variablerna, så att du kan göra spelet sten, sax, påse på nästa nivå! @@ -3874,7 +3435,6 @@ adventures: val är sten {print} Jag väljer _ ``` - start_code: '# skriv din kod här' 3: story_text: | Du kan använda kommandot `{at} {random}` för att låta datorn välja sten, sax eller påse! @@ -3894,13 +3454,11 @@ adventures: spelare_1 {is} {ask} Namn på spelare 1: _ ``` - start_code: '{print} Välkommen till ditt eget sten, sax, påse!' 4: story_text: | På den här nivån kan vi också programmera sten, sax, påse. Men om du vill lägga till text måste du använda citattecken även här. ### Övning Kopiera din kod från föregående nivå och få den att fungera genom att använda citattecken efter varje `{print}` - eller `{ask}` -kommando. - start_code: '{print} ''Välkommen till ditt eget sten, sax, påse!''' 5: story_text: | På den här nivån kan vi avgöra om det är oavgjort eller inte. För det behöver du det nya nyckelordet `{if}`. @@ -3922,7 +3480,6 @@ adventures: ``` Fyll i rätt kod i tomrummen för att se om det är oavgjort. - start_code: '{print} ''Välkommen till ditt eget sten, sax, påse!''' 9: story_text: "På den här nivån kan du programmera hela spelet sten, sax, påse genom att nästla `{if}` -kommandon. \n\n### Övning\nKan du göra klart koden? Programmet behöver berätta vem som har vunnit för varje kombination.\n\n **Extrauppgift** Vill du spela mer än en omgång? Bygg ut koden\ \ så att du kan spela flera omgångar. Du kan till och med använda en `{ask}` för att fråga användaren hur många rundor hen vill spela.\n" @@ -3942,7 +3499,6 @@ adventures: {print} 'Du förlorade!' # gör klart koden ``` - start_code: '# skriv din kod här' 10: story_text: | ### Övning @@ -3953,7 +3509,6 @@ adventures: spelare = _ {for} _ ``` - start_code: '# skriv din kod här' 13: story_text: | Med kommandot `{and}` kan du förkorta din sten-, sax-, påsekod! Kolla in exempelkoden. @@ -3975,7 +3530,6 @@ adventures: {print} 'Datorn vann!' _ ``` - start_code: '# skriv din kod här' 15: story_text: | ### Övning @@ -3998,7 +3552,6 @@ adventures: vunnit = 'ja' _ ``` - start_code: '# skriv din kod här' rock_2: name: Sten, sax, påse 2 default_save_name: sten_2 @@ -4015,7 +3568,6 @@ adventures: val är _ {print} Jag väljer val ``` - start_code: '# skriv din kod här' secret: name: SuperSpion default_save_name: SuperSpion @@ -4045,7 +3597,6 @@ adventures: b = 'idag kl. 10.00' {print} _ _ _ ``` - start_code: '# ha din kod här' 13: story_text: | Vi kan förenkla superspionkoden med `{and}`, så att vi bara behöver en `{if}`. @@ -4064,7 +3615,6 @@ adventures: {else} {print} 'Åk till tågstationen kl. 10.00'. ``` - start_code: '# ha din kod här' sleep_command: name: '{sleep}' default_save_name: kommandot_sov @@ -4123,7 +3673,6 @@ adventures: {print} 'INGA FLER APOR SOM HOPPAR PÅ SÄNGEN!' {sleep} ``` - start_code: '{print} ''Vi sjunger!''' 7: story_text: | Sånger innehåller ofta många upprepningar. Till exempel ... Baby Shark! Om du sjunger den sjunger du samma sak hela tiden: @@ -4142,7 +3691,6 @@ adventures: {repeat} _ _ {print} 'Baby Shark tututudutudu' {print} 'Baby Shark' ``` - start_code: '{print} ''Baby Shark''' 8: story_text: | I en tidigare nivå har du programmerat låten 'Bottles of beer'. Men utan kommandot `{repeat}` var du tvungen att kopiera verserna många gånger. @@ -4160,7 +3708,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# placera din kod här' 10: story_text: | Med `{for}` kan du skriva ut hela sången om baby shark (inklusive alla andra hajar i familjen) på bara 6 rader! @@ -4177,7 +3724,6 @@ adventures: ``` apor = 5, 4, 3, 2, 1 ``` - start_code: '# placera din kod här' 11: story_text: | På den här nivån kan du använda `{for}` med `{range}` för att göra sånger där du räknar, till exempel fem små apor. @@ -4193,7 +3739,6 @@ adventures: {print} monkeys ' little monkeys jumping on the bed' _ ``` - start_code: '# placera din kod här' 12: story_text: | I den här sången kan vi göra det ännu enklare att programmera 'if you're happy and you know it, clap your hands'. Eftersom vi kan placera alla handlingar i en variabel, kolla in det: @@ -4212,7 +3757,6 @@ adventures: _ {print} handling _ {print} 'om du är riktigt glad' ``` - start_code: '# placera din kod här' 13: 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? @@ -4229,16 +3773,6 @@ adventures: {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: | På den här nivån kan du programmera en sång som OldMacDonald ännu snabbare. Du kan koppla rätt djur till rätt ljud genom att helt enkelt placera dem på samma plats i listan. @@ -4271,7 +3805,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# placera din kod här' 18: story_text: | På nivå 16 gjorde vi låtar med hjälp av listor. De programmen fungerar inte längre korrekt på denna nivå. Kolonen från nivå 17 och parenteserna från nivå 18 behöver fortfarande läggas till. @@ -4293,7 +3826,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# placera din kod här' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4315,15 +3847,6 @@ adventures: {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: Luffarschack default_save_name: Tripp @@ -4359,7 +3882,6 @@ adventures: {else} spelare = 'x' ``` - start_code: '# Skriv din kod här' 14: story_text: | På de tidigare nivåerna har du gjort ett tripp-trapp-trull-spel. Nu har du lärt dig hur du använder =-tecknet, ==-tecknet och !=-tecknet. @@ -4422,7 +3944,6 @@ adventures: {else} tecken = 'x' ``` - start_code: '# ha din kod här' 15: story_text: | På den här nivån kan du förbättra ditt tripp-trapp-trull-spel med {while}-loopen. Med den loopen kan du kombinera `{if} game != 'over'` och `{for} i {in} {range} 1 {to} 9` till bara en kodrad. @@ -4484,7 +4005,6 @@ adventures: {else} tecken = 'x' ``` - start_code: '# ha din kod här' 17: story_text: | På de tidigare nivåerna hade tripp-trapp-trull-spelet en irriterande funktion. Efter varje drag var man tvungen att själv fylla i om man hade vunnit eller inte. @@ -4571,7 +4091,6 @@ adventures: {else}: tecken = 'x' ``` - start_code: '# ha din kod här' turtle: name: Sköldpadda default_save_name: Sköldpadda @@ -4595,9 +4114,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | På den här nivån kan du använda variabler för att göra sköldpaddan interaktiv. Du kan t.ex. fråga spelaren hur många steg sköldpaddan ska ta. @@ -4623,11 +4139,6 @@ adventures: {turn} vinkel {forward} 25 ``` - start_code: |- - {print} Sköldpaddslopp! - vinkel {is} 90 - {turn} vinkel - {forward} 25 3: story_text: | På den här nivån kan du använda `{at} {random}` med sköldpaddan. Ett slumpmässigt val gör att sköldpaddan går en annan väg varje gång. @@ -4640,10 +4151,6 @@ adventures: {turn} vinklar {at} {random} {forward} 25 ``` - start_code: |- - vinklar {is} 10, 50, 90, 150, 250 - {turn} vinklar {at} {random} - {forward} 25 4: story_text: | På nivå 4 måste du använda citattecken med `{print}` och `{ask}`. Även när du ritar! @@ -4670,11 +4177,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Rita figurer' - vinkel {is} 90 - {turn} vinkel - {forward} 25 5: story_text: | På nivå 5 kan du göra ett val med `{if}`, till exempel mellan olika typer av figurer. @@ -4707,12 +4209,6 @@ adventures: {if} riktning {is} höger {turn} _ {forward} 100 ``` - start_code: |- - {print} 'Rita figurer' - figur {is} {ask} 'Vill du ha en kvadrat eller triangel?' - {if} figur {is} triangel vinkel {is} 120 {else} vinkel {is} 90 - {turn} vinkel - {forward} 25 6: story_text: | På den här nivån kan du använda beräkningar för att rita olika figurer. @@ -4736,7 +4232,6 @@ adventures: {forward} 50 {turn} vinkel ``` - start_code: '{print} ''Rita figurer''' 8: story_text: "Nu när vi kan upprepa flera rader kan vi lättare skapa figurer.\n Vi behöver bara ställa in vinkeln en gång och sedan använda den variabeln i `{repeat}`.\n\n### Övning 1\nExempelkoden skapar en kvadrat. Ändra koden så att den skapar en annan figur, till exempel en triangel\ \ eller en sexhörning. \nDetta kräver en ändring av två kodrader.\nTips: En hel cirkel är 360 grader.\n \n### Övning 2\nSkapa nu en ritning som består av minst två polygoner.\n" @@ -4777,7 +4272,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# skriv din kod här' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4795,7 +4289,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4820,16 +4313,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4845,7 +4328,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4856,7 +4338,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4867,7 +4348,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4885,7 +4365,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4904,7 +4383,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4924,7 +4402,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4935,7 +4412,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4948,7 +4424,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4979,7 +4454,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5020,7 +4494,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5043,7 +4516,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5072,7 +4544,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5096,7 +4567,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5124,7 +4594,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5158,7 +4627,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: kommandot_så_länge @@ -5178,11 +4646,6 @@ adventures: svar = {ask} 'Vad är 5 gånger 5?' {print} 'Ett korrekt svar har getts' ``` - start_code: |- - svar = 0 - {while} svar != 25 - svar = {ask} 'Vad är 5 gånger 5?' - {print} 'Ett korrekt svar har getts' years: name: Nyårsdagen default_save_name: Nedräkning till nyår @@ -5200,4 +4663,3 @@ adventures: {print} tal {print} 'Gott nytt år!' ``` - start_code: '# placera din kod här' diff --git a/content/adventures/sw.yaml b/content/adventures/sw.yaml index aebb78b1354..abcecab8433 100644 --- a/content/adventures/sw.yaml +++ b/content/adventures/sw.yaml @@ -22,7 +22,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -48,7 +47,6 @@ adventures: 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: @@ -77,7 +75,6 @@ adventures: 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? @@ -92,7 +89,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -115,7 +111,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -126,7 +121,6 @@ adventures: {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! @@ -144,7 +138,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -163,7 +156,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -180,7 +172,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: | In this level you can use the quotation marks to save multiple words in a variable. @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -241,7 +230,6 @@ adventures: {else} {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -262,7 +250,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -302,13 +289,6 @@ adventures: _ {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 @@ -326,11 +306,6 @@ adventures: {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 @@ -363,10 +338,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -394,11 +365,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -510,7 +476,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -549,7 +514,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -568,7 +532,6 @@ adventures: 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! @@ -585,7 +548,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -601,7 +563,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -611,7 +572,6 @@ adventures: number2 = {ask} 'What is the second number?' answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -628,7 +588,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -653,11 +612,7 @@ adventures: 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 @@ -689,7 +644,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -738,17 +692,6 @@ adventures: 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 @@ -771,12 +714,6 @@ adventures: {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. @@ -796,14 +733,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -825,16 +754,6 @@ adventures: 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 @@ -849,13 +768,6 @@ adventures: {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 @@ -878,17 +790,7 @@ adventures: {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' @@ -915,19 +817,7 @@ adventures: 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: @@ -943,11 +833,6 @@ adventures: 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 @@ -972,10 +857,7 @@ adventures: {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} @@ -1012,19 +894,7 @@ adventures: 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: @@ -1039,11 +909,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1083,26 +948,6 @@ adventures: 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 @@ -1131,27 +976,6 @@ adventures: 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 @@ -1184,31 +1008,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1238,9 +1037,7 @@ adventures: 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?' @@ -1297,36 +1094,6 @@ adventures: 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 @@ -1472,7 +1239,6 @@ adventures: 1: story_text: "##Karibu Hedy! \nKwa hiki kiwango cha kwanza, unaweza kutumia amri `{print}`, `{ask}` na `{echo}`. \nBonyeza kitufe(button) chenye rangi ya kijani kibichi ili kuanza! Jaribu kutekeleza msimbo(mpango) kwa kutumia kitufe chenye rangi ya kijani 'Run the code' kilicho upande\ \ wa kushoto.\n \nUnaweza kupiga chapa maneno iliyatokelezee kwenye kiwambo kwa kutumia amri ya `{print}`. \n" - start_code: '{print} salamudunia!' 2: story_text: '`ask` na `print` mabadiliko katika kiwango cha 3. Hizi mabadiliko, kinamaanisha neno `echo` haitakiwi tena kuchapisha maneno.' example_code: | @@ -1483,7 +1249,6 @@ adventures: ``` story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: print salamu dunia! 3: story_text: |- Kwanzia hii kiwango, unaweza kutumia maneno zifuatao: @@ -1492,7 +1257,6 @@ adventures: majina is Ayubu, Nasra, Novatus print majina at random ``` - start_code: print salamu dunia! 4: story_text: |- Neno `ask` kitatumika kama tulivio itumia katika kiwango cha tatu, ila matumizi ya neno `print` kimebadilika kidogo. @@ -1503,7 +1267,6 @@ adventures: answer is ask 'What do we need to use from now on?' print 'We need to use ' answer ``` - start_code: print 'Salamu, dunia' 5: story_text: '`ask` na `print` zitabaki kama tulivio zitumia kiwango cha tatu. Kiwango cha nne tutasoma jinsi ya kitumia neno `if`.' example_code: | @@ -1511,9 +1274,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - start_code: |- - lugha is ask 'Lugha ya taifi ni kipi?' - if lugha is Kiswahili print 'umepatia!' else print 'umekosea' 6: story_text: Matumizi ya `ask`, `print` na `if` zitabaki kama kawaida. Kwa kiwango cha sita, tuta soma jinsi ya tufanya hesabu. example_code: | @@ -1529,7 +1289,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy ni furaha!' ``` - start_code: repeat 3 times print 'Hedy ni furaha!' 8: story_text: ask na print zinatumika kama tulivio zitumia kwenye kiwango cha sita. Ila matumizi ya if na repeat zimebadilika! Sasa unaweza kutekeleza kikundi cha code kwa pamoja, ila utatakiwa kuweka ujazo(indent). Kinamaanisha utaweka nafasi(space) mara nne ukianza ukiandika kwenye mstari. Utafanya hivyo ataukiandika kikundi(block) cha code ata kama ni mstari moja tu. Kama utatumia if na repeat, utatakiwa ujazo kila kikundi(block) cha code. Rejea mfano zifuatazo kwa maelezo zaid! @@ -1539,10 +1298,6 @@ adventures: {print} 'Hello everyone' {print} 'This is all repeated 5 times' ``` - start_code: |- - repeat 5 times - print 'Jambu!! rafiki' - print 'Hii itachapishwa kwenye skrini mara 5' 9: story_text: | In this level you can not only use multiple lines with `{if}` {and} `{repeat}`, but you can also put them together! @@ -1557,13 +1312,6 @@ adventures: 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' 10: story_text: | In this level we learn a new code called `for`. With `for` you can make a list and use all elements. @@ -1580,18 +1328,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals is 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. 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: |- - for i in range 1 to 10 - print i - print 'Tayari au la, nakuja!' 12: story_text: | 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. @@ -1627,8 +1367,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1640,11 +1379,6 @@ adventures: 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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1678,8 +1412,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' else @@ -1698,11 +1431,6 @@ adventures: 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' 16: story_text: 'Tutatumia mabano ya aina ya [ ] tukitaka kujenga orodha. Sasa tutatakiwa kutumia fungua semi na funga semi ya aina '''' katika orodha(list). ' example_code: | @@ -1726,9 +1454,8 @@ adventures: print i print 'Tayari au la, nakuja!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - naam = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', naam) dice: name: Dice @@ -1756,12 +1483,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1775,7 +1500,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1793,7 +1517,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1805,7 +1528,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1817,7 +1539,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1842,7 +1563,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1868,7 +1588,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1884,7 +1603,6 @@ adventures: {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. @@ -1897,7 +1615,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1930,7 +1647,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1939,7 +1655,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1950,7 +1665,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1998,10 +1712,6 @@ adventures: {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: |- 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. @@ -2013,10 +1723,6 @@ adventures: {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: 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. @@ -2062,7 +1768,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2084,7 +1789,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2105,7 +1809,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2118,7 +1821,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2149,7 +1851,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2172,7 +1873,6 @@ adventures: Can you do it? In the upcoming levels the layout of {repeat} command will change, which enables you to repeat multiple lines at once. - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2189,7 +1889,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2205,7 +1904,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2217,7 +1915,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2257,21 +1954,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2300,13 +1982,6 @@ adventures: {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. @@ -2330,17 +2005,6 @@ adventures: 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 @@ -2369,7 +2033,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2391,7 +2054,6 @@ adventures: _ {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 @@ -2421,7 +2083,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2479,7 +2140,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2495,7 +2155,6 @@ adventures: {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. @@ -2514,7 +2173,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2542,7 +2200,6 @@ adventures: ### Exercise Now it's very hard to win this game, can you make it easier to win? For example by only having 1 wrong door and 2 correct doors instead of 1 correct door en 2 wrong ones? - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2568,7 +2225,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2597,7 +2253,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2631,7 +2286,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2662,18 +2316,7 @@ adventures: {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?' @@ -2712,10 +2355,6 @@ adventures: _ _ _ 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... @@ -2732,11 +2371,6 @@ adventures: {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. @@ -2752,16 +2386,6 @@ adventures: {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 @@ -2790,11 +2414,6 @@ adventures: _ 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 @@ -2820,10 +2439,6 @@ adventures: 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: @@ -2832,8 +2447,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2865,8 +2479,7 @@ adventures: {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} @@ -2899,7 +2512,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2920,7 +2532,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2960,8 +2571,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2987,7 +2597,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -3004,7 +2613,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -3017,7 +2625,6 @@ adventures: {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}`. @@ -3031,7 +2638,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot {if} it says the correct word! @@ -3047,7 +2653,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3066,7 +2671,6 @@ adventures: to_save = price - saved weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3090,7 +2694,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3119,7 +2722,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3132,7 +2734,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3152,7 +2753,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3178,8 +2778,6 @@ adventures: ``` _ 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. @@ -3196,8 +2794,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3229,7 +2826,6 @@ adventures: {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 @@ -3259,10 +2855,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3297,10 +2889,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3334,9 +2922,6 @@ adventures: 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. @@ -3385,11 +2970,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3403,10 +2983,6 @@ adventures: {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! @@ -3421,13 +2997,6 @@ adventures: {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 @@ -3453,10 +3022,6 @@ adventures: 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? @@ -3474,11 +3039,6 @@ adventures: _ {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 @@ -3498,7 +3058,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3518,7 +3077,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3550,7 +3108,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: |- In this level you have to use quotation marks when using the `{print}` command. @@ -3570,7 +3127,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3594,7 +3150,6 @@ adventures: ### Exercise Can you think of more questions to {ask} the customers when they are ordering, and make up different responses to their answers by using the {if} command? - start_code: '# place your code here' 6: 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. @@ -3613,7 +3168,6 @@ adventures: {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. @@ -3632,7 +3186,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3653,7 +3206,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3681,7 +3233,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3723,7 +3274,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3742,7 +3292,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3757,7 +3306,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3772,7 +3320,6 @@ adventures: {print} order more = {ask} 'Would you like to order anything {else}?' {print} 'Thank you!' - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3799,7 +3346,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3808,7 +3354,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3830,12 +3375,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3855,7 +3398,6 @@ 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. Can you finish the code? @@ -3875,7 +3417,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3886,7 +3427,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3904,7 +3444,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3925,7 +3464,6 @@ adventures: {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 @@ -3942,7 +3480,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: language @@ -3966,7 +3503,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3979,7 +3515,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3995,10 +3530,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4032,7 +3563,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -4050,7 +3580,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -4064,7 +3593,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4116,7 +3644,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4131,7 +3658,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4146,7 +3672,6 @@ adventures: {print} '{if} youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4163,16 +3688,6 @@ adventures: {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. @@ -4236,7 +3751,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4258,7 +3772,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4280,15 +3793,6 @@ adventures: {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 @@ -4357,7 +3861,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4420,7 +3923,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4482,7 +3984,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4569,7 +4070,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: turtle @@ -4593,9 +4093,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | In level 1 the turtle could only turn left or right. That is a bit boring! @@ -4623,11 +4120,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: | - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4638,10 +4130,6 @@ adventures: {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! @@ -4668,11 +4156,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: | - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4705,12 +4188,6 @@ adventures: 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. @@ -4734,8 +4211,6 @@ adventures: {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. @@ -4758,8 +4233,6 @@ adventures: {turn} _ {forward} _ ``` - start_code: | - hoeken = {ask} 'How many angles should I draw?' 9: story_text: | Now that we can use a `{repeat}` inside a `{repeat}`, we can create more complex figures. @@ -4779,7 +4252,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4797,7 +4269,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4822,16 +4293,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4847,7 +4308,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4858,7 +4318,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4869,7 +4328,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4887,7 +4345,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4906,7 +4363,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4926,7 +4382,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4937,7 +4392,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4950,7 +4404,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4981,7 +4434,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5022,7 +4474,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5045,7 +4496,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5074,7 +4524,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5098,7 +4547,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5126,7 +4574,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5160,7 +4607,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5180,11 +4626,6 @@ adventures: 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 @@ -5202,4 +4643,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/te.yaml b/content/adventures/te.yaml index bb088d89d5b..8a09151e51b 100644 --- a/content/adventures/te.yaml +++ b/content/adventures/te.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} మీ కథనం ఇక్కడ ప్రారంభమవుతుంది' 2: story_text: | స్థాయి 2లో మీరు మీ కథనాన్ని మరింత సరదాగా చేయవచ్చు. మీ ప్రధాన పాత్ర పేరు ఇప్పుడు వాక్యంలో ఎక్కడైనా ఉండవచ్చు. @@ -47,7 +46,6 @@ adventures: మీ కోడ్‌లోని `{ask}` ఆదేశాలు మరియు `{echo}` ఆదేశాలను మీరు ఈ స్థాయిలో నేర్చుకున్న సరైన ఫారమ్‌కి మార్చండి. **అదనపు** మీ కథనంలో ఉద్రిక్తతను పెంచడానికి మీ కోడ్‌కి `{sleep}` ఆదేశాన్ని జోడించండి. - start_code: '{print} Your story' 3: story_text: | స్థాయి 3లో మీరు మీ కథనాన్ని మరింత సరదాగా చేయవచ్చు. మీరు ఇలాంటి ఏదైనా రాక్షసుడు, జంతువు లేదా ఇతర అడ్డంకి కోసం యాదృచ్ఛికతను ఉపయోగించవచ్చు: @@ -81,7 +79,6 @@ adventures: డంప్ {is} {ask} అతను ఏ వస్తువును డంప్ చేయాలి? {remove} డంప్ {from} బ్యాగ్ ``` - start_code: '{print} Your story' 4: story_text: | మునుపటి స్థాయిలలో ఇంకా సమస్య ఉందని మీరు గమనించి ఉండవచ్చు. మీరు పేరు అనే పదాన్ని కలిగి ఉన్న వాక్యాన్ని ముద్రించడానికి ప్రయత్నించారా? అంటే `{print}` నా పేరు. @@ -130,7 +127,6 @@ adventures: {if} end {is} good {print} name ' takes the sword and the monster quickly runs away' {else} {print} 'The monster eats ' name ``` - start_code: '{print} ''ఇక్కడ మీ కథ ప్రారంభమవుతుంది!''' 7: story_text: | ఒక కథలో, ఎవరైనా చాలాసార్లు మాటలు చెబుతారు. ఉదాహరణకు, ఎవరైనా సహాయం కోసం పిలిచినప్పుడు లేదా పాట పాడినప్పుడు. @@ -145,7 +141,6 @@ adventures: {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! @@ -166,7 +161,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put `{if}`, `{repeat}` or `{for}` commands inside other `{if}`, `{repeat}` or `{for}` commands. This gives you many options and really helps you to make your story interactive. @@ -185,7 +179,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -202,7 +195,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -210,7 +202,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -243,7 +234,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -266,7 +256,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -287,7 +276,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -327,13 +315,6 @@ adventures: _ {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 @@ -351,11 +332,6 @@ adventures: {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 @@ -388,10 +364,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -419,11 +391,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -535,7 +502,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -572,7 +538,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. @@ -593,7 +558,6 @@ adventures: 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! @@ -611,7 +575,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -627,7 +590,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -638,7 +600,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -655,7 +616,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -680,11 +640,7 @@ adventures: 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 @@ -716,7 +672,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -765,17 +720,6 @@ adventures: 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 @@ -798,12 +742,6 @@ adventures: {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. @@ -823,14 +761,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -852,16 +782,6 @@ adventures: 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 @@ -876,13 +796,6 @@ adventures: {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 @@ -905,17 +818,7 @@ adventures: {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' @@ -942,19 +845,7 @@ adventures: 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: @@ -970,11 +861,6 @@ adventures: 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 @@ -999,10 +885,7 @@ adventures: {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} @@ -1039,19 +922,7 @@ adventures: 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: @@ -1066,11 +937,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1110,26 +976,6 @@ adventures: 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 @@ -1158,27 +1004,6 @@ adventures: 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 @@ -1211,31 +1036,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1265,9 +1065,7 @@ adventures: 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?' @@ -1324,36 +1122,6 @@ adventures: 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 @@ -1499,7 +1267,6 @@ adventures: 1: story_text: "In Level 1 you can use the commands `{print}`, `{ask}` and `{echo}`.\n Type your code in the programming field. Or press the green button in the example code block, and the code will be typed for you!\nTry the code yourself with the green 'Run code' button under the programming\ \ field.\n\nYou can print text to the screen using the `{print}` command. \n" - start_code: '{print} hello world!' 2: story_text: | In level 2 we learn two new commands: `{is}` and `{sleep}`. @@ -1514,11 +1281,9 @@ adventures: ``` story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: '{print} hello world!' 3: story_text: | In level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`. - start_code: '{print} hello world!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1534,7 +1299,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Hello world''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1545,9 +1309,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - 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. @@ -1570,7 +1331,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}`, `{else}`, {pressed} and `{repeat}` have changed! @@ -1594,10 +1354,6 @@ adventures: {print} 'INTRUDER!' {print} 'You cannot use this computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1612,13 +1368,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1629,17 +1378,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1649,8 +1391,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1662,11 +1403,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1681,8 +1417,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1701,11 +1436,6 @@ adventures: 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' 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. @@ -1735,9 +1465,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1765,12 +1494,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1784,7 +1511,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1804,7 +1530,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1816,7 +1541,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1829,7 +1553,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1854,7 +1577,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1872,7 +1594,6 @@ adventures: ``` story_text_2: | 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: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1888,7 +1609,6 @@ adventures: {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. @@ -1896,7 +1616,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1929,7 +1648,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1938,7 +1656,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1949,7 +1666,6 @@ adventures: _ day _ days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1997,10 +1713,6 @@ adventures: {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: |- 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. @@ -2012,10 +1724,6 @@ adventures: {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: 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. @@ -2055,7 +1763,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2073,7 +1780,6 @@ adventures: 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. @@ -2098,7 +1804,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2111,7 +1816,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2146,7 +1850,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2158,7 +1861,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2178,7 +1880,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2194,7 +1895,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2206,7 +1906,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2246,21 +1945,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2289,13 +1973,6 @@ adventures: {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. @@ -2319,17 +1996,6 @@ adventures: 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 @@ -2358,7 +2024,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2380,7 +2045,6 @@ adventures: _ {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 @@ -2410,7 +2074,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2457,7 +2120,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2473,7 +2135,6 @@ adventures: {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. @@ -2495,7 +2156,6 @@ adventures: _ _ _ _ {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! @@ -2524,7 +2184,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2553,7 +2212,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2582,7 +2240,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2616,7 +2273,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2647,18 +2303,7 @@ adventures: {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?' @@ -2697,10 +2342,6 @@ adventures: _ _ _ 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... @@ -2717,11 +2358,6 @@ adventures: {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. @@ -2737,16 +2373,6 @@ adventures: {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 @@ -2775,11 +2401,6 @@ adventures: _ 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 @@ -2805,10 +2426,6 @@ adventures: 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: @@ -2817,8 +2434,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2850,8 +2466,7 @@ adventures: {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} @@ -2877,7 +2492,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2898,7 +2512,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2938,8 +2551,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2965,7 +2577,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2982,7 +2593,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2997,7 +2607,6 @@ adventures: {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}`. @@ -3011,7 +2620,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3028,7 +2636,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3049,7 +2656,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3073,7 +2679,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3102,7 +2707,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3115,7 +2719,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3135,7 +2738,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3161,8 +2763,6 @@ adventures: ``` _ 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. @@ -3179,8 +2779,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3212,7 +2811,6 @@ adventures: {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 @@ -3242,10 +2840,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3280,10 +2874,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3317,9 +2907,6 @@ adventures: 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. @@ -3368,11 +2955,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3386,10 +2968,6 @@ adventures: {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! @@ -3404,13 +2982,6 @@ adventures: {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 @@ -3436,10 +3007,6 @@ adventures: 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? @@ -3457,11 +3024,6 @@ adventures: _ {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 @@ -3481,7 +3043,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3498,7 +3059,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3532,7 +3092,6 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - 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. @@ -3552,7 +3111,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3573,7 +3131,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3592,7 +3149,6 @@ adventures: {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. @@ -3607,7 +3163,6 @@ adventures: {repeat} _ {times} food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3625,7 +3180,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3658,7 +3212,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3706,7 +3259,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3728,7 +3280,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3743,7 +3294,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3760,7 +3310,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3787,7 +3336,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3796,7 +3344,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3818,12 +3365,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3843,7 +3388,6 @@ 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. Can you finish the code? @@ -3863,7 +3407,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3875,7 +3418,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3894,7 +3436,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3917,7 +3458,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3934,7 +3474,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3961,7 +3500,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3974,7 +3512,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3990,10 +3527,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4031,7 +3564,6 @@ adventures: 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: @@ -4049,7 +3581,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In this level you can repeat the song 99 times, just by adding one simple line! @@ -4064,7 +3595,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4125,7 +3655,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting, like the 5 little monkeys. @@ -4143,7 +3672,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4162,7 +3690,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4179,16 +3706,6 @@ adventures: {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. @@ -4224,7 +3741,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4246,7 +3762,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4268,15 +3783,6 @@ adventures: {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 @@ -4344,7 +3850,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4407,7 +3912,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4469,7 +3973,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4556,7 +4059,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4580,9 +4082,6 @@ adventures: {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. @@ -4608,11 +4107,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4625,10 +4119,6 @@ adventures: {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! @@ -4655,11 +4145,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4692,12 +4177,6 @@ adventures: 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. @@ -4721,7 +4200,6 @@ adventures: {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. @@ -4764,7 +4242,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4782,7 +4259,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4807,16 +4283,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4832,7 +4298,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4843,7 +4308,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4854,7 +4318,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4872,7 +4335,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4891,7 +4353,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4911,7 +4372,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4922,7 +4382,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4935,7 +4394,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4966,7 +4424,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5007,7 +4464,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5030,7 +4486,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5059,7 +4514,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5083,7 +4537,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5111,7 +4564,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5145,7 +4597,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5165,11 +4616,6 @@ adventures: 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 @@ -5187,4 +4633,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/th.yaml b/content/adventures/th.yaml index 24c7b2e3c44..cf1a91edae1 100644 --- a/content/adventures/th.yaml +++ b/content/adventures/th.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -49,7 +48,6 @@ adventures: 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: @@ -78,7 +76,6 @@ adventures: 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? @@ -93,7 +90,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -116,7 +112,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -127,7 +122,6 @@ adventures: {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! @@ -145,7 +139,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -181,7 +173,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +515,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -569,7 +533,6 @@ adventures: 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! @@ -586,7 +549,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -602,7 +564,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -613,7 +574,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -630,7 +590,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -655,11 +614,7 @@ adventures: 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 @@ -691,7 +646,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -740,17 +694,6 @@ adventures: 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 @@ -773,12 +716,6 @@ adventures: {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. @@ -798,14 +735,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -827,16 +756,6 @@ adventures: 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 @@ -851,13 +770,6 @@ adventures: {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 @@ -880,17 +792,7 @@ adventures: {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' @@ -917,19 +819,7 @@ adventures: 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: @@ -945,11 +835,6 @@ adventures: 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 @@ -974,10 +859,7 @@ adventures: {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} @@ -1014,19 +896,7 @@ adventures: 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: @@ -1041,11 +911,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1085,26 +950,6 @@ adventures: 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 @@ -1133,27 +978,6 @@ adventures: 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 @@ -1186,31 +1010,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1240,9 +1039,7 @@ adventures: 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?' @@ -1299,36 +1096,6 @@ adventures: 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 @@ -1545,7 +1312,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}`, `{else}` and `{repeat}` have changed! @@ -1569,10 +1335,6 @@ adventures: {print} 'INTRUDER!' {print} 'You cannot use this computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1587,13 +1349,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1604,17 +1359,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1624,8 +1372,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1637,11 +1384,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1656,8 +1398,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1676,11 +1417,6 @@ adventures: 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' 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. @@ -1710,9 +1446,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1740,12 +1475,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1759,7 +1492,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1777,7 +1509,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1789,7 +1520,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1801,7 +1531,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1826,7 +1555,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1844,7 +1572,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1860,7 +1587,6 @@ adventures: {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. @@ -1873,7 +1599,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1906,7 +1631,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1915,7 +1639,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1926,7 +1649,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1974,10 +1696,6 @@ adventures: {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: |- 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. @@ -1989,10 +1707,6 @@ adventures: {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: 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. @@ -2032,7 +1746,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2050,7 +1763,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2071,7 +1783,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2084,7 +1795,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2115,7 +1825,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2127,7 +1836,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2144,7 +1852,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2160,7 +1867,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2172,7 +1878,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2212,21 +1917,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2255,13 +1945,6 @@ adventures: {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. @@ -2285,17 +1968,6 @@ adventures: 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 @@ -2324,7 +1996,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2346,7 +2017,6 @@ adventures: _ {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 @@ -2376,7 +2046,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2423,7 +2092,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2439,7 +2107,6 @@ adventures: {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. @@ -2458,7 +2125,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2487,7 +2153,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2513,7 +2178,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2542,7 +2206,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2576,7 +2239,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2607,18 +2269,7 @@ adventures: {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?' @@ -2657,10 +2308,6 @@ adventures: _ _ _ 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... @@ -2677,11 +2324,6 @@ adventures: {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. @@ -2697,16 +2339,6 @@ adventures: {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 @@ -2735,11 +2367,6 @@ adventures: _ 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 @@ -2765,10 +2392,6 @@ adventures: 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: @@ -2777,8 +2400,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2810,8 +2432,7 @@ adventures: {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} @@ -2834,7 +2455,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2855,7 +2475,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2895,8 +2514,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2922,7 +2540,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2939,7 +2556,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2952,7 +2568,6 @@ adventures: {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}`. @@ -2966,7 +2581,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -2982,7 +2596,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3002,7 +2615,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3026,7 +2638,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3055,7 +2666,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3068,7 +2678,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3088,7 +2697,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3114,8 +2722,6 @@ adventures: ``` _ 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. @@ -3132,8 +2738,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3165,7 +2770,6 @@ adventures: {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 @@ -3195,10 +2799,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3233,10 +2833,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3270,9 +2866,6 @@ adventures: 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. @@ -3321,11 +2914,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3339,10 +2927,6 @@ adventures: {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! @@ -3357,13 +2941,6 @@ adventures: {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 @@ -3389,10 +2966,6 @@ adventures: 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? @@ -3410,11 +2983,6 @@ adventures: _ {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 @@ -3434,7 +3002,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3454,7 +3021,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3486,7 +3052,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3506,7 +3071,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3527,7 +3091,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3546,7 +3109,6 @@ adventures: {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. @@ -3558,7 +3120,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3576,7 +3137,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3604,7 +3164,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3649,7 +3208,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3668,7 +3226,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3683,7 +3240,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3700,7 +3256,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3728,7 +3283,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3737,7 +3291,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3759,12 +3312,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3784,7 +3335,6 @@ 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. Can you finish the code? @@ -3804,7 +3354,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3815,7 +3364,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3833,7 +3381,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3855,7 +3402,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3872,7 +3418,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3896,7 +3441,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3909,7 +3453,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3925,10 +3468,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3962,7 +3501,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3980,7 +3518,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3994,7 +3531,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4046,7 +3582,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4061,7 +3596,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4076,7 +3610,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4093,16 +3626,6 @@ adventures: {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. @@ -4138,7 +3661,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4160,7 +3682,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4182,15 +3703,6 @@ adventures: {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 @@ -4258,7 +3770,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4321,7 +3832,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4383,7 +3893,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4470,7 +3979,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4492,9 +4000,6 @@ adventures: {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. @@ -4518,11 +4023,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4533,10 +4033,6 @@ adventures: {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! @@ -4563,11 +4059,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4600,12 +4091,6 @@ adventures: 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. @@ -4629,7 +4114,6 @@ adventures: {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. @@ -4672,7 +4156,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4690,7 +4173,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4715,16 +4197,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4740,7 +4212,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4751,7 +4222,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4762,7 +4232,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4780,7 +4249,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4799,7 +4267,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4819,7 +4286,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4830,7 +4296,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4843,7 +4308,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4874,7 +4338,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4915,7 +4378,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4938,7 +4400,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4967,7 +4428,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4991,7 +4451,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5019,7 +4478,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5053,7 +4511,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5073,11 +4530,6 @@ adventures: 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 @@ -5095,4 +4547,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/tl.yaml b/content/adventures/tl.yaml index ede64cf3dc4..7b846710c6d 100644 --- a/content/adventures/tl.yaml +++ b/content/adventures/tl.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -52,7 +51,6 @@ adventures: 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: @@ -84,7 +82,6 @@ adventures: 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. @@ -99,7 +96,6 @@ adventures: {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. @@ -123,7 +119,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -137,7 +132,6 @@ adventures: {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! @@ -158,7 +152,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put `{if}`, `{repeat}` or `{for}` commands inside other `{if}`, `{repeat}` or `{for}` commands. This gives you many options and really helps you to make your story interactive. @@ -177,7 +170,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -194,7 +186,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -202,7 +193,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -235,7 +225,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -258,7 +247,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -279,7 +267,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -319,13 +306,6 @@ adventures: _ {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 @@ -343,11 +323,6 @@ adventures: {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 @@ -380,10 +355,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -411,11 +382,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -527,7 +493,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -564,7 +529,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. @@ -585,7 +549,6 @@ adventures: 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! @@ -603,7 +566,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -619,7 +581,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -630,7 +591,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -647,7 +607,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -672,11 +631,7 @@ adventures: 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 @@ -708,7 +663,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -757,17 +711,6 @@ adventures: 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 @@ -790,12 +733,6 @@ adventures: {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. @@ -815,14 +752,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -844,16 +773,6 @@ adventures: 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 @@ -868,13 +787,6 @@ adventures: {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 @@ -897,17 +809,7 @@ adventures: {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' @@ -934,19 +836,7 @@ adventures: 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: @@ -962,11 +852,6 @@ adventures: 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 @@ -991,10 +876,7 @@ adventures: {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} @@ -1031,19 +913,7 @@ adventures: 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: @@ -1058,11 +928,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1102,26 +967,6 @@ adventures: 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 @@ -1150,27 +995,6 @@ adventures: 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 @@ -1203,31 +1027,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1257,9 +1056,7 @@ adventures: 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?' @@ -1316,36 +1113,6 @@ adventures: 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 @@ -1491,7 +1258,6 @@ adventures: 1: story_text: "In Level 1 you can use the commands `{print}`, `{ask}` and `{echo}`.\n Type your code in the programming field. Or press the green button in the example code block, and the code will be typed for you!\nTry the code yourself with the green 'Run code' button under the programming\ \ field.\n\nYou can print text to the screen using the `{print}` command. \n" - start_code: '{print} hello world!' 2: story_text: | In level 2 we learn two new commands: `{is}` and `{sleep}`. @@ -1506,11 +1272,9 @@ adventures: ``` story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: '{print} hello world!' 3: story_text: | In level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`. - start_code: '{print} hello world!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1526,7 +1290,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Hello world''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1537,9 +1300,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - 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. @@ -1562,7 +1322,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}`, `{else}` and `{repeat}` have changed! @@ -1586,10 +1345,6 @@ adventures: {print} 'INTRUDER!' {print} 'You cannot use this computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1604,13 +1359,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1621,17 +1369,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1641,8 +1382,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1654,11 +1394,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1673,8 +1408,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1693,11 +1427,6 @@ adventures: 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' 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. @@ -1727,9 +1456,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1757,12 +1485,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1776,7 +1502,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1796,7 +1521,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1808,7 +1532,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1821,7 +1544,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1846,7 +1568,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1864,7 +1585,6 @@ adventures: ``` story_text_2: | 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: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1880,7 +1600,6 @@ adventures: {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. @@ -1888,7 +1607,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1921,7 +1639,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1930,7 +1647,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1941,7 +1657,6 @@ adventures: _ day _ days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1989,10 +1704,6 @@ adventures: {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: |- 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. @@ -2004,10 +1715,6 @@ adventures: {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: 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. @@ -2047,7 +1754,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2065,7 +1771,6 @@ adventures: 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. @@ -2090,7 +1795,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2103,7 +1807,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2138,7 +1841,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2150,7 +1852,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2170,7 +1871,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2186,7 +1886,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2198,7 +1897,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2238,21 +1936,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2281,13 +1964,6 @@ adventures: {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. @@ -2311,17 +1987,6 @@ adventures: 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 @@ -2350,7 +2015,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2372,7 +2036,6 @@ adventures: _ {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 @@ -2402,7 +2065,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2449,7 +2111,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2465,7 +2126,6 @@ adventures: {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. @@ -2487,7 +2147,6 @@ adventures: _ _ _ _ {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! @@ -2516,7 +2175,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2545,7 +2203,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2574,7 +2231,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2608,7 +2264,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2639,18 +2294,7 @@ adventures: {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?' @@ -2689,10 +2333,6 @@ adventures: _ _ _ 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... @@ -2709,11 +2349,6 @@ adventures: {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. @@ -2729,16 +2364,6 @@ adventures: {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 @@ -2767,11 +2392,6 @@ adventures: _ 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 @@ -2797,10 +2417,6 @@ adventures: 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: @@ -2809,8 +2425,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2842,8 +2457,7 @@ adventures: {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} @@ -2869,7 +2483,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2890,7 +2503,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2930,8 +2542,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2957,7 +2568,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2974,7 +2584,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2989,7 +2598,6 @@ adventures: {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}`. @@ -3003,7 +2611,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3020,7 +2627,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3041,7 +2647,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3065,7 +2670,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3094,7 +2698,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3107,7 +2710,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3127,7 +2729,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3153,8 +2754,6 @@ adventures: ``` _ 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. @@ -3171,8 +2770,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3204,7 +2802,6 @@ adventures: {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 @@ -3234,10 +2831,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3272,10 +2865,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3309,9 +2898,6 @@ adventures: 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. @@ -3360,11 +2946,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3378,10 +2959,6 @@ adventures: {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! @@ -3396,13 +2973,6 @@ adventures: {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 @@ -3428,10 +2998,6 @@ adventures: 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? @@ -3449,11 +3015,6 @@ adventures: _ {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 @@ -3473,7 +3034,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3490,7 +3050,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3524,7 +3083,6 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - 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. @@ -3544,7 +3102,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3565,7 +3122,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3584,7 +3140,6 @@ adventures: {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. @@ -3599,7 +3154,6 @@ adventures: {repeat} _ {times} food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3617,7 +3171,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3650,7 +3203,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3698,7 +3250,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3720,7 +3271,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3735,7 +3285,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3752,7 +3301,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3779,7 +3327,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3788,7 +3335,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3810,12 +3356,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3835,7 +3379,6 @@ 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. Can you finish the code? @@ -3855,7 +3398,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3867,7 +3409,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3886,7 +3427,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3909,7 +3449,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3926,7 +3465,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3953,7 +3491,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3966,7 +3503,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3982,10 +3518,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4023,7 +3555,6 @@ adventures: 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: @@ -4041,7 +3572,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In this level you can repeat the song 99 times, just by adding one simple line! @@ -4056,7 +3586,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4117,7 +3646,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting, like the 5 little monkeys. @@ -4135,7 +3663,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4154,7 +3681,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4171,16 +3697,6 @@ adventures: {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. @@ -4216,7 +3732,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4238,7 +3753,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4260,15 +3774,6 @@ adventures: {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 @@ -4336,7 +3841,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4399,7 +3903,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4461,7 +3964,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4548,7 +4050,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4572,9 +4073,6 @@ adventures: {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. @@ -4600,11 +4098,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4617,10 +4110,6 @@ adventures: {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! @@ -4647,11 +4136,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4684,12 +4168,6 @@ adventures: 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. @@ -4713,7 +4191,6 @@ adventures: {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. @@ -4756,7 +4233,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4774,7 +4250,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4799,16 +4274,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4824,7 +4289,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4835,7 +4299,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4846,7 +4309,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4864,7 +4326,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4883,7 +4344,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4903,7 +4363,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4914,7 +4373,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4927,7 +4385,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4958,7 +4415,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4999,7 +4455,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5022,7 +4477,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5051,7 +4505,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5075,7 +4528,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5103,7 +4555,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5137,7 +4588,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5157,11 +4607,6 @@ adventures: 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 @@ -5179,4 +4624,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/tn.yaml b/content/adventures/tn.yaml index 277a06203fc..b1796ac9c90 100644 --- a/content/adventures/tn.yaml +++ b/content/adventures/tn.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -49,7 +48,6 @@ adventures: 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: @@ -78,7 +76,6 @@ adventures: 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? @@ -93,7 +90,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -116,7 +112,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -127,7 +122,6 @@ adventures: {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! @@ -145,7 +139,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -181,7 +173,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +515,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -569,7 +533,6 @@ adventures: 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! @@ -586,7 +549,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -602,7 +564,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -613,7 +574,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -630,7 +590,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -655,11 +614,7 @@ adventures: 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 @@ -691,7 +646,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -740,17 +694,6 @@ adventures: 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 @@ -773,12 +716,6 @@ adventures: {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. @@ -798,14 +735,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -827,16 +756,6 @@ adventures: 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 @@ -851,13 +770,6 @@ adventures: {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 @@ -880,17 +792,7 @@ adventures: {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' @@ -917,19 +819,7 @@ adventures: 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: @@ -945,11 +835,6 @@ adventures: 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 @@ -974,10 +859,7 @@ adventures: {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} @@ -1014,19 +896,7 @@ adventures: 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: @@ -1041,11 +911,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1085,26 +950,6 @@ adventures: 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 @@ -1133,27 +978,6 @@ adventures: 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 @@ -1186,31 +1010,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1240,9 +1039,7 @@ adventures: 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?' @@ -1299,36 +1096,6 @@ adventures: 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 @@ -1478,7 +1245,6 @@ adventures: Lekeletsa code kabowena kago tobetsa botala, fa go kwadilweng 'Run code' kotlase ga tsebe ya programming. O ka gatisa mokwalo mo sekerineng o dirisa molao wa `{print}`. - start_code: '{print} dumela lefatshe!' 2: story_text: | mo legatong la bobedi re ithuta ditaelo tse pedi tse disha: `{is}`. @@ -1493,11 +1259,9 @@ adventures: ``` story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: '{print} Dumela lefatshe!' 3: story_text: | Mo legatong la boraro okadira lenaneo. O ka dira gore computara e kgethe sengwe random mo lenaneong. O dira jalo ka `{at} {random}`. - start_code: '{print} dumela lefatshe!' 4: story_text: | Mo legatong la bone `{ask}` le `{print}` di fetogile. @@ -1513,7 +1277,6 @@ adventures: Karabo {is} {ask} 'Rethoka go dirisa eng gotswa fa goya pele?' {print} 'Re tshwanetse go dirisa ' Karabo ``` - start_code: '{print} ''dumela lefatshe''' 5: story_text: | Mo legatong la botlhano gona le sengwe se sesha, the `{if}`! ka `{if}` oka ikgethela mo ditshwetsong tse pedi tse di farologanyeng. @@ -1524,9 +1287,6 @@ adventures: leina {is} {ask} 'leina la gago ke mang' {if} leina {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - start_code: |- - leina {is} {ask} 'leina la gago ke mang?' - {if} leina {is} Hedy {print} 'cool!' {else} {print} 'meh' 6: story_text: | Mo legatong le, o tla ithuta sengwe se sesha: Gape otlaa dirisa dipalo. @@ -1549,7 +1309,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy e monate!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy e monate!''' 8: story_text: | `{ask}` le `{print}` disantse di bereka jaaka o di itse. mme `{if}`, `{else}` le `{repeat}` di fetogile! @@ -1573,10 +1332,6 @@ adventures: {print} 'Serukuthi!' {print} 'Gao letelelwe go dirisa sebalamakgolo se!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'dumelang betsho' - {print} 'Se se taa gatisiwa ga tlhano' 9: story_text: | Mo legatong le, gao dirise mela e mentsi fela ka `{if}` le `{repeat}`, mme gape oka didirisa tsotlhe gangwefela! @@ -1591,13 +1346,6 @@ adventures: {else} {print} 'pizza e botoka' ``` - start_code: |- - {repeat} 3 {times} - dijo = {ask} 'O batla eng?' - {if} dijo {is} pizza - {print} 'monate!' - {else} - {print} 'pizza e botoka' 10: story_text: |- Mo legatong le re ithuta code e ntsha ee bidiwang `{for}`. ka `{for}` o ka dira lenaneo o bo o dirisa maele otlhe. @@ -1608,17 +1356,10 @@ adventures: {for} phologolo {in} diphologolo {print} 'ke rata' phologolo ``` - start_code: |- - diphologolo {is} ntsa, katse, thapi - {for} phologolo {in} diphologolo - {print} 'ke rata ' phologolo 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: |- - {for} sebala_dipalo {in} {range} 1 {to} 5 - {print} sebala_dipalo 12: story_text: |- **Decimal numbers** @@ -1628,8 +1369,7 @@ adventures: {print} 'Bobedi le sephato oketsa o oketsa ka bobedi le sephato ke...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers jaanong di thoka go dirisa dot' + {print} 2.5 + 2.5 13: story_text: Mo legatong le, retile go ithuta `{and}` le `{or}`! Fa o batla o ka thodumela diele tse pedi, ga o tlhoke go dirisa bo {if} ba babedi, mme o ka dirisa `{and}` le `{kana}`. Fa o ka dirisa `{and}`, diele tsotlhe ka bobedi, molema le moja wa `{and}` di tlhoka go nna boammaaruri. @@ -1641,11 +1381,6 @@ adventures: {if} leina {is} 'Hedy' {and} dingwaga {is} 2 {print} 'ke wena Hedy sa boammaaruri!' ``` - start_code: |- - leina = {ask} 'leina la gago ke mang?' - dingwaga = {ask} 'o dingwaga tse kahe?' - {if} leina {is} 'Hedy' {and} dingwaga {is} 2 - {print} 'ke wena Hedy wa nnete!' 14: story_text: | Re tile go ithuta dikarolo tse dingwe tse disha. O ka nna wa tswa o di itse mo tswa mo dipalong, mo `<` le `>`. @@ -1660,8 +1395,7 @@ adventures: {if} dingwaga > 12 {print} 'o motona mogo nna!' ``` - start_code: |- - dingwaga = {ask} 'O na le dingwaga tse kahe?' + {if} dingwaga < 13 {print} 'o monnye mo go nna!' {else} @@ -1680,11 +1414,6 @@ adventures: karabbo = {ask} '5 a boeletswa ga 5 ke bokae?' {print} 'Karabo ya nnete e filwe' ``` - start_code: |- - karabo = 0 - {while} karabo != 25 - karabo = {ask} '5 a boeletswa ga 5 ke bokahe?' - {print} 'karabo ee siameng e setse e filwe' 16: story_text: |- Re ya go dira dilist jaaka tsa Python ka square brackets go dikologa dilist! Gape re dirisa ditsejwana go dikologa karolo nngwe le nngwe jaaka re ithutile mo dikarolong tse di fetileng. @@ -1711,9 +1440,8 @@ adventures: {print} i {print} 'o ipaakantse kana nnyaa, ke atla!' 18: - story_text: Regorogile mo Python code ya nnete! Se seraya gore retshwanelwa ke go dirira matshwao a parentheses jaaka {print} le {range} gotswa fa go ya pele. - start_code: |- - leina = 'Hedy' + story_text: |- + Regorogile mo Python code ya nnete! Se seraya gore retshwanelwa ke go dirira matshwao a parentheses jaaka {print} le {range} gotswa fa go ya pele. {print}('leina lame ke ', leina) dice: name: Dice @@ -1741,12 +1469,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1760,7 +1486,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1778,7 +1503,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1790,7 +1514,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1802,7 +1525,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1827,7 +1549,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1845,7 +1566,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1861,7 +1581,6 @@ adventures: {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. @@ -1874,7 +1593,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1907,7 +1625,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1916,7 +1633,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1927,7 +1643,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1975,10 +1690,6 @@ adventures: {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: |- 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. @@ -1990,10 +1701,6 @@ adventures: {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: 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. @@ -2033,7 +1740,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2051,7 +1757,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2072,7 +1777,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2085,7 +1789,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2116,7 +1819,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2128,7 +1830,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2145,7 +1846,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2161,7 +1861,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2173,7 +1872,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2213,21 +1911,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2256,13 +1939,6 @@ adventures: {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. @@ -2286,17 +1962,6 @@ adventures: 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 @@ -2325,7 +1990,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2347,7 +2011,6 @@ adventures: _ {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 @@ -2377,7 +2040,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2424,7 +2086,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2440,7 +2101,6 @@ adventures: {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. @@ -2459,7 +2119,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2488,7 +2147,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2514,7 +2172,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2543,7 +2200,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2577,7 +2233,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2608,18 +2263,7 @@ adventures: {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?' @@ -2658,10 +2302,6 @@ adventures: _ _ _ 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... @@ -2678,11 +2318,6 @@ adventures: {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. @@ -2698,16 +2333,6 @@ adventures: {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 @@ -2736,11 +2361,6 @@ adventures: _ 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 @@ -2766,10 +2386,6 @@ adventures: 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: @@ -2778,8 +2394,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2811,8 +2426,7 @@ adventures: {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} @@ -2835,7 +2449,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2856,7 +2469,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2896,8 +2508,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2923,7 +2534,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2940,7 +2550,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2953,7 +2562,6 @@ adventures: {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}`. @@ -2967,7 +2575,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -2983,7 +2590,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3003,7 +2609,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3027,7 +2632,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3056,7 +2660,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3069,7 +2672,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3089,7 +2691,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3115,8 +2716,6 @@ adventures: ``` _ 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. @@ -3133,8 +2732,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3166,7 +2764,6 @@ adventures: {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 @@ -3196,10 +2793,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3234,10 +2827,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3271,9 +2860,6 @@ adventures: 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. @@ -3322,11 +2908,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3340,10 +2921,6 @@ adventures: {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! @@ -3358,13 +2935,6 @@ adventures: {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 @@ -3390,10 +2960,6 @@ adventures: 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? @@ -3411,11 +2977,6 @@ adventures: _ {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 @@ -3435,7 +2996,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3455,7 +3015,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3487,7 +3046,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3507,7 +3065,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3528,7 +3085,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3547,7 +3103,6 @@ adventures: {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. @@ -3559,7 +3114,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3577,7 +3131,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3605,7 +3158,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3650,7 +3202,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3669,7 +3220,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3684,7 +3234,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3701,7 +3250,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3729,7 +3277,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3738,7 +3285,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3760,12 +3306,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3785,7 +3329,6 @@ 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. Can you finish the code? @@ -3805,7 +3348,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3816,7 +3358,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3834,7 +3375,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3856,7 +3396,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3873,7 +3412,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3897,7 +3435,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3910,7 +3447,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3926,10 +3462,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3963,7 +3495,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3981,7 +3512,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3995,7 +3525,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4047,7 +3576,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4062,7 +3590,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4077,7 +3604,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4094,16 +3620,6 @@ adventures: {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. @@ -4139,7 +3655,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4161,7 +3676,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4183,15 +3697,6 @@ adventures: {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 @@ -4259,7 +3764,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4322,7 +3826,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4384,7 +3887,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4471,7 +3973,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4493,9 +3994,6 @@ adventures: {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. @@ -4519,11 +4017,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4534,10 +4027,6 @@ adventures: {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! @@ -4564,11 +4053,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4601,12 +4085,6 @@ adventures: 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. @@ -4630,7 +4108,6 @@ adventures: {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. @@ -4673,7 +4150,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4691,7 +4167,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4716,16 +4191,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4741,7 +4206,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4752,7 +4216,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4763,7 +4226,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4781,7 +4243,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4800,7 +4261,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4820,7 +4280,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4831,7 +4290,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4844,7 +4302,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4875,7 +4332,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4916,7 +4372,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4939,7 +4394,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4968,7 +4422,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4992,7 +4445,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5020,7 +4472,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5054,7 +4505,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5074,11 +4524,6 @@ adventures: 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 @@ -5096,4 +4541,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/tr.yaml b/content/adventures/tr.yaml index 579935df574..cc1dc4e2bb2 100644 --- a/content/adventures/tr.yaml +++ b/content/adventures/tr.yaml @@ -27,7 +27,6 @@ adventures: En az bir tane `{ask}` ve bir tane `{echo}` komutu kullanın. İstediğiniz herhangi bir konu hakkında yapabilirsiniz. Aklınıza bir konu gelmiyorsa, seçeneklerimizden birini kullanın: sinemaya gitmek, bir spor karşılaşması veya hayvanat bahçesinde bir gün. - start_code: '{print} Hikayeniz burada başlıyor' 2: story_text: | Bu 2. seviyede, hikayenizi daha eğlenceli hale getirebilirsiniz. Ana karakterinizin adı artık cümle içinde herhangi bir yerde olabilir. @@ -53,7 +52,6 @@ adventures: Kodunuzdaki `{ask}` komutlarını ve `{echo}` komutlarını bu seviyede öğrendiğiniz doğru şekilleriyle değiştirin. **Ek Görev** Hikayenizde gerilim oluşturmak için kodunuza bir `{sleep}` komutu ekleyin. - start_code: '{print} Sizin hikayeniz' 3: story_text: | 3. seviyede, hikayenizi daha eğlenceli hale getirebilirsiniz. Bunun gibi herhangi bir canavar, hayvan veya diğer engeller için rastgelelik kullanabilirsiniz: @@ -87,7 +85,6 @@ adventures: çıkar {is} {ask} Hangi eşyayı atmalı? {remove} çıkar {from} çanta ``` - start_code: '{print} Sizin hikayeniz' 4: story_text: | Önceki seviyelerde hala bir sorun olduğunu fark etmiş olabilirsiniz. İsim kelimesini içeren bir cümle yazdırmayı denediniz mi? Örneğin: `{print}` benim adım adım dır. @@ -112,7 +109,6 @@ adventures: {print} _ Şunun sesini duyuyor _ hayvanlar {at} {random} {print} isim _ buranın perili bir orman olmasından korkuyor _ ``` - start_code: '{print} ''Hikayeniz buraya yazılacak!''' 5: story_text: | Bu seviyede, hikayenizi daha da eğlenceli hale getirecek farklı sonlar programlayabilirsiniz. @@ -138,7 +134,6 @@ adventures: {if} son {is} iyi {print} isim ' kılıcını çıkarır ve canavar hızla kaçar' {else} {print} isim ' canavar tarafından yendi' ``` - start_code: '{print} ''Hikayeniz burada başlayacak!''' 7: story_text: | Bir hikayede, birileri kelimeleri birkaç kez söyler. Örneğin, birisi yardım istediğinde veya şarkı söylediğinde. @@ -153,7 +148,6 @@ adventures: {repeat} 5 {times} {print} 'Yardım edin!' {print} 'Neden kimse bana yardım etmiyor?' ``` - start_code: '{repeat} 5 {times} {print} ''Yardım edin!''' 8: story_text: | Bu seviyede `{if}` komutlarınızda birden fazla satır kullanabilirsiniz, bu şekilde mutlu veya üzücü sonunuzu güncellemiş olacaksınız! @@ -176,7 +170,6 @@ adventures: {print} 'Olamaz! Ali çok yavaştı ve....' {print} _ ``` - start_code: '# kodunuzu buraya yazın' 9: story_text: | Bu seviyede artık `{if}` ve `{repeat}` komutlarını, diğer `{if}` ve `{repeat}` komutlarının içinde kullanabilirsiniz. @@ -205,7 +198,6 @@ adventures: {else} {print} 'Ayşe eve gider' ``` - start_code: '# kodunuzu buraya yazın' 10: story_text: | Bu seviyede {for} komutunu hikayenizde kullanabilirsiniz. Bu şekilde 'Brown bear, Brown bear, what do you see' adlı çocuk kitabını kolayca programlayabilirsiniz. @@ -214,7 +206,6 @@ adventures: Eğer bilmiyorsanız hikayeye bir göz atın , ve kitapta yazıldığı gibi yazdığınızdan emin olun. (Bunun gibi bir Türkçe kitap biliyorsanız onu da yazabilirsiniz) example_code: "```\nhayvanlar = _ , _ , _ \n{print} 'Brown bear, Brown bear'\n {print} 'What do you see?'\n```\n" - start_code: '# kodunuzu buraya yazın' 12: story_text: |- Bu seviyede, bir değişkene birden fazla kelimeyi kaydetmek için tırnak işaretlerine ihtiyaç duyulacaktır. @@ -227,7 +218,6 @@ adventures: isim = 'İngiltere Kraliçesi' {print} isim ' bir parça kek yiyordu, sonra aniden...' ``` - start_code: '# kodunuzu buraya yazın' 13: story_text: | `{and}` ve `{or}` komutlarını kullanarak hikayelerinizi çok yönlü hale getirebilirsiniz. İki soru sorabilir ve cevapların bir karışımına yanıt verebilirsiniz. @@ -246,7 +236,6 @@ adventures: {if} yol {is} 'sol' {and} silah {is} 'kılıç' _ ``` - start_code: '# kodunuzu buraya yazın' 15: story_text: | `{while}` döngüsünü kullanmak hikayelerinizi daha ilginç hale getirebilir. Örneğin, oyun bitene kadar oynayabilmek için `{while} oyun == 'devam'` kullanabilirsiniz. @@ -269,7 +258,6 @@ adventures: {print} 'Hayır, burada değiller: ' yer {print} 'Şimdi eve girebilirsiniz!' ``` - start_code: '# kodunuzu buraya yazın' 18: story_text: | Başka bir hikaye yazdıracağız, ancak şimdi `{print}` ile parantez kullanmak zorundayız. @@ -290,7 +278,6 @@ adventures: isim = {input}("Senin adın ne?") {print}('Bu hikayeye hoş geldin!') ``` - start_code: '# kodunuzu buraya yazın' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: ekle_çıkar_komutu @@ -330,13 +317,6 @@ adventures: _ {print} Size çeşitler {at} {random} milkshake hazırladık ``` - start_code: |- - hayvanlar {is} köpek, kedi, kanguru - sevilen {is} {ask} En sevdiğin hayvan hangisi? - {add} sevilen {to_list} hayvanlar - sevilmeyen {is} {ask} Hangi hayvanı sevmiyorsun? - {remove} sevilmeyen {from} hayvanlar - {print} Benim seçtiğim bir hayvanlar {at} {random} and_or_command: name: '{and} & {or}' default_save_name: ve veya @@ -354,10 +334,7 @@ adventures: {if} isim {is} 'Hedy' {and} yaş {is} 2 {print} "Sen gerçek Hedy'sin!" ``` - start_code: |- - isim = {ask} 'Adınız nedir?' - yaş = {ask} 'Yaşınız kaç?' - {if} isim {is} 'Hedy' {and} yaş {is} 2 + {print} "Sen gerçek Hedy'sin!" ask_command: name: '{ask}' @@ -389,10 +366,6 @@ adventures: _ Nasılsın? _ ``` - start_code: | - {print} Merhaba! - {ask} Senin adın ne? - {echo} merhaba 2: story_text: | ## sor komutu @@ -420,11 +393,6 @@ adventures: favori_hayvan {is} {ask} En sevdiğin hayvan hangisi? {print} En sevdiğim hayvan favori_hayvan ``` - start_code: |- - isim {is} {ask} Senin adın ne? - {print} Merhaba isim - yaş {is} {ask} Kaç yaşındasın? - {print} name age yaşındadır. 18: story_text: Python kodunu elde etmek için yapmamız gereken son değişiklik `{ask}` ifadesini `{input}` olarak değiştirmektir. example_code: | @@ -536,7 +504,6 @@ adventures: {elif} puanlar > dağıtıcı_puanları {and} puanlar < 21: {print} 'Sen kazandın!' ``` - start_code: '# kodunuzu buraya yazın' calculator: name: Hesap Makinesi default_save_name: Hesap Makinesi @@ -602,7 +569,6 @@ adventures: puan = puan + 1 {print} 'Aferin, iyi işti! Toplam puanın... 10 üzerinden ' puan ``` - start_code: '{print} ''Hesap makinesine hoş geldiniz!''' 10: story_text: | Bu hesap makinesi oyunu, çarpım tablosu alıştırması yapmanıza yardımcı olur! @@ -620,7 +586,6 @@ adventures: {else} {print} 'Bu yanlış. Doğru cevap ' doğrucevap ``` - start_code: '# kodunuzu buraya yazın' 11: story_text: | Bir `{for}` ile çarpım tablosu alıştırma programını basitleştirebilirsiniz. @@ -636,10 +601,6 @@ adventures: {for} i {in} {range} 1 {to} 10 {print} i * sayı ``` - start_code: | - sayı = 10 - {for} i {in} {range} 1 {to} 10 - {print} i * sayı 12: story_text: | Bu seviyede, ondalık sayılar ile çalışan bir hesap makinesi yapabilirsiniz. @@ -658,7 +619,6 @@ adventures: cevap = _ {print} sayı1 ' artı ' sayı2 ' eşittir ' _ ``` - start_code: '# kodunuzu buraya yazın' 13: story_text: | ### Alıştırma 1 @@ -675,7 +635,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Kodunuzu buraya yazın' 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. @@ -700,11 +659,7 @@ adventures: 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 @@ -736,7 +691,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# kodunuzu buraya yazın' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -785,17 +739,6 @@ adventures: {clear} {print} 'SÜRPRİZ!' ``` - start_code: | - {print} '3' - {sleep} - {clear} - {print} '2' - {sleep} - {clear} - {print} '1' - {sleep} - {clear} - {print} 'SÜRPRİZ!' debugging: name: hata ayıklama default_save_name: hata ayıklama @@ -818,12 +761,6 @@ adventures: {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. @@ -843,14 +780,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -872,16 +801,6 @@ adventures: 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 @@ -896,13 +815,6 @@ adventures: {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 @@ -925,17 +837,7 @@ adventures: {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' @@ -962,19 +864,7 @@ adventures: 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: @@ -990,11 +880,6 @@ adventures: 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 @@ -1019,10 +904,7 @@ adventures: {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} @@ -1059,19 +941,7 @@ adventures: 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: @@ -1086,11 +956,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1130,26 +995,6 @@ adventures: 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 @@ -1178,27 +1023,6 @@ adventures: 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 @@ -1231,31 +1055,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1285,9 +1084,7 @@ adventures: 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?' @@ -1344,36 +1141,6 @@ adventures: 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 @@ -1523,7 +1290,6 @@ adventures: Programlama alanının altındaki yeşil 'Kodu çalıştır' düğmesini kullanarak kodu kendiniz deneyin. Hazır mısınız? O zaman ilk komutunuzu öğrenmek için bir sonraki sekmeye gidin! - start_code: '{print} Merhaba Dünya!' 2: story_text: | Tebrikler! Seviye 2'ye ulaştınız. Umarım şimdiden bazı harika kodlar yapmışsınızdır! @@ -1545,14 +1311,12 @@ adventures: Seviye 2'de bu durum değişiyor. Seviye 2'de, birden fazla bilgi parçasını kaydetmenize ve bunları istediğiniz yere yazdırmanıza olanak tanıyan değişkenlerle çalışmayı öğreneceksiniz. O halde hadi bir sonraki sekmeye geçelim! - start_code: '{print} Merhaba Dünya!' 3: story_text: | Bir önceki seviyede değişkenin ne olduğunu ve maceralarınızı daha etkileşimli hale getirmek için nasıl kullanabileceğinizi öğrendiniz. Ancak... değişkenlerle yapabileceğiniz tek şey bu değil! Değişkenleri liste yapmak için de kullanabilirsiniz. Ve hatta Hedy'nin bir listeden rastgele bir kelime seçmesini sağlayabilirsiniz, bu da gerçek oyunlar yapmanıza olanak tanır! Bir sonraki sekmeye hızlıca göz atın! - start_code: '{print} Merhaba Dünya!' 4: story_text: | Önceki seviyelerde değişkenlerle pratik yaptınız, ancak bu problemle karşılaşmış olabilirsiniz. @@ -1572,9 +1336,6 @@ adventures: adım {is} Sophie {print} Benim adım adım ``` - start_code: | - adım {is} Sophie - {print} Benim adım adım 5: story_text: | Önceki seviyelerde, kodu her çalıştırdığınızda oyunlarınızı farklı kılan `{at} {random}` kullanmayı zaten öğrenmiştiniz. @@ -1586,9 +1347,6 @@ adventures: ``` şifre {is} {ask} 'Doğru şifre nedir?' ``` - start_code: |- - isim {is} {ask} 'Senin adın ne?' - {if} isim {is} Hedy {print} 'havalıymış!' {else} {print} 'eh işte' 6: story_text: | Önceki seviyede `{ask}` ve `{if}` ile pratik yaptınız. Örneğin artık konuklara ne yemek istediklerini sorabilirsiniz. @@ -1612,7 +1370,6 @@ adventures: toplam_ücret {is} yemek_ücreti + içecek_ücreti {print} 'Toplamda 'toplam_ücret ' lira ödeyin, lütfen' ``` - start_code: '# kodunuzu buraya yazın' 7: story_text: | Harika bir iş çıkardınız! Bir sonraki seviyeye ulaştınız, bu da `{if}` ve `{else}` ile pratik yaptığınız anlamına geliyor. Muhtemelen kodlarınızın gittikçe uzadığını fark etmişsinizdir. @@ -1626,11 +1383,6 @@ adventures: {print} 'Mutlu yıllar sevgili Hedy' {print} 'mutlu yıllar sana' ``` - start_code: | - {print} 'mutlu yıllar sana' - {print} 'mutlu yıllar sana' - {print} 'mutlu yıllar sevgili Hedy' - {print} 'mutlu yıllar sana' 8: story_text: | Artık tek bir kod satırını nasıl tekrarlayacağınızı öğrendiniz. Bu kullanışlı olabilir, ancak her zaman yeterli değildir. Bazen aynı anda birden fazla satırı tekrarlamak istersiniz. @@ -1639,7 +1391,6 @@ adventures: ``` {repeat} 5 {times} {print} 'Bir sonraki sekmede birden fazla kod satırını aynı anda tekrarlayabilirsiniz!' ``` - start_code: '{print} ''Hadi bir sonraki sekmeye geçelim!''' 9: story_text: | Harika bir iş! Yeni bir seviyeye daha ulaştınız! Bir önceki seviyede {if} veya {repeat} komutunda birden fazla kod satırı kullanmayı öğrendiniz. Ancak henüz ikisini birleştiremiyorsunuz... @@ -1654,7 +1405,6 @@ adventures: {print} 'Yaşasın!' {else} {print} 'Belki de bir önceki seviyede biraz daha pratik yapmalısınız' - start_code: '{print} Bir sonraki sekmeye geçelim!' 10: story_text: | Harika gidiyorsunuz! Önceki seviyelerde hep küçük bir sorunla karşılaştık. Satırları tekrarlamayı öğrendiniz, ama ya satırı biraz değiştirmek isterseniz? @@ -1670,12 +1420,10 @@ adventures: {print} 'eğer mutluysanız ve bunu biliyorsanız ve gerçekten göstermek istiyorsanız' {print} 'eğer mutluysanız ve bunu biliyorsanız ellerinizi çırpın' ``` - start_code: '{print} ''Hadi bir sonraki sekmeye geçelim!''' 11: story_text: | Seviye 11'e ulaştınız, harika gidiyorsunuz! Daha yüksek seviyelerde, Hedy size Python programlama dilini öğretmeye daha fazla odaklanıyor. Python'da `{repeat}` komutu yoktur, ancak {repeat} gibi çalışan bir komut vardır. Python dilinde `{repeat}` komutunun nasıl söylendiğini merak ediyor musunuz? Öğrenmek için hemen devam edin! - start_code: '{print} ''Hadi bir sonraki sekmeye geçelim!''' 12: story_text: | Belki restoran maceranızda ondalık sayıları kullanmayı denemişsinizdir. Eğer denediyseniz, muhtemelen Hedy'nin bunları henüz anlamadığını ve her zaman yuvarladığını fark etmişsinizdir. @@ -1688,7 +1436,6 @@ adventures: print 'Bir hamburger ve içecek sipariş ettiniz' print 'Toplam ' toplam ' lira ödeyin lütfen' ``` - start_code: '{print} ''Hadi bir sonraki sekmeye geçelim!''' 13: story_text: | Önceki seviyelerde iki `{if}` komutunu birbirinin içine nasıl yerleştireceğinizi öğrendiniz. Bu sorunsuz çalışır, ancak size bunun gibi çok uzun ve kullanışsız kodlar verir: @@ -1708,7 +1455,6 @@ adventures: {else} {print} 'Erişim reddedildi!' ``` - start_code: '{print} ''Hadi bir sonraki sekmeye geçelim!''' 14: story_text: | Aşağıdaki program ile okulda bir dersi geçip geçmediğinizi hesaplayabilirsiniz (yani, altı yada daha yüksek bir not). @@ -1725,12 +1471,6 @@ adventures: {else} {print} 'Harika! Bu dersi geçtiniz!' ``` - start_code: | - cevap = {ask} 'Daha fazlasını öğrenmek ister misiniz?' - {if} cevap == 'evet.' - {print} 'Bir sonraki maceraya gidin!' - {if} cevap != 'evet.' - {print} 'Burada biraz daha pratik yapın' 15: story_text: | Aşağıdaki bu oyunda, oyuncunun istediği kadar oynayabilmesini sağlamak için bir kod yapılmıştır... @@ -1748,7 +1488,6 @@ adventures: {if} cevap {is} 'evet' {print} 'Tamamdır, devam ediyoruz.' ``` - start_code: '{print} ''Hadi bir sonraki sekmeye geçelim!''' 16: story_text: | Bu seviyede gerçek Python koduna doğru biraz daha yakınlaşacağız. Ayrıca iki listeyi nasıl eşleştireceğinizi de öğreneceksiniz. @@ -1770,14 +1509,12 @@ adventures: {print} 'Bir ' hayvan ' ses çıkarıyor ' ses ``` Not: Bu kodlar, bu bölümde bu haldeyken çalışmaz. Neresini düzelteceğinizi görmek için sonraki sekmeye gidin. - start_code: '{print} ''Hadi bir sonraki sekmeye geçelim!''' 17: story_text: | Şimdi girintilemeyi biraz değiştireceğiz. Her girintiye ihtiyaç duyduğumuzda, girintiden önceki satırda `:` işaretine ihtiyacımız var. Bu seviyede yeni bir komut da kullanabilirsiniz: `{elif}`. `{elif}` {else} {if}'in kısaltmasıdır ve 3 (veya daha fazla!) seçenek arasından seçim yapmak istediğinizde buna ihtiyacınız vardır. Şuna bir bakın! - start_code: '{print} ''Hadi bir sonraki sekmeye geçelim!''' 18: story_text: | Tebrikler! Hedy'nin son seviyesine ulaştınız! Burada oluşturduğunuz kodu replit veya PyCharm gibi gerçek Python ortamlarına kopyalayabilir ve orada öğrenmeye devam edebilirsiniz! @@ -1809,9 +1546,6 @@ adventures: ``` seçimler {is} _ ``` - start_code: | - seçimler {is} 1, 2, 3, 4, 5, solucan - {print} Attığın zar _ {at} {random} ! 4: story_text: | Bu seviyede, ayrıca zar da oluşturabilirsiniz. Ancak bu sefer örnek bir kod olmadan kendiniz deneyebilirsiniz! @@ -1819,7 +1553,6 @@ adventures: ### Alıştırma Bu seviyede kendi zarınızı yapın. İpucu: Nasıl zar atılacağı hakkında hiçbir fikriniz yoksa. Bir önceki seviyedeki zarlarınıza bir göz atın, ancak tırnak işareti eklemeyi unutmayın. - start_code: '{print} ''Bu sefer zar kaçı gösterecek?''' 5: story_text: | Zarımıza `{if}` ve `{else}` komutlarını ekleyeceğiz! @@ -1835,7 +1568,6 @@ adventures: _ atılan {is} solucan {print} 'Atmayı bırakabilirsin.' _ {print} 'Tekrar atmalısın!' ``` - start_code: '{print} ''Bu sefer zar kaçı gösterecek?''' 6: story_text: | Burada da yine bir Solucan zarı yapabilirsiniz, ancak şimdi kaç puan atıldığını da hesaplayabilirsiniz. @@ -1855,7 +1587,6 @@ adventures: ``` example_code_2: | Sekiz zar için puan hesaplamayı başardınız mı? Bu çok fazla kesme ve yapıştırma gerektiriyordu, değil mi? Seviye 7'de bunu daha kolay hale getireceğiz! - start_code: '{print} ''Bu sefer zar kaçı gösterecek?''' 7: story_text: | Bu seviyede de yine zar atabilirsiniz. `{repeat}` kodu ile kolayca bir el dolusu zar atabilirsiniz. @@ -1867,7 +1598,6 @@ adventures: seçimler = 1, 2, 3, 4, 5, 6 _ _ _ _ _ _ _ ``` - start_code: '{print} ''Bu sefer zar kaçı gösterecek?''' 10: story_text: | ### Alıştırma @@ -1881,7 +1611,6 @@ adventures: {print} oyuncu ' atıyor ve gelen ' seçimler {at} {random} {sleep} ``` - start_code: '# kodunuzu buraya yazın' 15: story_text: | ### Exercise @@ -1906,7 +1635,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# kodunuzu buraya yazın' dishes: name: Bulaşıklar mı? default_save_name: Bulaşıklar @@ -1927,7 +1655,6 @@ adventures: Ardından yapılması gereken bir görev düşünün ve bilgisayarın `{at} {random}` komutuyla görevi kimin yapması gerektiğine karar vermesini sağlayın. **Ek Görev** Bulaşıkları kendiniz yıkamak istemiyor musunuz? Adınızı `{remove}` `{from}` komutuyla listeden kaldırarak programda hile yapın. - start_code: '{print} Bulaşıkları kim yıkıyor?' 4: story_text: | Tırnak işaretleri ile bulaşık yıkama programınızı daha da iyi hale getirebilirsiniz. @@ -1942,7 +1669,6 @@ adventures: {sleep} {print} kişiler {at} _ ``` - start_code: '{print} ''Bulaşıkları kim yıkıyor?''' 5: story_text: | `{if}` ile artık programda seçim yaparak daha fazla eğlenebilirsiniz. Programınızın bilgisayarın yaptığı seçime yanıt vermesini sağlayabilirsiniz. @@ -1956,7 +1682,6 @@ adventures: _ bulaşıkçı {is} Ayşe {print} _ Bulaşıkları yıkamak zorunda olmam çok kötü. _ _ {print} 'Neyse ki bulaşık yok çünkü ' _ ' zaten yıkıyor' ``` - start_code: '{print} ''Bulaşıkları kim yıkıyor?''' 6: story_text: | Herkes bulaşıkları ne sıklıkla yıkayacak? Bu adil mi? Bunu bu seviyede sayabilirsiniz. @@ -1988,7 +1713,6 @@ adventures: {print} 'Salı günü bulaşıkçımız: ' bulaşıkçı {remove} bulaşıkçı {from} kişiler ``` - start_code: '{print} ''Bulaşıkları kim yıkıyor?''' 7: story_text: | `{repeat}` ile kod parçalarını tekrarlayabilirsiniz. Bunu, birden fazla gün boyunca bulaşıkları kimin yıkayacağını hesaplamak için kullanabilirsiniz! @@ -2000,7 +1724,6 @@ adventures: kişiler = anne, baba, Ali, Ayşe {repeat} _ _ {print} 'Bugün bulaşıkçımız ' _ _ _ ``` - start_code: '{print} ''Bulaşıkları kim yıkıyor?''' 10: story_text: | Bu seviyede, kolay bir şekilde tüm hafta için bir program yapabilirsiniz! @@ -2015,11 +1738,6 @@ adventures: {for} gün {in} günler {print} isimler {at} {random} ' bulaşıkları ' gün ' günü yıkayacak' ``` - start_code: | - günler = Pazartesi, Salı, Çarşamba, Perşembe, Cuma, Cumartesi, Pazar - isimler = anne, baba., Emma, Sophie - {for} gün {in} günler - {print} isimler {at} {random} ' bulaşıkları ' gün ' günü yıkayacak' elif_command: name: '{elif}' default_save_name: değileğer @@ -2067,10 +1785,6 @@ adventures: {for} hayvan {in} hayvanlar {print} 'Benim sevdiğim ' hayvan ``` - start_code: |- - hayvanlar {is} köpek, kedi, balık - {for} hayvan {in} hayvanlar - {print} 'Benim sevdiğim ' hayvan 11: story_text: |- Bu seviyede, `{for}` in yeni bir şeklini ekliyoruz. Daha önceki seviyelerde `{for}` i bir liste ile kullanmıştık, ancak `{for}` ni sayılarla da kullanabiliriz. @@ -2083,10 +1797,6 @@ adventures: {print} sayaç {print} 'önüm arkam sağım solum sobe!' ``` - start_code: |- - {for} sayaç {in} {range} 1 {to} 10 - {print} sayaç - {print} 'önüm arkam sağım solum sobe!' 17: story_text: | Şimdi girintilemeyi biraz değiştireceğiz. Girintiye her ihtiyaç duyduğumuzda, girintiden önceki satırda `:` işaretine ihtiyacımız var. @@ -2125,7 +1835,6 @@ adventures: ### Alıştırma Örnek kodu girdi ekranınıza kopyalayın ve kodun çalışması için boşlukları doldurun. **Ek Görev** Kodu değiştirin ve falcının yalnızca adınızı değil, yaşınızı, tuttuğunuz spor takımını veya kendinizle ilgili başka bir şeyi de tahmin etmesini sağlayın. - start_code: '# kodunuzu buraya yazın' 3: story_text: | Önceki seviyelerde ilk fal makinenizi yapmıştınız, ancak Hedy gerçekten hiçbir şey tahmin edemedi, sadece `{echo}` kullandı. @@ -2143,7 +1852,6 @@ adventures: story_text_2: | ### Alıştırma Şimdilik, Hedy sadece evet, hayır veya belki cevaplarını verebiliyor. Hedy'ye 'kesinlikle' veya 'tekrar sor' gibi daha fazla cevap seçeneği verebilir misiniz? - start_code: '# kodunuzu buraya yazın' 4: story_text: | Bu seviyede yeni bir işlev yok, ancak tırnak işaretlerini kullanarak pratik yapmanızı sağlar. @@ -2168,7 +1876,6 @@ adventures: {sleep} 2 {print} cevaplar {at} {random} ``` - start_code: '# kodunuzu buraya yazın' 5: story_text: | ### Alıştırma @@ -2192,7 +1899,6 @@ adventures: {if} kişi {in} arkadaşlar {print} iyi_cevap {at} {random} {else} {print} kötü_cevap {at} {random} ``` - start_code: '# kodunuzu buraya yazın' 6: story_text: | Bu seviyede artık bir falcı olarak tahminlerinizde matematiği kullanabilirsiniz. Bu, geleceği hesaplamak için (aptalca) formüller oluşturmanıza olanak tanır. @@ -2215,7 +1921,6 @@ adventures: {sleep} {print} çocuklar ' çocuğun olacak!' ``` - start_code: '# kodunuzu buraya yazın' 7: story_text: | ### Alıştırma @@ -2228,7 +1933,6 @@ adventures: seçenekler = seni seviyor, seni sevmiyor _ _ _ _ seçenekler {at} {random} ``` - start_code: '# kodunuzu buraya yazın' 8: story_text: | Bir sonraki örnekte, falcınızın birden fazla soru sormasını ve bunları yazdırmasını sağlayabilirsiniz! @@ -2246,7 +1950,6 @@ adventures: {sleep} {print} 'Kristal kürem diyor ki... ' cevaplar {at} {random} ``` - start_code: '# kodunuzu buraya yazın' 10: story_text: | Bu seviyede MASH (konak, apartman, kulübe, ev) oyununu nasıl programlayacağınızı öğreneceksiniz. Bu oyunda tüm oyuncular için aynı anda geleceklerinin neye benzeyeceğini tahmin edebilirsiniz. @@ -2265,7 +1968,6 @@ adventures: {print} isim ' evcil hayvan olarak ' pets {at} {random} ' besleyecek.' {sleep} ``` - start_code: '# kodunuzu buraya yazın' 12: story_text: |- 12. seviyeden itibaren artık, listelerde her öğeden önce ve sonra tırnak işareti kullanmanız gerekecektir. @@ -2280,7 +1982,6 @@ adventures: {sleep} {print} fallar {at} {random} ``` - start_code: '# kodunuzu buraya yazın' functions: name: functions default_save_name: functions @@ -2320,21 +2021,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2363,13 +2049,6 @@ adventures: {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. @@ -2393,17 +2072,6 @@ adventures: 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 @@ -2432,7 +2100,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2454,7 +2121,6 @@ adventures: _ {print} isim ' şu konuda çok iyi: ' konular {at} {random} _ {print} isim ' en çok şundan korkuyor: ' korkular {at} {random} ``` - start_code: '# kodunuzu buraya yazın' haunted: name: Perili Ev default_save_name: Perili Ev @@ -2486,7 +2152,6 @@ adventures: Sarı düğmeye tıklayarak örnek kodu girdi ekranınıza kopyalayın. Şimdi en az 5 satır kod ekleyerek hikayeyi bitirin. Her kod satırına `{print}` komutuyla başlamayı unutmayın. - start_code: '{print} Buraya nasıl geldim?' 2: story_text: | Bu perili evde canavarlarınızı emojilerle seçebilirsiniz. Tabii ki yine kelimeleri de kullanabilirsiniz. @@ -2541,7 +2206,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# kodunuzu buraya yazın' 4: story_text: | Bu seviyede oyunlarınızda tırnak işaretlerini nasıl kullanacağınızı öğreneceksiniz. @@ -2563,7 +2227,6 @@ adventures: {sleep} {print} canavarlar {at} {random} ``` - start_code: '# kodunuzu buraya yazın' 5: story_text: | Bu seviyeye kadar perili ev oyunu her zaman oyuncudan bir kapı seçmesini istedi, ancak fark etmiş olabileceğiniz gibi, gerçekten doğru cevap vermek zorunda değillerdi. @@ -2585,7 +2248,6 @@ adventures: _ _ _ _ {print} 'Harika! Kaçmayı başardınız!' {else} {print} 'Olamaz! Bir ' canavarlar {at} {random} ' sizi yedi!' ``` - start_code: '# kodunuzu buraya yazın' 9: story_text: | Bu seviyede, perili evi daha da etkileşimli hale getirmenize olanak tanıyan iç içe geçirme özelliğini kullanabilirsiniz! @@ -2616,7 +2278,6 @@ adventures: {if} oyuncu {is} canlı {print} 'Harika! Hayatta kaldınız!' ``` - start_code: '{print} ''Perili evden kaçış!''' 11: story_text: | Bu seviyede, `{for}` komutunu değiştirdik, böylece oyuncuya nerede olduklarını söyleyebiliyoruz. @@ -2640,7 +2301,6 @@ adventures: {print} 'Oda ' i canavar = canavarlar {at} {random} ``` - start_code: '{print} ''Perili evden kaçış!''' 14: story_text: | ### Exercise @@ -2669,7 +2329,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2703,7 +2362,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2734,18 +2392,7 @@ adventures: {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?' @@ -2784,10 +2431,6 @@ adventures: _ _ _ 4 _ 'Harikasın!' _ _ 'Hayır, 2 + 2 = 4' ``` - start_code: |- - isim {is} {ask} 'senin adın ne?' - {if} isim {is} Hedy {print} 'güzel' - {else} {print} 'böö!' 8: story_text: | ## eğer... değilse... @@ -2804,11 +2447,6 @@ adventures: {print} 'Hoşgeldin Hedy' {print} 'Bilgisayarında oynayabilirsin!' ``` - start_code: | - isim = {ask} 'Senin adın ne?' - {if} isim {is} Hedy - {print} 'Hoşgeldin Hedy' - {print} 'Bilgisayarında oynayabilirsin!' 9: story_text: | Bu seviyede bir {if} komutunu başka bir {if} komutunun içine de koyabilirsiniz. @@ -2822,16 +2460,6 @@ adventures: {print} 'Emin değilsin' {else} {print} 'Devam etmek istemiyorsun' - start_code: | - devam = {ask} 'Devam etmek istiyor musun?' - {if} devam = evet - emin = {ask} 'Emin misin?' - {if} emin {is} evet - {print} 'Devam edeceğiz' - {else} - {print} 'Emin değilsin' - {else} - {print} 'Devam etmek istemiyorsun' in_command: name: '{in}' default_save_name: içinde_komutu @@ -2860,11 +2488,6 @@ adventures: _ cevap _ hayvanlar _ 'Benimki de öyle!' _ _ 'En sevdiğim hayvanlar köpekler, inekler ve koyunlar' ``` - start_code: |- - güzel_renkler {is} yeşil, sarı - favori_renk {is} {ask} 'En sevdiğin renk nedir?' - {if} favori_renk {in} güzel_renkler {print} 'güzel!' - {else} {print} 'eh işte' is_command: name: '{is}' default_save_name: eşit_komutu @@ -2890,10 +2513,6 @@ adventures: favori_hayvan {is} _ {print} En sevdiğim havyan favori_hayvan ``` - start_code: |- - isim {is} Hedy - yaş {is} 15 - {print} name age yaşındadır 6: story_text: | Bir kelimeyi bir değişkende saklama konusunda da bir değişiklik yapıyoruz! Artık bir değişkende bir isim veya sayı sakladığımızda `{is}` yerine `=` kullanabilirsiniz, bunun gibi: @@ -2902,8 +2521,7 @@ adventures: isim = Hedy cevap = 20 + 4 ``` - start_code: | - isim = Hedy + cevap = 20 + 4 14: story_text: | @@ -2935,8 +2553,7 @@ adventures: {if} isim != 'Hedy' {print} 'Sen Hedy değilsin.' ``` - start_code: |- - yaş = {ask} 'Kaç yaşındasın?' + {if} yaş < 13 {print} 'Sen benden daha gençsin!' {else} @@ -2963,7 +2580,6 @@ adventures: {if} kurbağa {is} grenouille {print} 'Süper!' {else} {print} 'Hayır, kurbağanın karşılığı grenouille' ``` - start_code: '# kodunuzu buraya yazın' 16: story_text: | ### Exercise @@ -2984,7 +2600,6 @@ adventures: {print} 'Yanlış, ' fransızca_kelimeler[i] ' kelimesi ' çevirisi[i] ' anlamına geliyor' {print} 'Toplam ' puan ' doğru cevap verdin.' ``` - start_code: '# kodunuzu buraya yazın' maths: name: matematik default_save_name: matematik @@ -3029,8 +2644,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'ondalık sayıların artık bir nokta kullanması gerekiyor' + {print} 2.5 + 2.5 parrot: name: Papağan @@ -3058,11 +2672,6 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print} Ben papağan Hedy. - {ask} Adın ne senin? - {echo} - {echo} 2: story_text: | Bir önceki seviyede, sizden sonra tekrar eden bir papağan yapmıştınız. Bu seviyede papağanı bir değişken ve `{ask}` komutu kullanarak etkileşimli hale getireceğiz. @@ -3083,7 +2692,6 @@ adventures: Ardından papağanın bir süre sessiz kalmasını sağlamak için 4. ve 6. satırlara `{sleep}` komutunu girin. **Ek Görev** Daha fazla kod satırı ekleyerek papağanın sadece adınızdan daha fazlasını sormasını sağlayabilir misiniz? - start_code: '{print} Ben papağan Hedy!' 3: story_text: | Papağanınıza `{add}` ile yeni bir kelime öğretin. @@ -3098,7 +2706,6 @@ adventures: {print} 🧒 hadi yeni_kelime de, Hedy! {print} 🦜 kelimeler {at} {random} ``` - start_code: '# kodunuzu buraya yazın' 4: story_text: | Bu seviyede `{ask}` ve `{print}` komutları ile tırnak işaretlerini kullanmamız gerekiyor. @@ -3113,7 +2720,6 @@ adventures: {print} _ 🧒 Hadi _ new_word _ de, Hedy!_ {print} _ 🦜 _ kelimeler {at} {random} ``` - start_code: '# Kodunuzu buraya yazın' 5: story_text: | Doğru kelimeyi söylerse papağanınızı ödüllendirin! @@ -3132,7 +2738,6 @@ adventures: _ dediği_kelime {is} yeni_kelime _ '🧒 Aferin, Hedy! 🍪' _ _ '🧒 Hayır, Hedy! ' yeni_kelime ' de!' ``` - start_code: '# kodunuzu buraya yazın' piggybank: name: Kumbara default_save_name: Kumbara @@ -3156,7 +2761,6 @@ adventures: haftalar = birikmesi_gereken / haftalık {print} 'Yeni bir ' _ ' almak için ' _ ' hafta biriktirmek gerekiyor.' ``` - start_code: '# kodunuzu buraya yazın' 14: story_text: | ### Exercise @@ -3180,7 +2784,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Tuşa basma default_save_name: Basılı @@ -3209,7 +2812,6 @@ adventures: {if} i {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# kodunuzu buraya yazın' 7: story_text: | Artık `{repeat}` hakkında bilgi sahibi olduğunuza göre, tuşlara birden çok kez basabiliriz. @@ -3222,7 +2824,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# kodunuzu buraya yazın' 9: story_text: | Artık ifadeleri nasıl birleştireceğinizi bildiğinize göre, `{pressed}` ile dokunma-türü bir araç oluşturabilirsiniz. @@ -3242,7 +2843,6 @@ adventures: _ _ ``` - start_code: '# kodunuzu buraya yazın' print_command: name: '{print}' default_save_name: yazdır @@ -3268,8 +2868,6 @@ adventures: ``` _ Merhaba! ``` - start_code: | - {print} Hedy'ye hoş geldin! 18: story_text: |- Gerçek Python koduna ulaştık! Yani bu, bundan sonra `{print}` ve `{range}` ile beraber artık bir de parantez kullanmamız gerektiği anlamına geliyor. @@ -3286,8 +2884,7 @@ adventures: sıcaklık = 25 {print}('Hava dışarıda ', sıcaklık, ' derece') ``` - start_code: |- - isim = 'Hedy' + {print}('Benim adım ', isim) quizmaster: name: Kısa sınav ustası @@ -3318,7 +2915,6 @@ adventures: {if} puanlar_b > puanlar_a {print} 'Sen B kulübüne aitsin.' ``` - start_code: '# kodunuzu buraya yazın' quotation_marks: name: '''tırnak işaretleri''' default_save_name: quotation_marks @@ -3348,10 +2944,6 @@ adventures: {print} 'Ayşe'nin çocuklarına bakıyorum.' {print} 'Çocuklarla oyun'dan daha eğlenceli ne olabilir ki?' ``` - start_code: |- - {print} 'Şu andan itibaren tırnak işareti kullanmanız gerekiyor!' - cevap {is} {ask} 'Bundan sonra ne kullanmamız gerekiyor?' - {print} 'Bundan sonra ' cevap ' kullanmamız gerekiyor' 12: story_text: | **Tüm metinlerin tırnak içinde olması gerekir** @@ -3386,10 +2978,6 @@ adventures: puan = 25 {print} 'Puanın ' puan ``` - start_code: |- - isim = {ask} 'Senin adın ne?' - {if} isim = 'Robot Hedy' - {print} 'Merhaba!' random_command: name: '{random}' default_save_name: restgele_komutu @@ -3423,9 +3011,6 @@ adventures: ödüller {is} _ _ ``` - start_code: | - hayvanlar {is} köpek, kedi, kanguru - {print} hayvanlar {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. @@ -3475,11 +3060,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy çok eğlenceli!' ``` - start_code: | - {print} 'mutlu yıllar sana' - {print} 'mutlu yıllar sana' - {print} 'Mutlu yıllar sevgili Hedy' - {print} 'mutlu yıllar sana' 8: story_text: | ### Tekrarla komutları ve girinti @@ -3493,10 +3073,6 @@ adventures: {print} 'Herkese merhaba' {print} 'Bunların hepsi 5 kez tekrarlanır' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Herkese merhaba' - {print} 'Bu 5 kez yazdırılacaktır' 9: story_text: | Bu seviyede sadece `{if}` ve `{repeat}` ile birden fazla satır kullanmakla kalmaz, aynı zamanda bunları bir araya da getirebilirsiniz! @@ -3511,13 +3087,6 @@ adventures: {else} {print} 'pizza daha iyi olur' ``` - start_code: |- - {repeat} 3 {times} - yemek = {ask} 'Ne yemek istiyorsun?' - {if} yemek {is} pizza - {print} 'güzel!' - {else} - {print} 'pizza daha iyi olur' repeat_command_2: name: '{repeat} 2' default_save_name: tekrarla_komutu_2 @@ -3543,10 +3112,6 @@ adventures: yaş = {ask} 'Şimdi kaç yaşındasın?' {repeat} yaş {times} {print} 'Hey Çok Yaşa!' ``` - start_code: |- - {repeat} 2 {times} cevap = {ask} 'Bir soruyu birden fazla kez sorabileceğinizi biliyor muydunuz?' - {if} cevap {is} evet {repeat} 2 {times} {print} 'Demek bunu zaten biliyordunuz' - {else} {repeat} 3 {times} {print} 'Artık yeni bir şey öğrendiniz!' 8: story_text: | ### blok mu değil mi? @@ -3564,11 +3129,6 @@ adventures: _ {print} 'çörek adamı' _ {print} 'kim tanır çörek adamı, nerede yaşıyor?' ``` - start_code: |- - {repeat} 3 {times} - {print} 'Bu satır tekrarlanacaktır...' - {print} 'Bu da öyle...' - {print} 'ama bu değil!' restaurant: name: Restoran default_save_name: Restoran @@ -3592,7 +3152,6 @@ adventures: Ardından restoran programına en az 4 satır kod daha ekleyin. Müşteriye ne içmek istediklerini sorun ve nakit mi yoksa kartla mı ödeme yapmak istediklerini sorun. Son olarak, müşterinize veda etmek için güzel bir yol düşünün. - start_code: '# kodunuzu buraya yazın' 2: story_text: | Seviye 2'de, değişkenler kullanarak restoranınızı genişletebilirsiniz. Seviye 1'de Hedy siparişi sadece bir kez `{echo}` yapabiliyordu ve sadece en son sipariş edilen şeyi hatırlayabiliyordu. @@ -3617,7 +3176,6 @@ adventures: Şimdi müşteriniz tarafından sipariş edilen yiyecek ve içeceklerin özetini kendiniz ekleyin. **Ek Görev** Artık değişkenleri nasıl kullanacağınızı öğrendiğinize göre, bir satırda istediğiniz kadar değişken kullanabilirsiniz. Kodunuza daha fazla değişken ekleyebilir misiniz, örneğin masada yemek ya da paket servis, nakit ya da kart, pipetli ya da pipetsiz gibi. - start_code: '# kodunuzu buraya yazın' 3: story_text: | Akşam yemeğinde ne yemek istediğinize karar vermekte zorlanıyor musunuz? Hedy'nin sizin için seçmesini sağlayabilirsiniz! @@ -3645,7 +3203,6 @@ adventures: fiyatlar {is} _ _ ``` - start_code: '# kodunuzu buraya yazın' 4: story_text: | Bu seviyede, `{print}` veya `{ask}` komutunu kullanırken artık tırnak işareti kullanmanız gerekiyor. @@ -3669,7 +3226,6 @@ adventures: {print} Siparişiniz için teşekkür ederiz. {print} yemek ve içecek hemen hazır olacak! ``` - start_code: '# kodunuzu buraya yazın' 5: story_text: | ### Alıştırma @@ -3686,7 +3242,6 @@ adventures: {if} içecek {in} depodaki_içecekler {print} 'Bir ' içecek ' hemen geliyor!' {else} {print} 'Üzgünüm, ondan satmıyoruz' ``` - start_code: '# kodunuzu buraya yazın' 6: story_text: | Bu seviyede, müşterinizin siparişinin toplam fiyatını hesaplamak için matematiği kullanabilirsiniz, bu da sanal restoranınızı daha gerçekçi hale getirecektir. @@ -3714,7 +3269,6 @@ adventures: {print} 'Ücret toplamı ' fiyat ' lira, lütfen' {print} 'Teşekkürler, afiyet olsun!' ``` - start_code: '# kodunuzu buraya yazın' 7: story_text: | Bu seviyede, bir kod satırını belirli sayıda tekrarlamak için `{repeat}` komutunu nasıl kullanacağınızı öğrendiniz. @@ -3728,7 +3282,6 @@ adventures: {print} "Restaurant Chez Hedy'ye Hoş Geldiniz" kişiler = {ask} 'Bugün bize kaç kişi katılıyor?' ``` - start_code: '# kodunuzu buraya yazın' 8: story_text: | Bu seviyede, birden fazla kod satırını tekrarlayarak sanal restoranınızı daha ayrıntılı hale getirebilirsiniz. Bunun gibi: @@ -3747,7 +3300,6 @@ adventures: ### Alıştırma Bu kod, menüde daha fazla öğe eklenerek genişletilebilir, örneğin içecekler ve/veya birden fazla yemek veya tatlı sunulabilir. En az bir öğe daha ekleyin. **Ek Görev** Daha da fazla ürün ekleyin, istediğiniz kadar seçenek olsun! - start_code: '# kodunuzu buraya yazın' 9: story_text: | Bu seviyede restoranınızı daha gerçekçi ve daha eğlenceli hale getirmek için iç içe geçmeyi kullanabilirsiniz! @@ -3782,7 +3334,6 @@ adventures: {print} 'Toplam ücret ' price ' lira' {print} 'Afiyet olsun!' ``` - start_code: '# kodunuzu buraya yazın' 10: story_text: | Bu seviyede, farklı çeşitler için nasıl kolayca sipariş vereceğinizi öğreneceksiniz. @@ -3821,7 +3372,6 @@ adventures: {print} 'Demek ' kişiler ' kişi için sipariş vermek istiyorsunuz' {print} 'Tamam, başlayalım!' ``` - start_code: '# kodunuzu buraya yazın' 12: story_text: | Bu seviyeden itibaren menünüzü daha gerçekçi hale getirmek için ondalık sayıları kullanabilirsiniz. @@ -3843,7 +3393,6 @@ adventures: fiyat = fiyat + 2.35 {print} 'Toplam ' fiyat ' lira, lütfen' ``` - start_code: '# kodunuzu buraya yazın' 13: story_text: | Bu seviyede kodunuzu daha da genişletmek için yeni komutlar öğreneceksiniz. @@ -3867,7 +3416,6 @@ adventures: {print} 'Bu sağlıklı bir seçim' {print} 'Toplam ' ücret ' lira ediyor' ``` - start_code: '# kodunuzu buraya yazın' 15: story_text: | `{while}` ile müşterilerinizin istekleri bitene kadar sipariş eklemeye devam edebilmelerini sağlayabilirsiniz. @@ -3883,7 +3431,6 @@ adventures: dahafazla = {ask} 'Başka bir şey sipariş etmek ister misiniz?' {print} 'Teşekkür ederiz!' ``` - start_code: '# kodunuzu buraya yazın' rock: name: Taş, kağıt, makas default_save_name: Rock_2 @@ -3910,9 +3457,6 @@ adventures: {ask} Bunlardan birini seçin _ {echo} Demek senin seçimin: ``` - start_code: | - {print} Kendi taş kağıt makasınıza hoş geldiniz! - {ask} Neyi seçeceksiniz? 2: story_text: | Bu seviyede değişkenleri kullanarak pratik yapabilir, böylece taş, kağıt, makas oyununuzu yeni bir seviyeye taşımız olursunuz! @@ -3924,7 +3468,6 @@ adventures: seçim {is} taş {print} Benim seçimim _ ``` - start_code: '# kodunuzu buraya yazın' 3: story_text: | Bilgisayarın taş, kağıt veya makas seçmesini sağlamak için `{at} {random}` komutunu kullanabilirsiniz! @@ -3944,13 +3487,11 @@ adventures: oyuncu_1 {is} {ask} 1 numaralı oyuncunun adı: _ ``` - start_code: '{print} Kendi taş kağıt makasınıza hoş geldiniz!' 4: story_text: | Bu seviyede, taş, kağıt, makas programını daha da geliştirebiliriz. Ancak metin eklemek istiyorsanız, burada da tırnak işareti kullanmanız gerekir. ### Alıştırma Kodunuzu önceki seviyeden kopyalayın ve her `{print}` veya `{ask}` komutundan sonra tırnak işareti kullanarak çalışmasını sağlayın. - start_code: '{print} ''Kendi taş kağıt makasınıza hoş geldiniz!''' 5: story_text: | Bu seviyede beraberlik olup olmadığını belirleyebiliriz. Bunun için yeni `{if}` koduna ihtiyacınız var. @@ -3972,7 +3513,6 @@ adventures: ``` Beraberlik olup olmadığını görmek için boşluklara doğru kodu girin. - start_code: '{print} ''Kendi taş kağıt makasınıza hoş geldiniz!''' 9: story_text: | Bu seviyede `{if}` komutlarını iç içe geçirerek tüm taş, kağıt, makas oyununu programlayabilirsiniz. @@ -3997,7 +3537,6 @@ adventures: {print} 'Kaybettin!' # bu kodu tamamlayın ``` - start_code: '# kodunuzu buraya yazın' 10: story_text: | ### Alıştırma @@ -4008,7 +3547,6 @@ adventures: oyuncular = _ {for} _ ``` - start_code: '# kodunuzu buraya yazın' 13: story_text: | `{and}` komutu ile taş, kağıt, makas kodunuzu kısaltabilirsiniz! Örnek koda göz atın. @@ -4030,7 +3568,6 @@ adventures: {print} 'Bilgisayar kazandı!' _ ``` - start_code: '# kodunuzu buraya yazın' 15: story_text: | ### Alıştırma @@ -4053,7 +3590,6 @@ adventures: kazandı = 'evet' _ ``` - start_code: '# kodunuzu buraya yazın' rock_2: name: Taş, kağıt, makas 2 default_save_name: rock_2 @@ -4070,7 +3606,6 @@ adventures: seçim {is} _ {print} Benim seçimim seçim ``` - start_code: '# kodunuzu buraya yazın' secret: name: SüperCasus default_save_name: SüperCasus @@ -4100,7 +3635,6 @@ adventures: b = 'bugün sabah saat 10.00'da' {print} _ _ _ ``` - start_code: '# kodunuzu buraya yazın' 13: story_text: | Süpercasus kodunu `{and}` ile basitleştirebiliriz, böylece bize sadece bir `{if}` gerekir. @@ -4119,7 +3653,6 @@ adventures: {else} {print} 'Sabah 10.00'da tren istasyonuna git.' ``` - start_code: '# kodunuzu buraya yazın' sleep_command: name: '{sleep}' default_save_name: uyu_komutu @@ -4137,10 +3670,6 @@ adventures: {sleep} 2 {print} yeşil! ``` - start_code: |- - {print} En sevdiğim renk... - {sleep} 2 - {print} yeşil! songs: name: Bir şarkı söyle! default_save_name: Şarkı @@ -4178,7 +3707,6 @@ adventures: {print} 'ARTIK YATAKTA ZIPLAYAN MAYMUN OLMASIN!' {sleep} ``` - start_code: '{print} ''Şarkı söyleyelim!''' 7: story_text: | Şarkılar genellikle çok fazla tekrarlama içerir. Örneğin. Bebek Köpekbalığı! Eğer söylerseniz, aynı şeyi söylemeye devam edersiniz: @@ -4197,7 +3725,6 @@ adventures: {repeat} _ _ {print} 'Bebek Köpekbalığı tututudutudu' {print} 'Bebek Köpekbalığı' ``` - start_code: '{print} ''Bebek Köpekbalığı''' 8: story_text: | Önceki bir seviyede, 'Bira şişeleri' şarkısını programladınız. Ancak `{repeat}` komutu olmadan, dizeleri birçok kez kopyalamak zorunda kaldınız. @@ -4215,7 +3742,6 @@ adventures: mısra = mısra - 1 {print} mısra ' bira şişesi duvarda dizili' ``` - start_code: '# kodunuzu buraya yazın' 10: story_text: | `{for}` ile tüm yavru köpekbalığı şarkısını (ailedeki diğer tüm köpekbalıkları da dahil olmak üzere) sadece 6 satırda yazdırabilirsiniz! @@ -4232,7 +3758,6 @@ adventures: ``` maymunlar = 5, 4, 3, 2, 1 ``` - start_code: '# kodunuzu buraya yazın' 11: story_text: | Bu seviyede `{for}` ile `{range}` kullanarak, 5 küçük maymun gibi, saymayı kullanan şarkılar yapabilirsiniz. @@ -4248,7 +3773,6 @@ adventures: {print} maymunlar ' küçük maymun yatağın üzerinde zıplıyor' _ ``` - start_code: '# kodunuzu buraya yazın' 12: story_text: | Bu şarkıda 'eğer mutluysan ve bunu biliyorsan, ellerini çırp' cümlesini programlamayı daha da kolaylaştırabiliriz. Çünkü tüm eylemleri bir değişkene koyabiliriz, bir göz atın: @@ -4267,7 +3791,6 @@ adventures: _ {print} 'eğer mutluysan ve bunu biliyorsan' _ {print} eylem ``` - start_code: '# kodunuzu buraya yazın' 13: 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? @@ -4284,16 +3807,6 @@ adventures: {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: | Bu seviyede Ali Babanın çiftliği gibi bir şarkıyı daha da hızlı bir şekilde programlayabilirsiniz. Sadece listede aynı yere koyarak doğru hayvanı doğru sese bağlayabilirsiniz. @@ -4326,7 +3839,6 @@ adventures: {print} 'hey heyy ve işte doğuyor' {print} 'sabah erkenden' ``` - start_code: '# kodunuzu buraya yazın' 18: story_text: | Seviye 16'da listeleri kullanarak şarkılar yaptık. Ancak bu programlar bu seviyede artık düzgün çalışmazlar. Seviye 17'deki iki nokta üst üste ve seviye 18'deki parantezlerin hala eklenmesi gerekiyor. @@ -4348,7 +3860,6 @@ adventures: {print} 'hey heyy ve işte doğuyor' {print} 'sabah erkenden' ``` - start_code: '# kodunuzu buraya yazın' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4370,15 +3881,6 @@ adventures: {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 @@ -4414,7 +3916,6 @@ adventures: {else} oyuncu = 'x' ``` - start_code: '# Kodunuzu buraya yazın' 14: story_text: | Önceki seviyelerde bir tic tac toe oyunu yaptınız. Şimdi de = işaretini, == işaretini ve != işaretini nasıl kullanacağınızı öğrendiniz. @@ -4477,7 +3978,6 @@ adventures: {else} işaret = 'x' ``` - start_code: '# kodunuzu buraya yazın' 15: story_text: | Bu seviyede, Tic Tac Toe oyununuzu {while} döngüsü ile geliştirebilirsiniz. Bu döngü ile `{if} oyun != 'bitti'` ve `{for} i {in} {range} 1 {to} 9` satırları basit tek bir satıra dönüştürülür. @@ -4539,7 +4039,6 @@ adventures: {else} işaret = 'x' ``` - start_code: '# kodunuzu buraya yazın' 17: story_text: | Önceki seviyelerde, tic tac toe oyununun can sıkıcı bir özelliği vardı. Her hamleden sonra, kazanıp kazanmadığınızı kendiniz doldurmanız gerekiyordu. @@ -4626,7 +4125,6 @@ adventures: {else}: işaret = 'x' ``` - start_code: '# kodunuzu buraya yazın' turtle: name: Kaplumbağa default_save_name: Kaplumbağa @@ -4650,9 +4148,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | Bu seviyede, kaplumbağayı etkileşimli hale getirmek için değişkenler kullanabilirsiniz. Örneğin oyuncuya kaplumbağanın kaç adım atması gerektiğini sorabilirsiniz. @@ -4678,11 +4173,6 @@ adventures: {turn} açı {forward} 25 ``` - start_code: |- - {print} Kaplumbağa yarışı! - açı {is} 90 - {turn} açı - {forward} 25 3: story_text: | Bu seviyede, çizim kaplumbağamız ile `{at} {random}` kullanabilirsiniz. Rastgele bir seçim, kaplumbağanın her seferinde farklı bir yolda yürümesini sağlar. @@ -4695,10 +4185,6 @@ adventures: {turn} açılar {at} {random} {forward} 25 ``` - start_code: |- - açılar {is} 10, 50, 90, 150, 250 - {turn} açılar {at} {random} - {forward} 25 4: story_text: | 4. seviyede, `{print}` ve `{ask}` ile tırnak işareti kullanmanız gerekecek. Ayrıca çizim yaparken de! @@ -4725,11 +4211,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Çizim yapılıyor' - açı {is} 90 - {turn} açı - {forward} 25 5: story_text: | 5. seviyede, `{if}` ile bir seçim yapabilirsiniz. Örneğin farklı şekil türleri arasında. @@ -4762,12 +4243,6 @@ adventures: {if} yön {is} sağ {turn} _ {forward} 100 ``` - start_code: |- - {print} 'Çizim yapılıyor' - şekil {is} {ask} 'Kare mi yoksa üçgen mi istiyorsunuz?' - {if} şekil {is} üçgen açı {is} 120 {else} açı {is} 90 - {turn} açı - {forward} 25 6: story_text: | Bu seviyede, farklı şekiller çizmek için hesaplamaları kullanabilirsiniz. @@ -4791,7 +4266,6 @@ adventures: {forward} 50 {turn} açı ``` - start_code: '{print} ''Şekiller çizmek''' 8: story_text: | Artık birkaç satırı tekrarlayabildiğimize göre, şekilleri daha kolay oluşturabiliriz. @@ -4841,7 +4315,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# kodunuzu buraya yazın' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4859,7 +4332,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# kodunuzu buraya yerleştirin' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4884,16 +4356,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4909,7 +4371,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4920,7 +4381,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4931,7 +4391,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4949,7 +4408,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4968,7 +4426,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4988,7 +4445,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4999,7 +4455,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -5012,7 +4467,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -5043,7 +4497,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5084,7 +4537,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5107,7 +4559,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5136,7 +4587,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5160,7 +4610,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5188,7 +4637,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5222,7 +4670,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: iken_komutu @@ -5242,11 +4689,6 @@ adventures: cevap = {ask} '5 kere 5 kaç eder?' {print} 'Doğru cevap verilmiştir' ``` - start_code: |- - cevap = 0 - {while} cevap != 25 - cevap = {ask} '5 kere 5 kaç eder?' - {print} 'Doğru cevap verilmiştir' years: name: Yeni Yıl default_save_name: Yeni Yıl Geri Sayımı @@ -5264,4 +4706,3 @@ adventures: {print} sayı {print} 'Yeni yılınız kutlu olsun!' ``` - start_code: '# kodunuzu buraya yazın' diff --git a/content/adventures/uk.yaml b/content/adventures/uk.yaml index 223c74bdf09..876269dc34a 100644 --- a/content/adventures/uk.yaml +++ b/content/adventures/uk.yaml @@ -27,7 +27,6 @@ adventures: Використовуйте принаймні одну команду `{ask}` і одну команду `{echo}`. Ви можете написати історію на будь-яку тему, яка вам подобається. Якщо ви не можете придумати тему, скористайтеся одним з наших варіантів: похід у кіно, спортивний матч або день у зоопарку. - start_code: '{print} Твоя історія розпочинається тут' 2: story_text: | У 2 рівні ви можете зробити свою історію ще веселішою. Ім'я вашого головного героя тепер може бути в будь-якому місці речення. @@ -53,7 +52,6 @@ adventures: Змініть команди `{ask}` та `{echo}` у вашому коді на правильну форму, яку ви вивчили у цьому рівні. **Додатково** Додайте до коду команду `{sleep}`, щоб створити напругу у вашій історії. - start_code: '{print} Твоя історія' 3: story_text: | На третьому рівні ви можете зробити свою історію веселішою. Ви можете використовувати випадковість для будь-якого монстра, тварини або іншої перешкоди, наприклад, так: @@ -86,7 +84,6 @@ adventures: викинути {is} {ask} Який предмет він повинен викинути? {remove} викинути {from} рюкзак ``` - start_code: '{print} Твоя історія' 4: story_text: | Ви могли помітити, що у попередніх рівнях залишилась проблема. Ви намагались надрукувати речення, яке містить слово name, тобто `{print}` моє ім'я - name. @@ -108,7 +105,6 @@ adventures: {print} _ Він чує звук _ animals {at} {random} {print} name _ боїться, що це ліс з привидами _ ``` - start_code: '{print} ''Ваша історія буде надрукована тут!''' 5: story_text: | У цьому рівні ви можете запрограмувати різні кінцівки, які зроблять вашу історію ще веселішою. @@ -134,7 +130,6 @@ adventures: {if} кінець {is} хороший {print} мення 'бере меч і монстр швидко тікає' {else} {print} "Монстр з'їдає" мення ``` - start_code: '{print} ''Тут почнеться твоя історія!''' 7: story_text: | В історії хтось вимовляє слова кілька разів. Наприклад, коли хтось кличе на допомогу або співає пісню. @@ -149,7 +144,6 @@ adventures: {repeat} 5 {times} {print} 'Допоможіть!!!' {print} 'Чому мені ніхто не допомагає?' ``` - start_code: '{repeat} 5 {times} {print} ''Допоможіть!!!''' 8: story_text: | У цьому рівні ви можете використовувати декілька рядків у командах `{if}`, таким чином ви можете покращити свій щасливий або сумний кінець! @@ -172,7 +166,6 @@ adventures: {print} 'О ні! Річард занадто повільний...' {print} _ ``` - start_code: '# розмістіть свій код тут' 9: story_text: "У цьому рівні ви можете використовувати команди `{if}` і `{repeat}` всередині інших команд `{if}` і `{repeat}`. \nЦе дає вам багато можливостей і дійсно допомагає зробити вашу історію інтерактивною.\n\n### Вправа 1\n Закінчіть код, щоб `{if}` працював коректно.\n\n### Вправа\ \ 2\nДодайте `{if}` та `{else}` для тієї частини історії, де Робін також повертається додому.\n \n### Вправа 3\nПоверніться до своєї історії 8-го рівня і використайте принаймні два `{if}` всередині іншого `{if}`.\n" @@ -191,7 +184,6 @@ adventures: {else} {print} 'Робін йде додому' ``` - start_code: '# розмістіть свій код тут' 10: story_text: | На цьому рівні ви можете використовувати команду {for} у своїй історії. Таким чином ви можете легко запрограмувати дитячу книжку 'Бурий ведмедик, бурий ведмедик, що ти бачиш'. @@ -205,7 +197,6 @@ adventures: {print} 'Бурий ведмідь, Бурий ведмідь' {print} 'Що ти бачиш?' ``` - start_code: '# розмістіть свій код тут' 12: story_text: |- На цьому рівні лапки знадобляться для збереження кількох слів у змінній. @@ -218,7 +209,6 @@ adventures: хто = 'Королева Англії' {print} хто ' їла шматок торта, як раптом...' ``` - start_code: '# розмістіть свій код тут' 13: story_text: | Використовуючи команди `{and}` та `{or}`, ви можете зробити свої історії більш універсальними. Ви можете поставити два запитання і відреагувати на комбінацію відповідей. @@ -237,7 +227,6 @@ adventures: {if} шлях {is} 'лівий' {and} зброя {is} 'меч' _ ``` - start_code: '# розмістіть свій код тут' 15: story_text: | Використання циклу `{while}` може зробити ваші історії цікавішими. Наприклад, ви можете використати `{while} гра == 'продовжується'`, щоб гравець міг грати, доки гра не закінчиться. @@ -260,7 +249,6 @@ adventures: {print} 'Ні, їх немає в ' місце {print} 'Тепер ви можете зайти в будинок!' ``` - start_code: '# розмістіть свій код тут' 18: story_text: | Ми збираємося надрукувати ще одну історію, але тепер нам потрібно використовувати дужки з `{print}`. @@ -281,7 +269,6 @@ adventures: name = {input}('Як тебе звати?') {print}('Ласкаво просимо до цієї історії!') ``` - start_code: '# Напишіть свій код тут' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -321,13 +308,6 @@ adventures: _ {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 @@ -345,11 +325,6 @@ adventures: {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 @@ -382,10 +357,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -413,11 +384,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -529,7 +495,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -568,7 +533,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -587,7 +551,6 @@ adventures: 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! @@ -604,7 +567,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -620,7 +582,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -631,7 +592,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -648,7 +608,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -673,11 +632,7 @@ adventures: 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 @@ -709,7 +664,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -758,17 +712,6 @@ adventures: 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 @@ -791,12 +734,6 @@ adventures: {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. @@ -816,14 +753,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -845,16 +774,6 @@ adventures: 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 @@ -869,13 +788,6 @@ adventures: {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 @@ -898,17 +810,7 @@ adventures: {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' @@ -935,19 +837,7 @@ adventures: 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: @@ -963,11 +853,6 @@ adventures: 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 @@ -992,10 +877,7 @@ adventures: {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} @@ -1032,19 +914,7 @@ adventures: 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: @@ -1059,11 +929,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1103,26 +968,6 @@ adventures: 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 @@ -1151,27 +996,6 @@ adventures: 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 @@ -1204,31 +1028,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1258,9 +1057,7 @@ adventures: 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?' @@ -1317,36 +1114,6 @@ adventures: 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 @@ -1492,7 +1259,6 @@ adventures: 1: story_text: "На першому рівні ви можете використовувати команди `{print}`, `{ask}` та `{echo}`.\nНаберіть свій код у полі для програмування. Або натисніть зелену кнопку в блоці прикладу коду, і код буде набраний за вас!\nСпробуйте код самостійно, натиснувши зелену кнопку \"Запустити код\"\ \ під полем програмування.\n \nВивести текст на екран можна за допомогою команди `{print}`. \n" - start_code: '{print} привіт світе!' 2: story_text: | На 2-му рівні ми вивчимо дві нові команди: `{is}` та `{sleep}`. @@ -1507,11 +1273,9 @@ adventures: ``` story_text_2: | Команда `{print}` працює так само, але змінилася команда `{ask}`. У команді `{ask}` також потрібно використовувати змінну. Виглядає це наступним чином: - start_code: '{print} привіт світе!' 3: story_text: | На рівні 3 ви можете скласти список. Ви можете дозволити комп'ютеру вибрати щось випадкове зі списку. Для цього використовується команда `{at} {random}`. - start_code: '{print} привіт світе!' 4: story_text: | На 4-му рівні змінилися `{ask}` та `{print}`. @@ -1524,7 +1288,6 @@ adventures: відповідь {is} {ask} 'Що нам потрібно використовувати з цього моменту' {print} 'Нам потрібно використовувати ' відповідь ``` - start_code: '{print} ''Привіт світе''' 5: story_text: | У 5 рівні з'явилося дещо нове - `{if}`! За допомогою `{if}` ви можете вибирати між двома різними варіантами. @@ -1535,9 +1298,6 @@ adventures: імʼя {is} {ask} 'як тебе звати?' {if} імʼя {is} Хейді {print} 'класно' {else} {print} 'фе!' ``` - start_code: |- - імʼя {is} {ask} 'як тебе звати?' - {if} імʼя {is} Хейді {print} 'круто!' {else} {print} 'пф' 6: story_text: | У цьому рівні ви дізнаєтесь дещо нове: тепер ви вмієте ще й рахувати. @@ -1560,7 +1320,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` і `{print}` все ще працюють так, як ви їх знаєте. Але `{if}`, `{else}`, і `{repeat}` змінилися! @@ -1584,10 +1343,6 @@ adventures: {print} 'ПОРУШНИК!' {print} 'Не можеш користуватись цим компʼютером!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {print} 'This will be printed 5 times' 9: story_text: | У цьому рівні можна не тільки використовувати кілька рядків з `{if}` та `{repeat}`, але й об'єднувати їх разом! @@ -1602,13 +1357,6 @@ adventures: {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' 10: story_text: |- У цьому рівні ми вивчаємо новий код, який називається `{for}`. За допомогою `{for}` можна скласти список і використовувати всі елементи. @@ -1619,17 +1367,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Десяткові числа** @@ -1639,8 +1380,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 13: story_text: "Зараз ми будемо вивчати `{and}` та `{or}`! Якщо ви хочете перевірити два оператори, вам не обов'язково використовувати два `{if}`, ви можете використовувати `{and}` і `{or}`. \n\nЯкщо ви використовуєте `{and}`, обидва оператори, зліва і справа від `{and}`, повинні бути істинними.\ @@ -1652,11 +1392,6 @@ adventures: {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!' 14: story_text: | Ми з вами будемо вивчати нові елементи. Можливо, ви вже знаєте їх з математики - це `<` та `>`. @@ -1671,8 +1406,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1691,11 +1425,6 @@ adventures: 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' 16: story_text: |- Ми будемо складати списки у стилі Python, з квадратними дужками навколо списків! Ми також зберігаємо лапки навколо кожного елемента, як ми вже навчилися на попередніх рівнях. @@ -1728,8 +1457,7 @@ adventures: story_text: |- Ми отримали справжній код Python! Це означає, що відтепер нам потрібно використовувати дужки з `{print}` і `{range}`. Це також означає, що ви можете використовувати код Hedy з цього рівня в будь-якому середовищі Python, якщо ви використовуєте англійські команди. Якщо ви цього ще не зробили, ви можете зробити це за допомогою перемикача в меню команд. - start_code: |- - імʼя = 'Хейді' + {print}('Мене звати ', імʼя) dice: name: Dice @@ -1757,12 +1485,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1776,7 +1502,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1794,7 +1519,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1806,7 +1530,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1818,7 +1541,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1843,7 +1565,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1861,7 +1582,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1877,7 +1597,6 @@ adventures: {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. @@ -1885,7 +1604,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1918,7 +1636,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1927,7 +1644,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1938,7 +1654,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1986,10 +1701,6 @@ adventures: {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: |- На цьому рівні ми додаємо нову форму `{for}`. На попередніх рівнях ми використовували `{for}` зі списком, але ми також можемо використовувати `{for}` з числами. @@ -2002,10 +1713,6 @@ adventures: {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: 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. @@ -2045,7 +1752,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2063,7 +1769,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2084,7 +1789,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2097,7 +1801,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2128,7 +1831,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2140,7 +1842,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2157,7 +1858,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2173,7 +1873,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2185,7 +1884,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2225,21 +1923,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2268,13 +1951,6 @@ adventures: {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. @@ -2298,17 +1974,6 @@ adventures: 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 @@ -2337,7 +2002,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2359,7 +2023,6 @@ adventures: _ {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 @@ -2389,7 +2052,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2436,7 +2098,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2452,7 +2113,6 @@ adventures: {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. @@ -2471,7 +2131,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2500,7 +2159,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2526,7 +2184,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2555,7 +2212,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2589,7 +2245,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2620,18 +2275,7 @@ adventures: {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?' @@ -2670,10 +2314,6 @@ adventures: _ _ _ 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... @@ -2690,11 +2330,6 @@ adventures: {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. @@ -2710,16 +2345,6 @@ adventures: {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 @@ -2748,11 +2373,6 @@ adventures: _ 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 @@ -2778,10 +2398,6 @@ adventures: 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: @@ -2790,8 +2406,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2823,8 +2438,7 @@ adventures: {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} @@ -2847,7 +2461,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2868,7 +2481,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2908,8 +2520,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Папуга @@ -2959,7 +2570,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2972,7 +2582,6 @@ adventures: {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}`. @@ -2986,7 +2595,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3002,7 +2610,6 @@ adventures: _ сказане_слово {is} нове_слово ' 🧒 Молодець, Хеді! 🍪' _ _ ' 🧒 Ні, Хеді! Скажи ' нове_слово ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3022,7 +2629,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3046,7 +2652,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3075,7 +2680,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3088,7 +2692,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3108,7 +2711,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3134,8 +2736,6 @@ adventures: ``` _ 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. @@ -3152,8 +2752,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3185,7 +2784,6 @@ adventures: {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 @@ -3215,10 +2813,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3253,10 +2847,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3290,9 +2880,6 @@ adventures: 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. @@ -3341,11 +2928,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3359,10 +2941,6 @@ adventures: {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! @@ -3377,13 +2955,6 @@ adventures: {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 @@ -3409,10 +2980,6 @@ adventures: 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? @@ -3430,11 +2997,6 @@ adventures: _ {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 @@ -3454,7 +3016,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3474,7 +3035,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3506,7 +3066,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3526,7 +3085,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | На цьому рівні команда `{if}` дозволяє вам `{ask}` питання клієнтам і давати різні реакції на відповіді. @@ -3547,7 +3105,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3566,7 +3123,6 @@ adventures: {print} 'That will be ' price ' dollars, please' {print} 'Thank you, enjoy your meal!' ``` - start_code: '# place your code here' 7: story_text: | У цьому рівні ви навчилися використовувати команду `{repeat}` для повторення рядка коду певну кількість разів. @@ -3578,7 +3134,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3596,7 +3151,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add as many options as you like! - start_code: '# place your code here' 9: story_text: | У цьому рівні ви можете використовувати кластеризацію, щоб зробити ваш ресторан більш реалістичним та веселим! @@ -3624,7 +3178,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3668,7 +3221,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3687,7 +3239,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3702,7 +3253,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3719,7 +3269,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3747,7 +3296,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3756,7 +3304,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3778,12 +3325,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3803,7 +3348,6 @@ 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. Can you finish the code? @@ -3823,7 +3367,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3834,7 +3377,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3852,7 +3394,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3874,7 +3415,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3891,7 +3431,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3915,7 +3454,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3928,7 +3466,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3944,10 +3481,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3981,7 +3514,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3999,7 +3531,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -4013,7 +3544,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | У цьому рівні ви з легкістю зможете зробити дитячу пісеньку "П'ять маленьких мавпочок". Чи зможете ви скласти останній приспів? @@ -4065,7 +3595,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4080,7 +3609,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4095,7 +3623,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4112,16 +3639,6 @@ adventures: {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. @@ -4157,7 +3674,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4179,7 +3695,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4201,15 +3716,6 @@ adventures: {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 @@ -4277,7 +3783,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4340,7 +3845,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4402,7 +3906,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4489,7 +3992,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4511,9 +4013,6 @@ adventures: {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. @@ -4537,11 +4036,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4552,10 +4046,6 @@ adventures: {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! @@ -4582,11 +4072,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4619,12 +4104,6 @@ adventures: 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. @@ -4648,7 +4127,6 @@ adventures: {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. @@ -4691,7 +4169,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4709,7 +4186,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4734,16 +4210,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4759,7 +4225,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4770,7 +4235,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4781,7 +4245,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4799,7 +4262,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4818,7 +4280,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4838,7 +4299,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4849,7 +4309,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4862,7 +4321,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4893,7 +4351,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4934,7 +4391,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4957,7 +4413,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4986,7 +4441,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5010,7 +4464,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5038,7 +4491,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5072,7 +4524,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5092,11 +4543,6 @@ adventures: 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: Новий рік default_save_name: Новорічний відлік @@ -5114,4 +4560,3 @@ adventures: {print} номер {print}'З Новим роком!' ``` - start_code: '# розмістіть свій код тут' diff --git a/content/adventures/ur.yaml b/content/adventures/ur.yaml index d0030f719ff..6b939cc314d 100644 --- a/content/adventures/ur.yaml +++ b/content/adventures/ur.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -49,7 +48,6 @@ adventures: 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: @@ -78,7 +76,6 @@ adventures: 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? @@ -93,7 +90,6 @@ adventures: {print} 'He hears the sound of an' 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. @@ -116,7 +112,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -127,7 +122,6 @@ adventures: {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! @@ -145,7 +139,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put {if}, {repeat} or {for} commands inside other {if}, {repeat} or {for} commands. This gives you many options and really helps you to make your story interactive. @@ -164,7 +157,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -181,7 +173,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -189,7 +180,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -219,7 +209,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -242,7 +231,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -263,7 +251,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -303,13 +290,6 @@ adventures: _ {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 @@ -327,11 +307,6 @@ adventures: {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 @@ -364,10 +339,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -395,11 +366,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -511,7 +477,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -550,7 +515,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. Like this... @@ -569,7 +533,6 @@ adventures: 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! @@ -586,7 +549,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -602,7 +564,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. @@ -613,7 +574,6 @@ adventures: answer = number1 + number2 {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -630,7 +590,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -655,11 +614,7 @@ adventures: 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 @@ -691,7 +646,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -740,17 +694,6 @@ adventures: 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 @@ -773,12 +716,6 @@ adventures: {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. @@ -798,14 +735,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -827,16 +756,6 @@ adventures: 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 @@ -851,13 +770,6 @@ adventures: {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 @@ -880,17 +792,7 @@ adventures: {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' @@ -917,19 +819,7 @@ adventures: 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: @@ -945,11 +835,6 @@ adventures: 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 @@ -974,10 +859,7 @@ adventures: {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} @@ -1014,19 +896,7 @@ adventures: 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: @@ -1041,11 +911,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1085,26 +950,6 @@ adventures: 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 @@ -1133,27 +978,6 @@ adventures: 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 @@ -1186,31 +1010,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1240,9 +1039,7 @@ adventures: 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?' @@ -1299,36 +1096,6 @@ adventures: 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 @@ -1478,7 +1245,6 @@ adventures: Try the code yourself with the green 'Run code' button under the programming field. You can print text to the screen using the `{print}` command. - start_code: '{print} hello world!' 2: story_text: | In level 2 we learn two new commands: `{is}` and `{sleep}`. @@ -1493,11 +1259,9 @@ adventures: ``` story_text_2: | `{print}` still works the same, but the `{ask}` command has changed. You need to use a variable in the `{ask}` command as well. It looks like this: - start_code: '{print} hello world!' 3: story_text: | In level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`. - start_code: '{print} hello world!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1513,7 +1277,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Hello world''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1524,9 +1287,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - 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. @@ -1549,7 +1309,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}`, `{else}` and `{repeat}` have changed! @@ -1573,10 +1332,6 @@ adventures: {print} 'INTRUDER!' {print} 'You cannot use this computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1591,13 +1346,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1608,17 +1356,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1628,8 +1369,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1641,11 +1381,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1660,8 +1395,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1680,11 +1414,6 @@ adventures: 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' 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. @@ -1714,9 +1443,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1744,12 +1472,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1763,7 +1489,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1781,7 +1506,6 @@ adventures: Can you make the code so that you get the total score for 8 dice? To do that, you have to cut and paste some lines of the code. example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1793,7 +1517,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1805,7 +1528,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1830,7 +1552,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1848,7 +1569,6 @@ adventures: ``` story_text_2: | Don't feel like doing the dishes yourself? Hack the program to remove your name from the list. - start_code: '{print} Who does the dishes?' 4: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1864,7 +1584,6 @@ adventures: {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. @@ -1877,7 +1596,6 @@ adventures: dishwasher {is} people {at} {random} {if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ {else} {print} 'luckily no dishes because' _ 'is already washing up' ``` - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1910,7 +1628,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1919,7 +1636,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1930,7 +1646,6 @@ adventures: {for} day {in} days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1978,10 +1693,6 @@ adventures: {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: |- 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. @@ -1993,10 +1704,6 @@ adventures: {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: 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. @@ -2036,7 +1743,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2054,7 +1760,6 @@ adventures: story_text_2: | ### Exercises 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. @@ -2075,7 +1780,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2088,7 +1792,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2119,7 +1822,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2131,7 +1833,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2148,7 +1849,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2164,7 +1864,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Like in this example below: @@ -2176,7 +1875,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2216,21 +1914,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2259,13 +1942,6 @@ adventures: {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. @@ -2289,17 +1965,6 @@ adventures: 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 @@ -2328,7 +1993,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2350,7 +2014,6 @@ adventures: _ {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 @@ -2380,7 +2043,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2427,7 +2089,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2443,7 +2104,6 @@ adventures: {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. @@ -2462,7 +2122,6 @@ adventures: {if} chosen_door {is} correct_door {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! @@ -2491,7 +2150,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2517,7 +2175,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2546,7 +2203,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2580,7 +2236,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2611,18 +2266,7 @@ adventures: {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?' @@ -2661,10 +2305,6 @@ adventures: _ _ _ 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... @@ -2681,11 +2321,6 @@ adventures: {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. @@ -2701,16 +2336,6 @@ adventures: {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 @@ -2739,11 +2364,6 @@ adventures: _ 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 @@ -2769,10 +2389,6 @@ adventures: 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: @@ -2781,8 +2397,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2814,8 +2429,7 @@ adventures: {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} @@ -2838,7 +2452,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2859,7 +2472,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2899,8 +2511,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2926,7 +2537,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2943,7 +2553,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2956,7 +2565,6 @@ adventures: {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}`. @@ -2970,7 +2578,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -2986,7 +2593,6 @@ adventures: {if} said_word {is} new_word {print} '🧒 Great job, Hedy! 🍪' {else} {print} '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3006,7 +2612,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' wish ' in ' weeks ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3030,7 +2635,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3059,7 +2663,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3072,7 +2675,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3092,7 +2694,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3118,8 +2719,6 @@ adventures: ``` _ 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. @@ -3136,8 +2735,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3169,7 +2767,6 @@ adventures: {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 @@ -3199,10 +2796,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3237,10 +2830,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3274,9 +2863,6 @@ adventures: 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. @@ -3325,11 +2911,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3343,10 +2924,6 @@ adventures: {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! @@ -3361,13 +2938,6 @@ adventures: {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 @@ -3393,10 +2963,6 @@ adventures: 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? @@ -3414,11 +2980,6 @@ adventures: _ {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 @@ -3438,7 +2999,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3458,7 +3018,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3490,7 +3049,6 @@ adventures: {remove} allergies {from} flavors {print} You get a flavors {at} {random} milkshake ``` - start_code: '# place your code here' 4: story_text: | In this level you have to use quotation marks when using the `{print}` command. @@ -3510,7 +3068,6 @@ adventures: {print} 'Thank you for your order.' {print} 'Your ' food ' and ' drinks ' will be right there!' ``` - start_code: '# place your code here' 5: story_text: | In this level the {if} command allows you to {ask} your customers questions and give different responses to the answers. @@ -3531,7 +3088,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3550,7 +3106,6 @@ adventures: {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. @@ -3562,7 +3117,6 @@ adventures: {repeat} people times food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3580,7 +3134,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3608,7 +3161,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3653,7 +3205,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3672,7 +3223,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3687,7 +3237,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3704,7 +3253,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3732,7 +3280,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3741,7 +3288,6 @@ adventures: choice {is} _ {print} I choose choice ``` - 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! @@ -3763,12 +3309,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3788,7 +3332,6 @@ 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. Can you finish the code? @@ -3808,7 +3351,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3819,7 +3361,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3837,7 +3378,6 @@ adventures: {if} computer_choice {is} 'rock' {and} your_choice {is} 'scissors' {print} 'The computer wins!' ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3859,7 +3399,6 @@ adventures: {print} 'You win!' won = 'yes' ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3876,7 +3415,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3900,7 +3438,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | The code you made in the previous level can be made a lot easier in this one with the `{and}` command. @@ -3913,7 +3450,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3929,10 +3465,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -3966,7 +3498,6 @@ adventures: print 'NO MORE MONKEYS JUMPING ON THE BED!' sleep ``` - start_code: '{print} ''Baby shark''' 7: story_text: | Songs often contain a lot of repetition. For example... Baby Shark! If you sing it, you keep singing the same thing: @@ -3984,7 +3515,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In level 7 you can repeat the song 99 times, just by adding one simple line! @@ -3998,7 +3528,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4050,7 +3579,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting. @@ -4065,7 +3593,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4080,7 +3607,6 @@ adventures: {print} 'if youre happy and you know it' {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4097,16 +3623,6 @@ adventures: {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. @@ -4142,7 +3658,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4164,7 +3679,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4186,15 +3700,6 @@ adventures: {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 @@ -4262,7 +3767,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4325,7 +3829,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4387,7 +3890,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4474,7 +3976,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4496,9 +3997,6 @@ adventures: {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. @@ -4522,11 +4020,6 @@ adventures: {turn} angle {forward} 25 ``` - start_code: |- - {print} Turtle race! - hoek {is} 90 - {turn} hoek - {forward} 25 3: story_text: | In this level you can use use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4537,10 +4030,6 @@ adventures: {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! @@ -4567,11 +4056,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4604,12 +4088,6 @@ adventures: 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. @@ -4633,7 +4111,6 @@ adventures: {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. @@ -4676,7 +4153,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4694,7 +4170,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4719,16 +4194,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4744,7 +4209,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4755,7 +4219,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4766,7 +4229,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4784,7 +4246,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4803,7 +4264,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4823,7 +4283,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4834,7 +4293,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4847,7 +4305,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4878,7 +4335,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4919,7 +4375,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4942,7 +4397,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4971,7 +4425,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4995,7 +4448,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5023,7 +4475,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5057,7 +4508,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5077,11 +4527,6 @@ adventures: 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 @@ -5099,4 +4544,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/vi.yaml b/content/adventures/vi.yaml index 09be0164223..719436126a5 100644 --- a/content/adventures/vi.yaml +++ b/content/adventures/vi.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -52,7 +51,6 @@ adventures: 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: @@ -84,7 +82,6 @@ adventures: 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. @@ -99,7 +96,6 @@ adventures: {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. @@ -123,7 +119,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -137,7 +132,6 @@ adventures: {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! @@ -158,7 +152,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put `{if}`, `{repeat}` or `{for}` commands inside other `{if}`, `{repeat}` or `{for}` commands. This gives you many options and really helps you to make your story interactive. @@ -177,7 +170,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -194,7 +186,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -202,7 +193,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -235,7 +225,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -258,7 +247,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -279,7 +267,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -319,13 +306,6 @@ adventures: _ {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 @@ -343,11 +323,6 @@ adventures: {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 @@ -380,10 +355,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -411,11 +382,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -527,7 +493,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -564,7 +529,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. @@ -585,7 +549,6 @@ adventures: 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! @@ -603,7 +566,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -619,7 +581,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -630,7 +591,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -647,7 +607,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -672,11 +631,7 @@ adventures: 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 @@ -708,7 +663,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -757,17 +711,6 @@ adventures: 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 @@ -790,12 +733,6 @@ adventures: {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. @@ -815,14 +752,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -844,16 +773,6 @@ adventures: 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 @@ -868,13 +787,6 @@ adventures: {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 @@ -897,17 +809,7 @@ adventures: {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' @@ -934,19 +836,7 @@ adventures: 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: @@ -962,11 +852,6 @@ adventures: 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 @@ -991,10 +876,7 @@ adventures: {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} @@ -1031,19 +913,7 @@ adventures: 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: @@ -1058,11 +928,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1102,26 +967,6 @@ adventures: 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 @@ -1150,27 +995,6 @@ adventures: 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 @@ -1203,31 +1027,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1257,9 +1056,7 @@ adventures: 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?' @@ -1316,36 +1113,6 @@ adventures: 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 @@ -1494,7 +1261,6 @@ adventures: Nhập mã của bạn vào trường lập trình. Hoặc nhấn vào nút màu xanh trong khối mã ví dụ, và mã sẽ được gõ tự động cho bạn! Hãy thử mã của bạn bằng cách sử dụng nút 'Chạy mã' màu xanh dưới trường lập trình. Bạn có thể in ra màn hình văn bản bằng cách sử dụng lệnh `{print}`. - start_code: '{print} hello world!' 2: story_text: | Ở cấp độ 2, chúng ta học hai lệnh mới: `{is}` và `{sleep}`. @@ -1508,11 +1274,9 @@ adventures: ``` story_text_2: | `{print}` vẫn hoạt động như cũ, nhưng lệnh `{ask}` đã thay đổi. Bạn cần sử dụng một biến trong lệnh `{ask}` cũng như vậy. Nó trông như thế này: - start_code: '{print} hello world!' 3: story_text: | Ở cấp độ 3, bạn có thể tạo một danh sách. Bạn có thể để máy tính chọn ngẫu nhiên một phần tử từ danh sách đó. Bạn thực hiện điều đó bằng cách sử dụng `{at} {random}`. - start_code: '{print} hello world!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1528,7 +1292,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Hello world''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1539,9 +1302,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - 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. @@ -1564,7 +1324,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}`, `{else}` and `{repeat}` have changed! @@ -1588,10 +1347,6 @@ adventures: {print} 'INTRUDER!' {print} 'You cannot use this computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1606,13 +1361,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1623,17 +1371,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1643,8 +1384,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1656,11 +1396,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1675,8 +1410,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1695,11 +1429,6 @@ adventures: 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' 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. @@ -1729,9 +1458,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1759,12 +1487,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1778,7 +1504,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1798,7 +1523,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1810,7 +1534,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1823,7 +1546,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1848,7 +1570,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1866,7 +1587,6 @@ adventures: ``` story_text_2: | 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: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1882,7 +1602,6 @@ adventures: {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. @@ -1890,7 +1609,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1923,7 +1641,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1932,7 +1649,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1943,7 +1659,6 @@ adventures: _ day _ days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1991,10 +1706,6 @@ adventures: {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: |- 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. @@ -2006,10 +1717,6 @@ adventures: {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: 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. @@ -2049,7 +1756,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2067,7 +1773,6 @@ adventures: 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. @@ -2092,7 +1797,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2105,7 +1809,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone {else} will win!😭' ``` - start_code: '# place your code here' 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. @@ -2140,7 +1843,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2152,7 +1854,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use repeat to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2172,7 +1873,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2188,7 +1888,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2200,7 +1899,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2240,21 +1938,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2283,13 +1966,6 @@ adventures: {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. @@ -2313,17 +1989,6 @@ adventures: 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 @@ -2352,7 +2017,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2374,7 +2038,6 @@ adventures: _ {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 @@ -2404,7 +2067,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2451,7 +2113,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2467,7 +2128,6 @@ adventures: {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. @@ -2489,7 +2149,6 @@ adventures: _ _ _ _ {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! @@ -2518,7 +2177,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2547,7 +2205,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2576,7 +2233,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2610,7 +2266,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2641,18 +2296,7 @@ adventures: {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?' @@ -2691,10 +2335,6 @@ adventures: _ _ _ 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... @@ -2711,11 +2351,6 @@ adventures: {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. @@ -2731,16 +2366,6 @@ adventures: {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 @@ -2769,11 +2394,6 @@ adventures: _ 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 @@ -2799,10 +2419,6 @@ adventures: 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: @@ -2811,8 +2427,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2844,8 +2459,7 @@ adventures: {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} @@ -2871,7 +2485,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2892,7 +2505,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2932,8 +2544,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2959,7 +2570,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2976,7 +2586,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2991,7 +2600,6 @@ adventures: {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}`. @@ -3005,7 +2613,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3022,7 +2629,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3043,7 +2649,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3067,7 +2672,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3096,7 +2700,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3109,7 +2712,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3129,7 +2731,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3155,8 +2756,6 @@ adventures: ``` _ 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. @@ -3173,8 +2772,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3206,7 +2804,6 @@ adventures: {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 @@ -3236,10 +2833,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3274,10 +2867,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3311,9 +2900,6 @@ adventures: 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. @@ -3362,11 +2948,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3380,10 +2961,6 @@ adventures: {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! @@ -3398,13 +2975,6 @@ adventures: {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 @@ -3430,10 +3000,6 @@ adventures: 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? @@ -3451,11 +3017,6 @@ adventures: _ {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 @@ -3475,7 +3036,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3492,7 +3052,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3526,7 +3085,6 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - 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. @@ -3546,7 +3104,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3567,7 +3124,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3586,7 +3142,6 @@ adventures: {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. @@ -3601,7 +3156,6 @@ adventures: {repeat} _ {times} food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3619,7 +3173,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3652,7 +3205,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3700,7 +3252,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3722,7 +3273,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3737,7 +3287,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3754,7 +3303,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3781,7 +3329,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3790,7 +3337,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3812,12 +3358,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3837,7 +3381,6 @@ 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. Can you finish the code? @@ -3857,7 +3400,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3869,7 +3411,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3888,7 +3429,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3911,7 +3451,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3928,7 +3467,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3955,7 +3493,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3968,7 +3505,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3984,10 +3520,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4025,7 +3557,6 @@ adventures: 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: @@ -4043,7 +3574,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In this level you can repeat the song 99 times, just by adding one simple line! @@ -4058,7 +3588,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4119,7 +3648,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting, like the 5 little monkeys. @@ -4137,7 +3665,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4156,7 +3683,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4173,16 +3699,6 @@ adventures: {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. @@ -4218,7 +3734,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4240,7 +3755,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4262,15 +3776,6 @@ adventures: {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 @@ -4338,7 +3843,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4401,7 +3905,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4463,7 +3966,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4550,7 +4052,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4574,9 +4075,6 @@ adventures: {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. @@ -4602,11 +4100,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4619,10 +4112,6 @@ adventures: {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! @@ -4649,11 +4138,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4686,12 +4170,6 @@ adventures: 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. @@ -4715,7 +4193,6 @@ adventures: {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. @@ -4758,7 +4235,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4776,7 +4252,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4801,16 +4276,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4826,7 +4291,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4837,7 +4301,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4848,7 +4311,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4866,7 +4328,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4885,7 +4346,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4905,7 +4365,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4916,7 +4375,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4929,7 +4387,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4960,7 +4417,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -5001,7 +4457,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5024,7 +4479,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5053,7 +4507,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5077,7 +4530,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5105,7 +4557,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5139,7 +4590,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5159,11 +4609,6 @@ adventures: 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 @@ -5181,4 +4626,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/content/adventures/zh_Hans.yaml b/content/adventures/zh_Hans.yaml index 0f7bfedde60..fd69d0632a0 100644 --- a/content/adventures/zh_Hans.yaml +++ b/content/adventures/zh_Hans.yaml @@ -27,7 +27,6 @@ adventures: 至少要使用一个`{ask}`和一个`{echo}`命令。 你可以把它写成任何你喜欢的主题。 如果你想不出来,可以使用我们的给你的选择:看电影、体育比赛或动物园的一天。 - start_code: '{print} 你的故事从这里开始' 2: story_text: | 在第2关,你可以让你的故事更有趣些。你的主人公的名字可以放在句子里的任何位置了。 @@ -52,7 +51,6 @@ adventures: 把你代码中的`{ask}`命令和`{echo}`命令改成你在本关学到的正确形式。 **另外**在你的代码中添加一个`{sleep}`命令,在你的故事中建立起紧张感。 - start_code: '{print} 你的故事' 3: story_text: | 在第3关,你可以让你的故事更有趣些。你可以随机选择怪物、动物或者其它障碍,比如: @@ -86,7 +84,6 @@ adventures: 扔掉的 {is} {ask} 他应该扔掉哪个东西? {remove} 扔掉的 {from} 包 ``` - 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} \U0001F994, \U0001F43F, \U0001F989, \U0001F987\n{print} _他听到了一个_ 动物们{at} {random} 的声音\n{print} 名字_担心这片森林闹鬼_\n```\n" @@ -139,7 +136,6 @@ adventures: {print} '哦,不!理查德太慢了……' {print} _ ``` - start_code: '# 在这里写你的代码' 9: story_text: "在这一级,你可以通过嵌套,在一个 `{if}`和`{repeat}` 语句里包含其它 `{if}`和`{repeat}`语句。\n 这让你有了很多选择,极大地提高了故事地互动性。\n\n### 练习1 \n完成代码,使`{if}` 能正常工作。 \n\n### 练习2 \n 为故事中罗宾也回家的部分添加一个`{if}` 和`{else}`语句 。 \n\n### 练习3 \n回到你第8级的故事中,在另一个`{if}` 条件语句里面至少使用两个`{if}`条件语句。\n" example_code: | @@ -157,11 +153,9 @@ adventures: {else} {print} '罗宾回了家' ``` - start_code: '# 在这里写你的代码' 10: story_text: "在这一级,你可以在你的故事里使用 {for} 命令。这样很容易就能写出儿童书里的“棕熊,棕熊,你看到了什么”的故事。\n\n ### 练习\n\n请看\n the story 如果你不知道这个故事,请确保它是按照书中的内容打印的。\n" example_code: "```\n动物们 = _ , _ , _ \n{print} '棕熊,棕熊 '\n{print} '你看到了什么?'\n```\n" - start_code: '# 在这里写你的代码' 12: story_text: 在此级别中,您可以使用引号将多个单词保存在一个变量中。 example_code: | @@ -169,7 +163,6 @@ adventures: 名字 = '英国女王' {print} 名字'正在吃一块蛋糕,突然......' ``` - start_code: '# 在这里写你的代码' 13: story_text: "通过使用`{and}`和`{or}`命令,你可以把故事写得更短。比如这个龙的故事。\n\n### 练习 \n你能像这样制作你自己的迷你冒险游戏吗?\n" example_code: | @@ -181,7 +174,6 @@ adventures: {if} 路径 {is} “左” {and} 武器 {is} “剑” _ ``` - start_code: '# 在这里写你的代码' 15: story_text: | 运用`{while}`循环能让你的故事更有趣。比如,用`{while} game == 'on'`可以让游戏一直进行到结束为止。 @@ -204,7 +196,6 @@ adventures: {print} '没有,他们不在'位置 {print} '现在你可以进入房子了!' ``` - start_code: '# 在这里写你的代码' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -225,7 +216,6 @@ adventures: naam = {input}("你叫什么名字?") {print}('欢迎来到这个故事!') ``` - start_code: '# 在此处键入代码' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: 添加_删除_命令 @@ -265,8 +255,7 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - start_code: |- - 动物们 {is} 狗, 猫, 袋鼠 + 喜欢 {is} {ask} 你最喜欢的动物是什么? {add} 喜欢 {to_list} 动物们 不喜欢 {is} {ask} 你不喜欢什么动物? @@ -289,11 +278,6 @@ adventures: {if} 名字 {is} '海蒂' {and} 年龄 {is} 2 {print} '你就是真的海蒂!' ``` - start_code: |- - 名字 = {ask} '你叫什么名字?' - 年龄 = {ask} '你多少岁了?' - {if} 名字 {is} '海蒂' {and} 年龄 {is} 2 - {print} '你就是真的海蒂!' ask_command: name: '{ask}' default_save_name: 要求命令 @@ -326,10 +310,6 @@ adventures: _ 你好吗? _ ``` - start_code: | - {print} 你好! - {ask} 你叫什么名字? - {echo} 你好 2: story_text: | ## 询问指令 @@ -356,11 +336,6 @@ adventures: favorite_animals {is} {ask} 你喜欢什么 动物? {print} 我喜欢 favorite_animals ``` - start_code: |- - 名字 {is} {ask} 你叫什么名字? - {print} 你好名字 - 年龄 {is} {ask} 你多大了? - {print} 名字是年龄. 18: story_text: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -397,7 +372,6 @@ adventures: # 获胜者\n{if} points > 21 {or} dealer_points > points {or} dealer_points == 21:\n {print} '你输了'\n{elif} dealer_points < 17:\n {print} '庄家要牌.它是... ' 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}\ \ '现在打印庄家有 ' dealer_points \n {if} dealer_points < 21 {and} dealer_points > points:\n {print} '你输了'\n {else}:\n {print} '你赢了!'\n{elif} points > dealer_points {and} points < 21:\n {print} '你赢了!'\n```\n" - start_code: '# 在这里输入你的代码' calculator: name: 计算器 default_save_name: 计算器 @@ -436,7 +410,6 @@ adventures: {if} _ {else} _ ``` - start_code: '{print} ''欢迎来到这个计算器!''' 9: story_text: | 在第 6 级中,您编写了一个计算器程序,在此级别中,您可以扩展该程序来提出多个问题。 @@ -461,7 +434,6 @@ adventures: 分数 = 分数 + 1 {print} '做得好!你的分数是' 分数 '分,满分是10分!' ``` - start_code: '{print} ''欢迎来到这个计算器!''' 10: story_text: | 这个计算器游戏帮助您练习你的乘法口诀表!  @@ -479,7 +451,6 @@ adventures: {else} {print} '回答错误。正确答案是' 正确答案 ``` - start_code: '# 在这里写你的代码' 11: story_text: | 使用 `{for}`你可以简化乘法运算表的程序。 @@ -495,10 +466,6 @@ adventures: {for} i {in} {range} 1 {to} 10 {print} i * 数字 ``` - start_code: | - 数字 = 10 - {for} i {in} {range} 1 {to} 10 - {print} i *数字 12: story_text: | 在本关,你可以编写一个可以计算小数的计算器。 @@ -517,7 +484,6 @@ adventures: answer =_ {print} number1 ' 加 ' number2 ' 是 ' _ ``` - start_code: '# 在这里写你的代码' 13: story_text: | ### 练习1 @@ -534,7 +500,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# 在这里写下你的代码' 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. @@ -559,11 +524,7 @@ adventures: 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 @@ -595,7 +556,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# 在这里写你的代码' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -644,17 +604,6 @@ adventures: {clear} {print} '惊喜!' ``` - start_code: | - {print} '3' - {sleep} - {clear} - {print} '2' - {sleep} - {clear} - {print} '1' - {sleep} - {clear} - {print} '惊喜!' debugging: name: 调试 default_save_name: 调试 @@ -677,8 +626,7 @@ adventures: {print} 你的爱好是什么? {echo} 你的爱好是 ``` - start_code: | - {print} 我喜欢编程 + 你也喜欢编程吗? {echo} {print} 你的爱好是什么? @@ -821,19 +769,7 @@ adventures: 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: @@ -919,8 +855,7 @@ adventures: price =amount*6 {print} '这将是'价格美元'' ```` - start_code: | - {print} '欢迎来到我们的三明治店' + amount “您想买多少个三明治?” {repeat}amount{times} {ask} {is} {ask} '您想要什么类型的三明治或面包?' @@ -990,8 +925,7 @@ adventures: for i in 1 range 1 to days print month i ```` - start_code: | - print '海蒂日历' + months_with_31_days = 一月、三月、五月、七月、九月、十月、十二月 months_with_30_days = 四月、六月、八月、十一月 months = 问“您想查看哪个月份?” @@ -1038,27 +972,6 @@ adventures: for i in range 0 to people call greet_costumer ``` - start_code: | - define greet - greetings = '你好', '嗨', '晚上好' - print greetings at random - - define take_order - food = ask '你想吃什么?' - print '哪种食物' - drink = '你想喝什么?' - print '哪种 ' drink - more = ask '你还想要点别的吗?' - if more is '不' - print '好吧' - else - print '还有 ' more - print '多谢' - - print '欢迎来到我们的餐厅' - people = ask '今晚你们聚会中有多少人?' - for i in range 0 to people - call greet_costumer 13: story_text: |- ### 练习 @@ -1091,8 +1004,7 @@ adventures: else print “没问题!” ``` - start_code: | - defin movie_recommendation with name + action_movies ==“虎胆龙威”、“速度与激情”、“无耻混蛋” romance_movies =“真爱至上”、“恋恋笔记本”、“泰坦尼克号” comedy_movies = '憨豆先生' '芭比' '死侍' @@ -1145,9 +1057,7 @@ adventures: else '没问题' ``` - start_code: | - define calculate_heartbeat - print '将指尖轻轻按在脖子一侧' + print '(就在你的下巴线下方)' print '记录 15 秒内你感觉到的节拍数' beats == ask '15 秒内您感觉有多少节拍?' @@ -1384,14 +1294,12 @@ adventures: 这在第 2 级中发生了变化。在第 2 级中,您将学习如何使用变量,它允许您保存多条信息并将其打印在您想要的任何位置。 那么让我们转到下一个选项卡! - start_code: '{print} 你好世界!' 3: story_text: | 在上一关中,您已经了解了变量是什么以及如何使用它来使您的冒险更具互动性。 但是...这并不是您可以使用变量做的唯一事情! 您还可以使用变量来创建列表。 您甚至可以让 Hedy 从列表中随机选择一个单词,这样您就可以制作真正的游戏! 快速浏览下一个选项卡! - start_code: '{print} 你好世界!' 4: story_text: | 在前面的级别中,您一直在练习变量,但您可能遇到过这个问题。 @@ -1411,9 +1319,6 @@ adventures: 名字{is}苏菲 {print} 我的名字是名字 ```` - start_code: | - 名字{is}苏菲 - {print} 我的名字是名字 5: story_text: | 在前面的级别中,您已经学会了使用`{at} {random}`,这使得您每次运行代码时的游戏都不同。 @@ -1425,9 +1330,6 @@ adventures: ```` 密码 {is} {ask} '正确的密码是什么?' ```` - start_code: |- - 名字 {is} {ask} '你的名字是什么?' - {if} 名字 {is} 海蒂 {print} '酷!' {else} {print} '呵呵' 6: story_text: | 在上一级别中,您已经练习了`{ask}`和`{if}`。 例如,您可以询问客人想吃什么。 @@ -1478,7 +1380,6 @@ adventures: ```` {repeat} 5 {times} {print} '在下一个选项卡中,您可以一次重复多行代码!' ```` - start_code: '{print} ''让我们转到下一个选项卡!''' 9: story_text: | 做得好! 您已达到另一个新水平! 在上一级别中,您学习了如何在 {if} 或 {repeat} 命令中使用多行代码。 但你还不能将两者结合起来...... @@ -1514,20 +1415,14 @@ adventures: story_text: | 你已经达到11级了,你做得很好! 在更高级别中, 海蒂 越来越专注于教您编程语言 Python。 Python 中没有`{repeat}`命令,但有一个类似于 {repeat} 的命令。 您是否想知道如何用 Python 语言表达`{repeat}`? 赶紧去了解一下吧! - start_code: '{print} ''让我们转到下一个选项卡!''' 12: story_text: | 也许您在餐厅冒险中尝试过使用十进制数字。 如果你这样做了,你可能会注意到海蒂还不明白它们并且总是四舍五入。 从这个级别开始,您可以使用十进制数字。 example_code: | ``` - burger=5 - drink=2 - total = burger + drink - print '您点了一份汉堡和一杯饮料' - print '总共花费'total'美元' + {print} 2.5 + 2.5 ``` - start_code: '{print} ''让我们转到下一个选项卡!''' 13: story_text: | 在前面的级别中,您学习了如何将两个`{if}`命令彼此放在一起。 这工作得很好,但它确实会给你带来非常长且不方便的代码,如下所示: @@ -1547,7 +1442,11 @@ adventures: {else} {print} '访问被拒绝!' ``` - start_code: '{print} ''让我们转到下一个选项卡!''' + ``` + 年龄 = {ask} '你的年龄是多少? ' + {if} 名字 {is} '海蒂' {and} 年龄 {is} 2 + {print} '你才是真正的海蒂!' + ``` 14: story_text: | 使用以下程序,您可以计算出您在学校的主题(因此,六个或更高的等级)。 @@ -1583,7 +1482,6 @@ adventures: {if} answer == '是' {print} '好的,我们继续' ``` - start_code: '{print} ''让我们转到下一个选项卡!''' 16: story_text: | 在这个级别中,我们将更加接近真正的 Python 代码。 您还将学习如何将两个列表匹配在一起。 @@ -1612,7 +1510,6 @@ adventures: story_text: | 恭喜! 您已到达 Hedy 的最后一关! 您在此处创建的代码可以复制到真实的 Python 环境(例如 replit 或 PyCharm),并且您可以在那里继续学习! 但请注意,Python 只能读取英文命令,因此如果您一直在使用其他语言,则现在需要切换到英文。 - start_code: '{print}(''干得好!!!'')' dice: name: 骰子 default_save_name: 骰子 @@ -1707,7 +1604,6 @@ adventures: {print} 玩家 '投出了' 选项 {at} {random} {sleep} ``` - start_code: '# 在这里写你的代码' 15: story_text: | ### Exercise @@ -1732,7 +1628,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# 在这里写你的代码' dishes: name: 洗碗? default_save_name: 洗碗 @@ -1842,11 +1737,6 @@ adventures: {for} 日期 {in} 日期们 {print} 名字们 {at} {random} '负责在' 日期 '洗碗' ``` - start_code: | - days=周一、周二、周三、周四、周五、周六、周日 - names=妈妈、爸爸、艾玛、苏菲 - {for} day {in} days - {print} names {at} {random} ' 在 ' day '洗碗' elif_command: name: '{elif}' default_save_name: elif @@ -1894,10 +1784,6 @@ adventures: {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: |- 在本关中,我们增加了一种新的`{for}`形式。在前面的关卡中,我们将`{for}`用于列表,我们也可以将`{for}`用于数字。 @@ -1910,10 +1796,6 @@ adventures: {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: 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. @@ -1952,7 +1834,6 @@ adventures: ### 练习 将示例代码复制到你的输入屏幕上,并填入空白处,使代码生效。 **另外**改变代码,让魔法师不仅能算出你的名字,还能算出你的年龄、你最喜欢的运动队或其他关于你的事情。 - start_code: '# 在这里写下你的代码' 3: story_text: | 在上一级,你创造了你的第一台算命机器,但海蒂不会算任何东西,只会“{echo}”。 @@ -1970,7 +1851,6 @@ adventures: story_text_2: | ### 练习 现在,海蒂 只能回答是、否或也许。 你能给 Hedy 更多的答案选项吗,比如“肯定”或“再问一次”。 - start_code: '# 在这里写你的代码' 4: story_text: | 此级别没有新功能,但允许您练习使用引号。 @@ -1995,7 +1875,6 @@ adventures: {sleep} 2 {print} 答案 {at} {random} ``` - start_code: '# 在这里写下你的代码' 5: story_text: | ### 练习 @@ -2019,7 +1898,6 @@ adventures: {if} person {in} friends {print} good_answer {at} {random} {else} {print} bad_answer {at} {random} ``` - start_code: '# 在这里写下你的代码' 6: story_text: | 在本级中,作为一个算命仙你可以用数学帮你算命。这使你可以编造(傻傻的)公式来算命。 @@ -2042,7 +1920,6 @@ adventures: {sleep} {print} kids ' kids!' ``` - start_code: '# 在这里写下你的代码' 7: story_text: | ### 练习 @@ -2055,7 +1932,6 @@ adventures: 回答=是,否,有可能 {repeat} 3 {times} {print} '我掐指一算...' 回答 {at} {random} ``` - start_code: '# 在这里写下你的代码' 8: story_text: | 在前几级中,你已经学会了如何使用一行`{repeat}`命令 ,让算命仙连续回答3个问题,但我们在打印问题时遇到了问题。 @@ -2075,7 +1951,6 @@ adventures: {sleep} {print} '我掐指一算...' 答案 {at} {random} ``` - start_code: '# 在这里写下你的代码' 10: story_text: | 在此级中,你将学习如何为MASH(豪宅、公寓、棚屋、别墅)游戏编程。在这个游戏中,你可以一次为所有玩家预测他们的未来的住宅是什么样子的。 @@ -2094,7 +1969,6 @@ adventures: {print} 名字 ' 将得到一个 ' 宠物 {at} {random} ' 作为他们的宠物。' {sleep} ``` - start_code: '# 在这里写下你的代码' 12: story_text: | 在这个关卡中,你可以用多个字来算命。你可以将不同的命运加入列表中吗? @@ -2106,7 +1980,6 @@ adventures: {sleep} {print} 命运 {at} {random} ``` - start_code: '# 在这里写下你的代码' functions: name: functions default_save_name: functions @@ -2146,21 +2019,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2189,13 +2047,6 @@ adventures: {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. @@ -2219,17 +2070,6 @@ adventures: 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 @@ -2258,7 +2098,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: 哈利·波特 default_save_name: 哈利·波特 @@ -2280,7 +2119,6 @@ adventures: _ {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: 鬼屋 default_save_name: 鬼屋 @@ -2359,7 +2197,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# 将你的代码写在这里' 4: story_text: | ##鬼屋 @@ -2377,7 +2214,6 @@ adventures: {sleep} {print} 怪物们{at} {random} ``` - start_code: '# 将你的代码写在这里' 5: story_text: | 在这一关之前,鬼屋游戏总是要求玩家选择一扇门,但你可能已经注意到了,他们并不是真的要正确回答。 @@ -2399,7 +2235,6 @@ adventures: _ _ _ _ {print} ‘干得漂亮!你成功逃出去了!’ {else} {print} ‘哦 不!你要被一个...'怪物 {at} {random}'吃掉了 ``` - start_code: '# 将你的代码写在这里' 9: story_text: | 在这一关中,你可以使用嵌套,这可以让你的鬼屋变得更有互动性! @@ -2483,7 +2318,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2517,7 +2351,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2548,18 +2381,7 @@ adventures: {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?' @@ -2598,10 +2420,6 @@ adventures: _ _ _ 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... @@ -2618,11 +2436,6 @@ adventures: {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. @@ -2638,16 +2451,6 @@ adventures: {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 @@ -2676,11 +2479,6 @@ adventures: _ 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 @@ -2706,10 +2504,6 @@ adventures: 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: @@ -2718,8 +2512,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2751,8 +2544,7 @@ adventures: {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} @@ -2775,7 +2567,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# 在这里写下你的代码' 16: story_text: | ### Exercise @@ -2796,7 +2587,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# 在这里写下你的代码' maths: name: maths default_save_name: maths @@ -2836,8 +2626,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: 鹦鹉 @@ -2865,8 +2654,7 @@ adventures: {ask} _ {echo} {echo} - start_code: | - {print}我是鹦鹉海蒂 + {ask}你的名字是什么? {echo} {echo} @@ -2898,7 +2686,6 @@ adventures: {print} 🧒 新词,说 新词! {print} 🦜 词汇表 {at} {random} ``` - start_code: '# 在这里写你的代码' 4: story_text: "在这一级中,我们必须在`{ask}` 和`{print}` 的命令中使用引号。\n### 练习 \n在空白处填上引号,完成代码。\n" example_code: | @@ -2910,7 +2697,6 @@ adventures: {print} _ 🧒 Say _ 新词 _, 海蒂 _ {print} _ 🦜 _ 词汇表 {at} {random} ``` - start_code: '# 在这里写下你的代码' 5: story_text: | 如果你的鹦鹉说出了正确的词,给它一些奖励! @@ -2927,7 +2713,6 @@ adventures: _说了的词 {is} 新词 _ '🧒 干得好!海蒂!🍪' _ _'🧒 不对,海蒂!说' 新词 ``` - start_code: '# 在这里写你的代码' piggybank: name: 小猪银行 default_save_name: 小猪银行 @@ -2948,7 +2733,6 @@ adventures: 周数 = 需要_再存/ 零花钱 {print} '你可以在'周数'周内买一个'愿望'。' ``` - start_code: '# 将你的代码写在这里' 14: story_text: | ### Exercise @@ -2972,7 +2756,6 @@ adventures: {call} calculate_budget with _, _, _ ``` - start_code: '# place your code here' pressit: name: 按键 default_save_name: 按下 @@ -3001,7 +2784,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# 在此处键入代码' 7: story_text: | 现在你已经了解了`{repeat}` ,我们可以多次按下按键!你可以用它来使海龟向前走和转弯。 @@ -3012,11 +2794,9 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# 把你的代码放在这里' 9: story_text: "现在你知道了如何组合不同的语句,你可以用`{pressed}`创建一个触摸式工具。 \n\n### 练习\n完成这段代码。每一次都随机选择一个字母,你必须按下对应的按键。按对了可以得一分,按错了扣两分。\n" example_code: "```\n积分们 = 0\n字母们 = a, b, c, d, e\n{repeat} 10{times}\n 字母 = _ _ _ \n {print} '按下字母' 字母\n {if} 字母{is} {pressed}\n _\n _\n _\n```\n" - start_code: '# 把你的代码放在这里' print_command: name: '{print}' default_save_name: print @@ -3042,8 +2822,6 @@ adventures: ``` _ 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. @@ -3060,8 +2838,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: 测验人员 @@ -3093,7 +2870,6 @@ adventures: {if} points_b > points_a {print} 'You belong to the B club' ``` - start_code: '# 在这里写下你的代码' quotation_marks: name: '''quotation marks''' default_save_name: quotation_marks @@ -3123,10 +2899,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3161,10 +2933,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3198,9 +2966,6 @@ adventures: 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. @@ -3249,11 +3014,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3267,10 +3027,6 @@ adventures: {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! @@ -3285,13 +3041,6 @@ adventures: {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 @@ -3317,10 +3066,6 @@ adventures: 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? @@ -3338,11 +3083,6 @@ adventures: _ {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: 餐厅 default_save_name: 餐厅 @@ -3366,7 +3106,6 @@ adventures: 然后在餐厅程序中至少再添加 4 行代码。 询问顾客他们想喝什么,并询问他们是否愿意用现金或信用卡支付。 最后,想出一个与顾客说再见的好方法。 - start_code: '# 在这里写你的代码' 2: story_text: | 在第 2 关你可以使用变量来扩展你的餐厅。在第 1 关 海蒂只能 {echo} 订单一次,并记住最后一个点的东西。 @@ -3391,7 +3130,6 @@ adventures: 现在让你的顾客添加食物和饮料的订单概要。 **另外** 现在你已经学会了如何使用变量,你可以根据需要在一行中使用任意数量的变量。你能在你的代码中添加更多变量,比如堂食或外卖,现金或银行卡支付,要或不要吸管等? - start_code: '# 将代码写在这里' 3: story_text: | 在选择晚饭吃什么时选择困难了吗?你可以让海蒂帮你选! @@ -3415,7 +3153,6 @@ adventures: 价格 {is} _ _ ``` - start_code: '# 在这里写你的代码' 4: story_text: | 在此级别中,使用 `{print}` 或 `{ask}` 命令时必须使用引号。 @@ -3435,7 +3172,6 @@ adventures: {print} '谢谢您的点单。' {print} '您的' 食物 '和' 饮料 '马上就来!' ``` - start_code: '# 在这里写你的代码' 5: story_text: | 在这一级,你可以用`{if}`命令向顾客`{ask}`,并对其回答做出不同的回应。 @@ -3457,7 +3193,6 @@ adventures: {if} 别的 {is} 不用 {print} '就是这些' {else} {print} '一份' 别的 {print} '谢谢您的点单。祝您用餐愉快!' ``` - start_code: '# 在这里写你的代码' 6: story_text: | 在这一关,你可以用数学计算客人的订单总价,这会让你的虚拟餐厅更真实。 @@ -3476,7 +3211,6 @@ adventures: {print} '请付' 价格 '元' {print} '谢谢,祝您用餐愉快!' ``` - start_code: '# 在这里写你的代码' 7: story_text: | 在本关中,你已经学会了如何使用`{repeat}`命令来重复一行代码一定的次数。 @@ -3490,7 +3224,6 @@ adventures: {print} '欢迎来到海蒂餐厅!' 人数 = {ask} '今天来了多少人?' ``` - start_code: '# 在这里写你的代码' 8: story_text: | 在这一关,你可以通过重复多行代码,让你的虚拟餐厅更加细化。像这样: @@ -3509,7 +3242,6 @@ adventures: ### 练习 这个代码可以用菜单上的更多项目来扩展,例如,提供饮料,和、或多道菜或甜点。至少增加一个项目。 **(另外)** 添加更多的项目,只要你喜欢,有多少选择都可以! - start_code: '# 在这里写你的代码' 9: story_text: "在这一级,你可以用嵌套让你的餐厅更真实更有趣!\n\n### 练习 \n范例代码中删除了缩进。 \n你能算出每行需要多少缩进才能使代码正常工作吗? \n如果顾客点了披萨,海蒂不应该问顾客想要哪种蘸酱。 \n\n**(另外)** 餐厅不会准备所有的蘸酱。列出一个可用的蘸酱的清单,并在每个订单中回复是否有存货。
\n**(另外)** 披萨有配料。询问顾客他们想要哪一种配料。
\n**(另外)** 顾客想喝一杯饮料吗?也问问他们!
\n" example_code: | @@ -3534,7 +3266,6 @@ adventures: {print} '一共' 价格 '元' {print} '祝您用餐愉快!' ``` - start_code: '# 在这里写你的代码' 10: story_text: | 在本级别中,你将学习如何轻松地询问不同课程的订单。 @@ -3573,7 +3304,6 @@ adventures: {print} '所以你想为'人数'人下单。' {print} '我们走吧!' ``` - start_code: '# 在这里写你的代码' 12: story_text: | 从这一层开始,你可以使用小数点后的数字来使你的菜单更加真实。 @@ -3595,11 +3325,9 @@ adventures: 价格 = 价格 + 2.35 {print} '请付' 价格 '元' ``` - start_code: '# 在这里写你的代码' 13: story_text: "在这一级,我们可以用新的命令来升级我们的餐厅。\n我们用`{and}`来判断 {if} 命令中的两个条件是否同时成立。\n \n ### 练习 \n在右边的空白处填写`{and}`和`{or}` 。\n" example_code: "```\n价格 = 10\n食物 = {ask} '您想吃什么?'\n饮料们 = {ask} '您想喝什么?'\n{if}食物 {is} '三明治'_ 饮料们 {is} '果汁'\n {print} '这是我们的优惠套餐'\n 价格 = 价格 - 3\n{if}饮料们{is} '果汁' _饮料们{is} '矿泉水'。 \n {print} '你的选择真健康!\n {print} '一共' 价格 '元'\n```\n" - start_code: '# 在这里写你的代码' 15: story_text: | 通过`{while}`命令,你可以确保你的客人能不断追加点单,直到点完。 @@ -3615,7 +3343,6 @@ adventures: 还有 = {ask} '您还要点别的吗?' {print} '谢谢惠顾!' ``` - start_code: '# 在这里写你的代码' rock: name: 石头剪刀布 default_save_name: 石头 @@ -3653,7 +3380,6 @@ adventures: _ {is} {ask} 石头、剪刀还是布? {print}我选择 _ ``` - start_code: '# 在这里写你的代码' 3: story_text: | 在这一级,我们可以输入列表并从列表中选择。 @@ -3726,7 +3452,6 @@ adventures: {print} '你输了!' # 完成这段代码 ``` - start_code: '# 在这里写你的代码' 10: story_text: | 你觉得自己太懒了,不想自己玩游戏?让海蒂帮你玩吧! @@ -3746,7 +3471,6 @@ adventures: {for} 玩家 {in} 玩家们 {print} 玩家 '选择' 选项 {at} {random} ``` - start_code: '# 在这里写你的代码' 13: story_text: | 你可以用`{and}`命令缩短你的石头剪刀布代码!阅读下面的示例代码,并尝试完成它。 @@ -3765,7 +3489,6 @@ adventures: {print} '电脑赢了!' _ ``` - start_code: '# 在这里写你的代码' 15: story_text: | 玩到你打败电脑为止!但首先,你要补全示例代码…… @@ -3787,7 +3510,6 @@ adventures: 赢 = '是' _ ``` - start_code: '# 在这里写你的代码' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3804,7 +3526,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: 超级间谍 default_save_name: 超级间谍 @@ -3831,7 +3552,6 @@ adventures: b = '今天10.00' {print} a + b ``` - start_code: '# 在这里写下你的代码' 13: story_text: | 你能在空白处填上正确的命令吗?注意:超级间谍必须同时回答正确两个问题,然后才能获取机密情报! @@ -3844,7 +3564,6 @@ adventures: {else} {print} '10.00去火车站' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3860,10 +3579,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: 唱支歌! default_save_name: 歌 @@ -3902,7 +3617,6 @@ adventures: {repeat} _ _{print} '小鲨鱼图图图杜杜' {print} '小鲨鱼' ``` - start_code: '{print} ''小鲨鱼''' 8: story_text: | 在上一级中,你已经为歌曲 "啤酒瓶"编写了程序。但由于没有`{repeat}` ,你不得不多次复制一段歌词。 @@ -3920,7 +3634,6 @@ adventures: 歌词 = 歌词 - 1 {print} 歌词 '瓶啤酒在墙上' ``` - start_code: '# 在这里写你的代码' 10: story_text: | 使用`{for}`,你只需6行即可打印整首小鲨鱼的歌曲(包括家庭中的所有其他鲨鱼)! @@ -3937,7 +3650,6 @@ adventures: ``` 猴子们 = 5, 4, 3, 2, 1 ``` - start_code: '# 在这里写你的代码' 11: story_text: | 在这一级,你可以同时使用`{for}` 和`{range}`命令 ,做一些使用计数的歌曲,如5只小猴子们。 @@ -3953,7 +3665,6 @@ adventures: {print} 猴子们 ‘小猴子们在床上跳来跳去’ _ ``` - start_code: '# 把你的代码放在这里' 12: story_text: "在这首歌中,我们可以使编程变得更加容易 '如果你很快乐,你意识到了,拍拍你的手'。因为我们可以把所有的动作放在一个变量中,看看吧。\n \n### 练习 \n你能在每一行中加入适量的缩进,使歌曲正确播放吗? \n注意:不是所有的行都需要缩进\n" example_code: | @@ -3967,7 +3678,6 @@ adventures: _ {print} '如果你快乐并意识到它' _ {print} 动作 ``` - start_code: '# 把你的代码放在这里' 13: 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? @@ -3984,16 +3694,6 @@ adventures: {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: | 在这一级中,你可以更快速地编排一首像《老麦当劳》这样的歌曲。你可以把正确的动物和正确的声音联系起来,只要把它们放在列表的同一位置。 @@ -4026,7 +3726,6 @@ adventures: {print} '头昏脑涨的睁开眼' {print} '一大清早' ``` - start_code: '# 把你的代码放在这里' 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. @@ -4048,7 +3747,6 @@ adventures: {print} 'way hay and up she rises' {print} '凌晨' ``` - start_code: '# 在此处键入代码' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4070,15 +3768,6 @@ adventures: {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 @@ -4146,7 +3835,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# 在这里写下你的代码' 14: 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. @@ -4209,7 +3897,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4271,7 +3958,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4358,7 +4044,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: 海龟 default_save_name: turtle @@ -4383,9 +4068,6 @@ adventures: {turn} {left} {forward} 20 ``` - start_code: |- - {forward} 50 - {turn} {left} 2: story_text: | 在这一级,你可以使用变量来使海龟互动。例如,你可以问玩家海龟必须走多少步。 @@ -4428,10 +4110,6 @@ adventures: {turn} 角度 {at} {random} {forward} 25 ``` - start_code: |- - 角度 {is} 10, 50, 90, 150, 250 - {turn} 角度 {at} {random} - {forward} 25 4: story_text: | 在第4级,你必须在`{print}`和`{ask}`语句中使用引号。在画画时也一样! @@ -4458,11 +4136,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} '绘图' - 角度 {is} 90 - {turn} 角度 - {forward} 25 5: story_text: | 在第5级,你可以用`{if}`来做出选择。比如选择不同类型的图案。 @@ -4495,8 +4168,7 @@ adventures: {if} 方向 {is} 右 {turn} _ {forward} 100 ``` - start_code: |- - {print} '绘图' + 图形 {is} {ask} '你想要一个正方形还是三角形?' {if} 图形 {is} 三角形 角度 {is} 120 {else} 角度 {is} 90 {turn} 角度 @@ -4524,7 +4196,6 @@ adventures: {forward} 50 {turn} 角度 ``` - start_code: '{print} ''绘图''' 8: story_text: "现在我们能重复多行了,可以更容易地画图。\n我们只需要设置一下角度,然后在`{repeat}`中使用这个变量。\n\n### 练习1 \n用这个代码范例画了一个正方形。改变代码,使其画另一个图形,如一个三角形或一个六边形。 \n这需要对两行代码进行修改。\n 提示:一个完整的圆是360度。\n \n ### 练习2 \n现在画一个至少由两个多边形组成的图形。\n" example_code: | @@ -4564,7 +4235,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '#将你的代码放在这里' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4582,7 +4252,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4607,16 +4276,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4632,7 +4291,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4643,7 +4301,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4654,7 +4311,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4672,7 +4328,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4691,7 +4346,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4711,7 +4365,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4722,7 +4375,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4735,7 +4387,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4766,7 +4417,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4807,7 +4457,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -4830,7 +4479,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -4859,7 +4507,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -4883,7 +4530,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -4911,7 +4557,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -4945,7 +4590,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -4965,11 +4609,6 @@ adventures: answer = {ask} '5重复5次是多少?' {print} '一个正确的回答给出' ``` - start_code: |- - answer = 0 - {while} answer != 25 - answer = {ask} '5重复5次是多少?' - {print} '一个正确的回答给出' years: name: 新年 default_save_name: 新年倒计时 @@ -4987,4 +4626,3 @@ adventures: {print} 数字 {print} '新年快乐!' ``` - start_code: '# 在这里写你的代码' diff --git a/content/adventures/zh_Hant.yaml b/content/adventures/zh_Hant.yaml index 8578ed5646c..38541b2b593 100644 --- a/content/adventures/zh_Hant.yaml +++ b/content/adventures/zh_Hant.yaml @@ -23,7 +23,6 @@ adventures: story_text_2: | ### Exercise Can you make your own story in Hedy now by using `{print}` , `{ask}` and `{echo}`? - start_code: '{print} Your story starts here' 2: story_text: | In level 2 you can make your story more fun. Your main character's name can now be anywhere in the sentence. @@ -52,7 +51,6 @@ adventures: 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: @@ -84,7 +82,6 @@ adventures: 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. @@ -99,7 +96,6 @@ adventures: {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. @@ -123,7 +119,6 @@ adventures: {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 a story, someone says words several times. For example, when someone calls for help or sings a song. @@ -137,7 +132,6 @@ adventures: {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! @@ -158,7 +152,6 @@ adventures: {print} 'But Richard is too slow...' {print} 'The T-rex closes in and eats him in one big bite!🦖' ``` - start_code: '# place your code here' 9: story_text: | In this level you can use nesting to put `{if}`, `{repeat}` or `{for}` commands inside other `{if}`, `{repeat}` or `{for}` commands. This gives you many options and really helps you to make your story interactive. @@ -177,7 +170,6 @@ adventures: {else} {print} 'Robin goes home' ``` - start_code: '# place your code here' 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'. @@ -194,7 +186,6 @@ adventures: {print} 'What do you see?' {print} 'I see all the animals looking at me!' ``` - start_code: '# place your code here' 12: story_text: In this level you can use the quotation marks to save multiple words in a variable. example_code: | @@ -202,7 +193,6 @@ adventures: name = 'The Queen of England' {print} name ' was eating a piece of cake, when suddenly...' ``` - start_code: '# place your code here' 13: story_text: | By using the `{and}` and `{or}` commands, you can shorten your stories. For example, check out the dragon story. @@ -235,7 +225,6 @@ adventures: {print} 'This could come in very handy' sword = 'found' ``` - start_code: '# place your code here' 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. @@ -258,7 +247,6 @@ adventures: {print} 'Nope they are not at the ' location {print} 'Now you can enter the house!' ``` - start_code: '# place your code here' 18: story_text: | We are going to print another story, but now we have to use brackets with `{print}`. @@ -279,7 +267,6 @@ adventures: naam = {input}("What's your name?") {print}('Welcome to this story!') ``` - start_code: '# Schrijf jouw code hier' add_remove_command: name: '{add} {to} & {remove} {from}' default_save_name: add_remove_command @@ -319,13 +306,6 @@ adventures: _ {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 @@ -343,11 +323,6 @@ adventures: {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 @@ -380,10 +355,6 @@ adventures: _ How are you doing? _ ``` - start_code: | - {print} Hello! - {ask} What is your name? - {echo} hello 2: story_text: | ## The ask command @@ -411,11 +382,6 @@ adventures: 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: The final change we will need to make to get Python code is changing `{ask}` into `{input}`. example_code: | @@ -527,7 +493,6 @@ adventures: {elif} points > dealer_points {and} points < 21: {print} 'You win!' ``` - start_code: '# place your code here' calculator: name: Calculator default_save_name: Calculator @@ -564,7 +529,6 @@ adventures: given_answer = 'What is ' number_1 ' times ' number_2 '?' {if} _ {else} _ - start_code: '{print} ''Welcome to this calculator!''' 9: story_text: | In previous levels you've learned how to make a calculator, in this level you can expand that code and make it into a little maths game. @@ -585,7 +549,6 @@ adventures: 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! @@ -603,7 +566,6 @@ adventures: {else} {print} 'Thats wrong. The right answer is ' correct ``` - start_code: '# place your code here' 11: story_text: | With a `{for}` you can simplify tables of multiplication practise program. @@ -619,7 +581,6 @@ adventures: {for} i {in} {range} 1 to 10 {print} i * number ``` - start_code: '# place your code here' 12: story_text: | Now you can make a calculator that works for decimal numbers. Fill in the blanks to get it to work properly! @@ -630,7 +591,6 @@ adventures: answer = _ {print} number1 ' plus ' number2 ' is ' answer ``` - start_code: '# place your code here' 13: story_text: | ### Exercise 1 @@ -647,7 +607,6 @@ adventures: {if} _ _ _ _ _ _ _ {print} _ ``` - start_code: '# Schrijf jouw code hier' 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. @@ -672,11 +631,7 @@ adventures: 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 @@ -708,7 +663,6 @@ adventures: _ {print} 'You win!' ``` - start_code: '# place your code here' calculator_2: name: Calculator 2 default_save_name: Calculator 2 @@ -757,17 +711,6 @@ adventures: 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 @@ -790,12 +733,6 @@ adventures: {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. @@ -815,14 +752,6 @@ adventures: {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: |- Welcome to a debugging adventure. Debugging a code means getting rid of mistakes in the code. @@ -844,16 +773,6 @@ adventures: 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 @@ -868,13 +787,6 @@ adventures: {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 @@ -897,17 +809,7 @@ adventures: {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' @@ -934,19 +836,7 @@ adventures: 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: @@ -962,11 +852,6 @@ adventures: 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 @@ -991,10 +876,7 @@ adventures: {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} @@ -1031,19 +913,7 @@ adventures: 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: @@ -1058,11 +928,6 @@ adventures: {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: story_text: |- ### Exercise @@ -1102,26 +967,6 @@ adventures: 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 @@ -1150,27 +995,6 @@ adventures: 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 @@ -1203,31 +1027,6 @@ adventures: 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: story_text: |- ### Exercise @@ -1257,9 +1056,7 @@ adventures: 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?' @@ -1316,36 +1113,6 @@ adventures: 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 @@ -1505,11 +1272,9 @@ adventures: ``` story_text_2: | `{print}` 仍然可以正常執行,但 `{ask}` 命令已更改。 您還需要在 `{ask}` 命令中使用變數,像這樣: - start_code: '{print} hello world!' 3: story_text: | In level 3 you can make a list. You can let the computer choose something random from the list. You do that with `{at} {random}`. - start_code: '{print} hello world!' 4: story_text: | In level 4 `{ask}` and `{print}` have changed. @@ -1525,7 +1290,6 @@ adventures: answer {is} {ask} 'What do we need to use from now on?' {print} 'We need to use ' answer ``` - start_code: '{print} ''Hello world''' 5: story_text: | In level 5 there is something new, the `{if}`! With the `{if}` you can choose between two different options. @@ -1536,9 +1300,6 @@ adventures: name {is} {ask} 'what is your name?' {if} name {is} Hedy {print} 'nice' {else} {print} 'boo!' ``` - 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. @@ -1561,7 +1322,6 @@ adventures: ``` {repeat} 3 {times} {print} 'Hedy is fun!' ``` - start_code: '{repeat} 3 {times} {print} ''Hedy is fun!''' 8: story_text: | `{ask}` and `{print}` still work as you know them. But `{if}`, `{else}`, {pressed} and `{repeat}` have changed! @@ -1585,10 +1345,6 @@ adventures: {print} 'INTRUDER!' {print} 'You cannot use this computer!' ``` - start_code: |- - {repeat} 5 {times} - {print} 'Hello folks' - {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! @@ -1603,13 +1359,6 @@ adventures: {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' 10: story_text: |- In this level we learn a new code called `{for}`. With `{for}` you can make a list and use all elements. @@ -1620,17 +1369,10 @@ adventures: {for} animal {in} animals {print} 'I love ' animal ``` - start_code: |- - animals {is} 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. 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: |- - {for} counter {in} {range} 1 {to} 5 - {print} counter 12: story_text: |- **Decimal numbers** @@ -1640,8 +1382,7 @@ adventures: {print} 'Two and a half plus two and a half is...' {print} 2.5 + 2.5 ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 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 @@ -1653,11 +1394,6 @@ adventures: {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!' 14: story_text: | We are going to learn more new items. You might know them already from mathematics, the `<` and `>`. @@ -1672,8 +1408,7 @@ adventures: {if} age > 12 {print} 'You are older than I am!' ``` - start_code: |- - age = {ask} 'How old are you?' + {if} age < 13 {print} 'You are younger than me!' {else} @@ -1692,11 +1427,6 @@ adventures: 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' 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. @@ -1726,9 +1456,8 @@ adventures: {print} i {print} 'Ready or not, here I come!' 18: - story_text: We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. - start_code: |- - name = 'Hedy' + story_text: |- + We arrived at real Python code! That means we need to use parentheses with {print} and {range} from now on. {print}('My name is ', name) dice: name: Dice @@ -1756,12 +1485,10 @@ adventures: ``` choices {is} _ ``` - start_code: '{print} What will the die indicate this time?' 4: story_text: | In this level we can make sentences with the die value in the sentence, with quotes of course. This time the sample code is not quite complete. Can you finish the code? - start_code: '{print} ''What will the die indicate this time?''' 5: story_text: | You can also make a die again in this level using the `{if}`. @@ -1775,7 +1502,6 @@ adventures: {print} 'you have' _ 'thrown' {if} _ {is} earthworm {print} 'You can stop throwing.' _ {print} 'You have to hear 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. @@ -1795,7 +1521,6 @@ adventures: ``` example_code_2: | Did you manage to calculate the score for 8 dice? That required a lot of cutting and pasting, right? We are going to make that easier in level 7! - start_code: '{print} ''What will the die indicate this time?''' 7: story_text: | You can also make a die again in level 5. With the `{repeat}` code you can easily roll a whole hand of dice. @@ -1807,7 +1532,6 @@ adventures: choices = 1, 2, 3, 4, 5, earthworm {repeat} _ _ {print} _ _ _ ``` - start_code: '{print} ''What will the die indicate this time?''' 10: story_text: | Is everybody taking too long throwing the dice? In this level you can let Hedy throw all the dice at once! @@ -1820,7 +1544,6 @@ adventures: {print} player ' throws ' choices {at} {random} {sleep} ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -1845,7 +1568,6 @@ adventures: _ {print} 'Yes! You have thrown 6 in ' tries ' tries.' ``` - start_code: '# place your code here' dishes: name: Dishes? default_save_name: Dishes @@ -1863,7 +1585,6 @@ adventures: ``` story_text_2: | 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: story_text: | With quotation marks you can make your dishwashing planning more beautiful. @@ -1879,7 +1600,6 @@ adventures: {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. @@ -1887,7 +1607,6 @@ adventures: 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: "```\npeople {is} mom, dad, Emma, Sophie\ndishwasher {is} people {at} {random}\n{if} dishwasher {is} Sophie {print} _ too bad I have to do the dishes _ \n{else} {print} 'luckily no dishes because' _ 'is already washing up'\n```\n" - start_code: '{print} ''Who does the dishes?''' 6: story_text: | How often is everyone going to do the dishes? Is that fair? You can count it in this level. @@ -1920,7 +1639,6 @@ adventures: {remove} dishwasher {from} people dishwasher = people {at} {random} ``` - start_code: '{print} ''Who does the dishes?''' 7: story_text: | With the `{repeat}` you can repeat pieces of code. You can use this to calculate who will be washing dishes for the entire week. @@ -1929,7 +1647,6 @@ adventures: people = mom, dad, Emma, Sophie {repeat} _ _ {print} 'the dishwasher is' _ ``` - start_code: '{print} ''Who does the dishes?''' 10: story_text: | In this level you could make an even better dish washing shedule. @@ -1940,7 +1657,6 @@ adventures: _ day _ days {print} names {at} {random} ' does the dishes on ' day ``` - start_code: '# place your code here' elif_command: name: '{elif}' default_save_name: elif @@ -1988,10 +1704,6 @@ adventures: {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: |- 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. @@ -2003,10 +1715,6 @@ adventures: {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: 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. @@ -2046,7 +1754,6 @@ adventures: Hedy now only tells you your name. Can you expand the code so that Hedy can predict more things about you? Obviously, Hedy isn't a very good fortune teller yet, as she can only repeat the answers that were given by the players! Take a look in level 2 to improve your fortune teller. - start_code: '# place your code here' 3: story_text: | In the previous levels you've created your first fortune telling machine, but Hedy couldn't really predict anything, only {echo}. @@ -2064,7 +1771,6 @@ adventures: 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. @@ -2089,7 +1795,6 @@ adventures: {sleep} 2 {print} answers {at} {random} ``` - start_code: '# place your code here' 5: story_text: | In this level you'll learn to (secretly) tip the odds in your favor, when using the fortune teller! @@ -2102,7 +1807,6 @@ adventures: person {is} {ask} 'Who are you?' {if} person {is} Hedy {print} 'You will definitely win!🤩' {else} {print} 'Bad luck! Someone else will win!😭' ``` - start_code: '# place your code here' 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. @@ -2137,7 +1841,6 @@ adventures: result = result * football {print} 'You are ' result ' percent smart.' ``` - start_code: '# place your code here' 7: story_text: | In this level you can use the `{repeat}` command to make your machine tell multiple fortunes at once. @@ -2149,7 +1852,6 @@ adventures: answer = yes, no, maybe {repeat} 3 {times} {print} 'My crystal ball says... ' answer {at} {random} ``` - start_code: '# place your code here' 8: story_text: | In the previous levels you've learned how to use `{repeat}` to make the fortune teller answer 3 questions in a row, but we had a problem with printing the questions. @@ -2169,7 +1871,6 @@ adventures: {sleep} {print} 'My crystal ball says...' answers {at} {random} ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to program the game MASH (mansion, apartement, shack, house). In this game you can predict for all the players at once, what their future will look like. @@ -2185,7 +1886,6 @@ adventures: {print} name ' will get a ' pets {at} {random} ' as their pet.' {sleep} ``` - start_code: '# place your code here' 12: story_text: | In this level you can make your fortunes multiple words. Can you add more different fortunes to the list? @@ -2197,7 +1897,6 @@ adventures: {sleep} {print} fortunes {at} {random} ``` - start_code: '# place your code here' functions: name: functions default_save_name: functions @@ -2237,21 +1936,6 @@ adventures: {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: story_text: | Now that you've learned how to use functions, you'll learn how to use a function with an argument. @@ -2280,13 +1964,6 @@ adventures: {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. @@ -2310,17 +1987,6 @@ adventures: 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 @@ -2349,7 +2015,6 @@ adventures: {print} 'You win!' game = 'over' ``` - start_code: '# place your code here' harry_potter: name: Harry Potter default_save_name: Harry Potter @@ -2371,7 +2036,6 @@ adventures: _ {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 @@ -2401,7 +2065,6 @@ adventures: story_text_2: | ### Exercise Can you finish the scary story? Or make up your own haunted house story? - 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. @@ -2448,7 +2111,6 @@ adventures: {sleep} _ _ _ _ ``` - start_code: '# place your code here' 4: story_text: | In this level you learn how to use quotation marks in your games. @@ -2464,7 +2126,6 @@ adventures: {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. @@ -2486,7 +2147,6 @@ adventures: _ _ _ _ {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! @@ -2515,7 +2175,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 11: story_text: | In this level we've changed the repeat command and we've added a line to our haunted house that tells the player in which room they are. @@ -2544,7 +2203,6 @@ adventures: {if} player {is} alive {print} 'Great! You survived!' ``` - start_code: '{print} ''Escape from the haunted house!''' 14: story_text: | ### Exercise @@ -2573,7 +2231,6 @@ adventures: {else} {print} 'GAME OVER' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2607,7 +2264,6 @@ adventures: {print} _ {print} 'GAME OVER' ``` - start_code: '# place your code here' hotel: name: hotel default_save_name: hotel @@ -2638,18 +2294,7 @@ adventures: {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?' @@ -2688,10 +2333,6 @@ adventures: _ _ _ 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... @@ -2708,11 +2349,6 @@ adventures: {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. @@ -2728,16 +2364,6 @@ adventures: {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 @@ -2766,11 +2392,6 @@ adventures: _ 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 @@ -2796,10 +2417,6 @@ adventures: 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: @@ -2808,8 +2425,7 @@ adventures: name = Hedy answer = 20 + 4 ``` - start_code: | - name = Hedy + answer = 20 + 4 14: story_text: | @@ -2841,8 +2457,7 @@ adventures: {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} @@ -2868,7 +2483,6 @@ adventures: {if} frog {is} grenouille {print} 'Super!' {else} {print} 'No, frog is grenouille' ``` - start_code: '# place your code here' 16: story_text: | ### Exercise @@ -2889,7 +2503,6 @@ adventures: {print} 'Wrong, ' french_words[i] ' means ' translation[i] {print} 'You gave ' score ' correct answers.' ``` - start_code: '# place your code here' maths: name: maths default_save_name: maths @@ -2929,8 +2542,7 @@ adventures: b = 'world!' {print} a + b ``` - start_code: |- - {print} 'decimal numbers now need to use a dot' + {print} 2.5 + 2.5 parrot: name: Parrot @@ -2956,7 +2568,6 @@ adventures: {ask} _ {echo} {echo} - start_code: '{print} Im Hedy the parrot' 2: story_text: | Create your own online pet parrot that will copy you! @@ -2973,7 +2584,6 @@ adventures: story_text_2: | ### Exercise You can use variables to make the parrot say more than only your name. Can you complete this code? - start_code: '{print} Im Hedy the parrot!' 3: story_text: | Teach your parrot a new word with `{add}`. @@ -2988,7 +2598,6 @@ adventures: {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}`. @@ -3002,7 +2611,6 @@ adventures: {print} _ 🧒 Say _ new_word _, Hedy!_ {print} _ 🦜 _ words {at} {random} ``` - start_code: '# Write your code here' 5: story_text: | Reward your parrot if it says the correct word! @@ -3019,7 +2627,6 @@ adventures: _ said_word {is} new_word _ '🧒 Great job, Hedy! 🍪' _ _ '🧒 No, Hedy! Say ' new_word ``` - start_code: '# place your code here' piggybank: name: Piggy Bank default_save_name: Piggy Bank @@ -3040,7 +2647,6 @@ adventures: weeks = to_save / allowance {print} 'You can buy a ' _ ' in ' _ ' weeks.' ``` - start_code: '# place your code here' 14: story_text: | ### Exercise @@ -3064,7 +2670,6 @@ adventures: {call} _ ``` - start_code: '# place your code here' pressit: name: Key presses default_save_name: Pressed @@ -3093,7 +2698,6 @@ adventures: {if} y {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 7: story_text: | Now that you have learned about `{repeat}`, we can press keys multiple times. @@ -3106,7 +2710,6 @@ adventures: ``` {if} x {is} {pressed} {forward} 15 {else} {turn} 90 ``` - start_code: '# place your code here' 9: story_text: | Now that you know how to combine statements, you can create a touch type tool with `{pressed}`. @@ -3126,7 +2729,6 @@ adventures: _ _ ``` - start_code: '# place your code here' print_command: name: '{print}' default_save_name: print @@ -3152,8 +2754,6 @@ adventures: ``` _ 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. @@ -3170,8 +2770,7 @@ adventures: temperature = 25 {print}('It is ', temperature, ' degrees outside') ``` - start_code: |- - name = 'Hedy' + {print}('My name is ', name) quizmaster: name: Quizmaster @@ -3203,7 +2802,6 @@ adventures: {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 @@ -3233,10 +2831,6 @@ adventures: {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 12: story_text: | **All texts need to be in quotation marks** @@ -3271,10 +2865,6 @@ adventures: score = 25 {print} 'You got ' score ``` - start_code: |- - name = {ask} 'What is your name?' - {if} name = 'Hedy the Robot' - {print} 'Hi there!' random_command: name: '{random}' default_save_name: random_command @@ -3308,9 +2898,6 @@ adventures: 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. @@ -3359,11 +2946,6 @@ adventures: ``` {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: story_text: | ### Repeat commands and indentation @@ -3377,10 +2959,6 @@ adventures: {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! @@ -3395,13 +2973,6 @@ adventures: {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 @@ -3427,10 +2998,6 @@ adventures: 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? @@ -3448,11 +3015,6 @@ adventures: _ {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 @@ -3472,7 +3034,6 @@ adventures: story_text_2: | ### Exercise Can you think of more lines to add to your restaurant code? For example, can you {ask} the guests what they'd like to drink, tell them the price, or wish them a pleasant meal? - 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. @@ -3489,7 +3050,6 @@ adventures: story_text_2: | ### Exercise Can you make this code more elaborate? For example by adding drinks to the order? Or...? - start_code: '# place your code here' 3: story_text: | Having trouble to decide what you wanna have for dinner? You can let Hedy choose for you! @@ -3523,7 +3083,6 @@ adventures: _ {print} You get a flavors {at} {random} milkshake ``` - 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. @@ -3543,7 +3102,6 @@ adventures: {print} Thank you for your order. {print} Your food and drinks will be right there! ``` - start_code: '# place your code here' 5: story_text: | In this level the `{if}` command allows you to `{ask}` your customers questions and give different responses to the answers. @@ -3564,7 +3122,6 @@ adventures: {if} anything {is} no {print} 'Thats it!' {else} {print} 'One ' anything {print} 'Thank you for your order and enjoy your meal!' ``` - start_code: '# place your code here' 6: 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. @@ -3583,7 +3140,6 @@ adventures: {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. @@ -3598,7 +3154,6 @@ adventures: {repeat} _ {times} food = {ask} 'What would you like to eat?' {print} 'Thanks for your order! Its coming right up!' ``` - 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: @@ -3616,7 +3171,6 @@ adventures: story_text_2: | ### Exercise Of course, this code can be expanded with more items on the menu, offering drinks, and/or multiple courses, so feel free to add 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! @@ -3649,7 +3203,6 @@ adventures: {print} 'That will be ' price ' dollar' {print} 'Enjoy your meal!' ``` - start_code: '# place your code here' 10: story_text: | In this level you'll learn how to easily {ask} your guests' orders in a short code. @@ -3697,7 +3250,6 @@ adventures: price = 4 * people {print} 'That will be ' price ' dollars, please!' ``` - start_code: '# place your code here' 12: story_text: | From this level on you can use decimal numbers to make you menu more realistic. @@ -3719,7 +3271,6 @@ adventures: price = price + 2.35 {print} 'That will be ' price ' dollar, please' ``` - start_code: '# place your code here' 13: story_text: | In this level we can use the new commands to upgrade our restaurant. @@ -3734,7 +3285,6 @@ adventures: price = price - 3 {print} 'That will be ' price ' dollars' ``` - start_code: '# place your code here' 15: story_text: | With the `{while}` you can make sure your costumers can keep adding orders until they are done. @@ -3751,7 +3301,6 @@ adventures: more = {ask} 'Would you like to order anything else?' {print} 'Thank you!' ``` - start_code: '# place your code here' rock: name: Rock, paper, scissors default_save_name: Rock @@ -3778,7 +3327,6 @@ adventures: {ask} choose from _ {echo} so your choice was: ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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! @@ -3787,7 +3335,6 @@ adventures: _ {is} {ask} rock, paper, or scissors? {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! @@ -3809,12 +3356,10 @@ adventures: {print} player 1 chooses... choices {at} {random} {print} player 2 _ ``` - start_code: '{print} Welcome to your own rock scissors paper!' 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. Do you complete the code by entering the correct commands or characters on the underscores? - start_code: '{print} ''Welcome to your own rock scissors paper!''' 5: story_text: | In this level we can determine who won. @@ -3834,7 +3379,6 @@ 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. Can you finish the code? @@ -3854,7 +3398,6 @@ adventures: {print} 'You lose!' # finish this code ``` - start_code: '# place your code here' 10: story_text: | Feeling too lazy to play the game yourself? Let Hedy play it for you! @@ -3866,7 +3409,6 @@ adventures: {for} player {in} players {print} player ' chooses ' choices {at} {random} ``` - start_code: '# place your code here' 13: story_text: | With the `{and}` command you can shorten your rock, paper, scissors code! Check out the example code below and try to finish it. @@ -3885,7 +3427,6 @@ adventures: {print} 'The computer wins!' _ ``` - start_code: '# place your code here' 15: story_text: | ### Exercise @@ -3908,7 +3449,6 @@ adventures: won = 'yes' _ ``` - start_code: '# place your code here' rock_2: name: Rock, paper, scissors 2 default_save_name: rock_2 @@ -3925,7 +3465,6 @@ adventures: choice is _ {print} I choose choice ``` - start_code: '# place your code here' secret: name: SuperSpy default_save_name: SuperSpy @@ -3952,7 +3491,6 @@ adventures: b {is} 'today at 10.00' {print} _ _ _ ``` - start_code: '# place your code here' 13: story_text: | Can you fill in the right command on the blank? Mind: The superspy has to answer BOTH questions correctly, before they get the confidential information! @@ -3965,7 +3503,6 @@ adventures: {else} {print} 'Go to the trainstation at 10.00' ``` - start_code: '# place your code here' sleep_command: name: '{sleep}' default_save_name: sleep_command @@ -3981,10 +3518,6 @@ adventures: {sleep} 2 {print} green! ``` - start_code: |- - {print} My favorite colour is... - {sleep} 2 - {print} green! songs: name: Sing a song! default_save_name: Song @@ -4022,7 +3555,6 @@ adventures: {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: @@ -4040,7 +3572,6 @@ adventures: ``` After Baby Shark you can of course also program other songs. There are many songs with repetition. - start_code: '{print} ''Baby Shark''' 8: story_text: | In a previous level you've programmed the song 'Bottles of beer'. You made one verse and then had to copy the verses 99 times. In this level you can repeat the song 99 times, just by adding one simple line! @@ -4055,7 +3586,6 @@ adventures: verse = verse - 1 {print} verse ' bottles of beer on the wall' ``` - start_code: '# place your code here' 10: story_text: | In this level you can easily make the childrens' song 'Five little monkeys'. Can you make the last chorus? @@ -4116,7 +3646,6 @@ adventures: ``` monkeys = 5, 4, 3, 2, 1 ``` - start_code: '# place your code here' 11: story_text: | In this level you can use the `{for} i {in} {range}` command to make songs that use counting, like the 5 little monkeys. @@ -4134,7 +3663,6 @@ adventures: {else} {print} 'NO MORE MONKEYS JUMPING ON THE BED!' ``` - start_code: '# place your code here' 12: 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: @@ -4153,7 +3681,6 @@ adventures: _ {print} 'if youre happy and you know it' _ {print} action ``` - start_code: '# place your code here' 13: 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? @@ -4170,16 +3697,6 @@ adventures: {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. @@ -4215,7 +3732,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# place your code here' 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. @@ -4237,7 +3753,6 @@ adventures: {print} 'way hay and up she rises' {print} 'early in the morning' ``` - start_code: '# Schrijf jouw code hier' songs_2: name: Sing a song! 2 default_save_name: Song 2 @@ -4259,15 +3774,6 @@ adventures: {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 @@ -4335,7 +3841,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 14: 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. @@ -4398,7 +3903,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4460,7 +3964,6 @@ adventures: {else} sign = 'x' ``` - start_code: '# place your code here' 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. @@ -4547,7 +4050,6 @@ adventures: {else}: sign = 'x' ``` - start_code: '# place your code here' turtle: name: Turtle default_save_name: Turtle @@ -4571,9 +4073,6 @@ adventures: {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. @@ -4599,11 +4098,6 @@ adventures: {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 use `{at} {random}` with the drawing turtle. A random choice makes the turtle walk a different path each time. @@ -4616,10 +4110,6 @@ adventures: {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! @@ -4646,11 +4136,6 @@ adventures: {color} {red} {forward} 50 ``` - start_code: |- - {print} 'Drawing figures' - angle {is} 90 - {turn} angle - {forward} 25 5: story_text: | In level 5 you can make a choice with `{if}`. For example between different types of figures. @@ -4683,12 +4168,6 @@ adventures: 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. @@ -4712,7 +4191,6 @@ adventures: {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. @@ -4755,7 +4233,6 @@ adventures: {forward} 50 {color} {black} ``` - start_code: '# place your code here' 10: story_text: | In this level you can make the turtle draw a figure. @@ -4773,7 +4250,6 @@ adventures: {for} distance {in} distances {forward} distance ``` - start_code: '# Write your code here' 12: story_text: | We can use functions to draw more complex figures with less code. @@ -4798,16 +4274,6 @@ adventures: {forward} 50 {call} square ``` - start_code: | - {define} square - {repeat} 4 {times} - {turn} _ - {forward} _ - {call} square - {forward} 50 - {call} square - {forward} 50 - {call} square turtle_draw_it: name: Draw it! default_save_name: Draw it @@ -4823,7 +4289,6 @@ adventures: Square Stairs - start_code: '## Recreate the drawings with the turtle!' 2: story_text: | ### Exercise @@ -4834,7 +4299,6 @@ adventures: Arrow Boat - start_code: '## Recreate the drawings with the turtle!' 3: story_text: | ### Exercise @@ -4845,7 +4309,6 @@ adventures: Star Arrow - start_code: '## Recreate the drawings with the turtle!' 4: story_text: | ### Exercise @@ -4863,7 +4326,6 @@ adventures: colors {is} red, orange, yellow, green, blue, purple, pink, brown, gray, black color _ ``` - start_code: '## Recreate the drawings with the turtle!' 5: story_text: | ### Exercise @@ -4882,7 +4344,6 @@ adventures: chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L? {if} _ ``` - start_code: '## Recreate the drawings with the turtle!' 6: story_text: | ### Exercise @@ -4902,7 +4363,6 @@ adventures: ``` chosen_color = {ask} _ ``` - start_code: '## Recreate the drawings with the turtle!' 7: story_text: | ### Exercise @@ -4913,7 +4373,6 @@ adventures: Triangle Fan - start_code: '## Recreate the drawings with the turtle!' 8: story_text: | ### Exercise @@ -4926,7 +4385,6 @@ adventures: Randomly colored star (5) Randomly colored spiral (7) - start_code: '## Recreate the drawings with the turtle!' 9: story_text: | ### Exercise @@ -4957,7 +4415,6 @@ adventures: color_2 = white color_3 = blue ``` - start_code: '## Recreate the drawings with the turtle! ' 10: story_text: | ### Exercise @@ -4998,7 +4455,6 @@ adventures: {for} chosen_color {in} colors _ ``` - start_code: '## Recreate the drawings with the turtle! ' 11: story_text: | ### Exercise @@ -5021,7 +4477,6 @@ adventures: Hint Fan: Start out like the fan you made in level 7. Or take a peak at the hint for the beehive, because the codes are very similar. - start_code: '## Recreate the drawings with the turtle! ' 12: story_text: | ### Exercise @@ -5050,7 +4505,6 @@ adventures: {if} shape = 'square' {call} draw_a_square ``` - start_code: '## Recreate the drawings with the turtle! ' 13: story_text: | ### Exercise @@ -5074,7 +4528,6 @@ adventures: {define} draw_a_house {with} chosen_color _ ``` - start_code: '## Recreate the drawings with the turtle! ' 14: story_text: | ### Exercise @@ -5102,7 +4555,6 @@ adventures: {call} _ {with} {call} _ {with} ``` - start_code: '## Recreate the drawings with the turtle! ' 15: story_text: | ### Exercise @@ -5136,7 +4588,6 @@ adventures: example_code_3: | Star A star is usually drawn using 144-degree-turns. If you change this slightly to 143 degrees for example and repeat the pattern multiple times with a {while} loop you can make this figure. - start_code: '## Recreate the drawings with the turtle! ' while_command: name: '{while}' default_save_name: while_command @@ -5156,11 +4607,6 @@ adventures: 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 @@ -5178,4 +4624,3 @@ adventures: {print} i {print} 'Happy New Year!' ``` - start_code: '# place your code here' diff --git a/tests/cypress.config.js b/tests/cypress.config.js index 510e42d6f18..8591f93cc29 100644 --- a/tests/cypress.config.js +++ b/tests/cypress.config.js @@ -21,6 +21,7 @@ module.exports = defineConfig({ login_page: '/login', recover_page: '/recover', hedy_page: '/hedy', + hedy_english_keywords: '/hedy?keyword_language=en', hedy_level2_page: '/hedy/2', hedy_level5_page: '/hedy/5', adventure_page: '/hedy/1#print_command', diff --git a/tests/cypress/e2e/hedy_page/editor_box.cy.js b/tests/cypress/e2e/hedy_page/editor_box.cy.js index 81394c81fb6..e3ac3d5b01d 100644 --- a/tests/cypress/e2e/hedy_page/editor_box.cy.js +++ b/tests/cypress/e2e/hedy_page/editor_box.cy.js @@ -9,7 +9,7 @@ describe('Is able to type in the editor box', () => { it(`Language ${language} should run`, () => { cy.visit(`${Cypress.env('hedy_page')}?language=${language}#default`); - // click on textaread to get focus, then clear it + // click on text areas to get focus, then clear it codeMirrorContent().click(); clearViaBackspace(); @@ -99,4 +99,4 @@ function clearViaBackspace() { function codeMirrorContent() { return cy.get('.cm-content'); -} \ No newline at end of file +} diff --git a/tests/cypress/e2e/hedy_page/keyword_language.cy.js b/tests/cypress/e2e/hedy_page/keyword_language.cy.js index 0ffbfcaaf5b..47fdcc64240 100644 --- a/tests/cypress/e2e/hedy_page/keyword_language.cy.js +++ b/tests/cypress/e2e/hedy_page/keyword_language.cy.js @@ -1,11 +1,16 @@ -import {goToHedyPage} from "../tools/navigation/nav"; +import {goToHedyPageWithEnKeywords} from "../tools/navigation/nav"; describe('when the user changes their language to Arabic', () => { beforeEach(() => { - goToHedyPage(); - + goToHedyPageWithEnKeywords(); + cy.get('.cm-content').click(); + cy.get('#editor').type("print Hallo!'\n"); cy.getBySel('language-dropdown').click(); cy.getBySel('switch-lang-ar').click(); + + // switch back and forth + cy.getBySel('kwlang-switch-btn').click(); + cy.getBySel('kwlang-switch-toggle').click(); }); it('initially has keywords in Arabic', () => { diff --git a/tests/cypress/e2e/hedy_page/run_code_button.cy.js b/tests/cypress/e2e/hedy_page/run_code_button.cy.js index 7984fd6bc9b..71133192ff4 100644 --- a/tests/cypress/e2e/hedy_page/run_code_button.cy.js +++ b/tests/cypress/e2e/hedy_page/run_code_button.cy.js @@ -4,6 +4,8 @@ describe('Is able to run code', () => { it('Passes', () => { goToHedyPage(); + cy.get('.cm-content').click(); + cy.focused().type("print Hallo!'\n"); // Run with correct code cy.get('#runit').click(); cy.get('#okbox').should('be.visible'); diff --git a/tests/cypress/e2e/tools/navigation/nav.js b/tests/cypress/e2e/tools/navigation/nav.js index 1ecaea9f47a..a5a70566bdb 100644 --- a/tests/cypress/e2e/tools/navigation/nav.js +++ b/tests/cypress/e2e/tools/navigation/nav.js @@ -47,6 +47,11 @@ export function goToHedyPage() return goToPage(Cypress.env('hedy_page')); } +export function goToHedyPageWithEnKeywords() +{ + return goToPage(Cypress.env('hedy_english_keywords')); +} + export function goToAdventurePage() { return goToPage(Cypress.env('adventure_page')); diff --git a/tests/test_snippets/test_adventures.py b/tests/test_snippets/test_adventures.py index 6bc7c2b1804..58e3c119bc4 100644 --- a/tests/test_snippets/test_adventures.py +++ b/tests/test_snippets/test_adventures.py @@ -30,7 +30,7 @@ def collect_snippets(path, filtered_language=None): files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f)) and f.endswith('.yaml')] for f in files: lang = f.split(".")[0] - # we always grab the en snippets to restore broken code + # we always store the English snippets, to use them if we need to restore broken code if not filtered_language or (filtered_language and (lang == filtered_language or lang == 'en')): f = os.path.join(path, f) yaml = YamlFile.for_file(f) @@ -46,17 +46,10 @@ def collect_snippets(path, filtered_language=None): adventure_name = adventure['name'] for adventure_part, text in level.items(): - is_markdown = adventure_part != 'start_code' - - if is_markdown: - # If we have Markdown, there can be multiple code blocks inside it - codes = [tag.contents[0].contents[0] - for tag in utils.markdown_to_html_tags(text) - if tag.name == 'pre' and tag.contents and tag.contents[0].contents] - else: - # If we don't have Markdown (this happensin the start_code field) - # the entire field is a single code block - codes = [text] + # This block is markdown, and there can be multiple code blocks inside it + codes = [tag.contents[0].contents[0] + for tag in utils.markdown_to_html_tags(text) + if tag.name == 'pre' and tag.contents and tag.contents[0].contents] if check_stories and adventure_part == 'story_text' and codes != []: # Can be used to catch languages with example codes in the story_text