Skip to content

Commit

Permalink
add curlies around pressed examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Felienne committed Dec 15, 2022
1 parent 469302c commit fde5d6a
Show file tree
Hide file tree
Showing 41 changed files with 698 additions and 698 deletions.
30 changes: 15 additions & 15 deletions content/adventures/ar.yaml

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions content/adventures/bg.yaml

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions content/adventures/bn.yaml

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions content/adventures/cs.yaml

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions content/adventures/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2635,44 +2635,44 @@ adventures:
8:
start_code: '# place your code here'
story_text: "## Press It!\nNow that you need to use indents for the {if} and {else} statements,\nyou will also have to indent code when using {pressed}! Don't worry,\nit works te same as with the other statements, see the example!\nPress another key instead of x and see what happens.\n"
example_code: "```\n{if} x is {pressed}\n {print} 'Only the cool kids press the x key.'\n{else}\n {print} 'The adventurous kids press something else.'\n```\n"
example_code: "```\n{if} x {is} {pressed}\n {print} 'Only the cool kids press the x key.'\n{else}\n {print} 'The adventurous kids press something else.'\n```\n"
9:
start_code: '# place your code here'
story_text: "Now that you know how to nest multiple statements, you can also do this with {pressed}!\nBy nesting a pressed in a {repeat} loop, you can repeatedly press buttons and make something happen.\nNow we know you could do this before, but by using the indents you have much more overview!\nTry it counting to 5, for example!\n"
example_code: "```\ntotal = 1\n{repeat} 5 times\n {if} x is {pressed}\n {print} total\n {print} 'keep pressing!'\n total = total + 1\n```\n"
example_code: "```\ntotal = 1\n{repeat} 5 times\n {if} x {is} {pressed}\n {print} total\n {print} 'keep pressing!'\n total = total + 1\n```\n"
story_text_2: "Besides counting, you can now also move the turtle in many more ways than only forward or backwards!\nTry making some figures by walking the turtle around!\n"
example_code_2: "```\nstepsize = 25\nleft = -90\nright = 90\naround = 180\nrepeat 40 times\n {if} w is {pressed}\n forward stepsize\n {if} s is {pressed}\n turn around\n {if} a is {pressed}\n turn left\n {if} d is {pressed}\n turn right\n```\n"
example_code_2: "```\nstepsize = 25\nleft = -90\nright = 90\naround = 180\nrepeat 40 times\n {if} w {is} {pressed}\n forward stepsize\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n {if} d {is} {pressed}\n turn right\n```\n"
10:
start_code: '# place your code here'
example_code: "```\ndistances = 100, 80, 60, 40, 20, 10\n{if} x is {pressed}\n for distance in distances\n {forward} distance\n {turn} -90\n{if} y is {pressed}\n for distance in distances\n {forward} distance\n {turn} 90\n```\n"
example_code: "```\ndistances = 100, 80, 60, 40, 20, 10\n{if} x {is} {pressed}\n for distance in distances\n {forward} distance\n {turn} -90\n{if} y {is} {pressed}\n for distance in distances\n {forward} distance\n {turn} 90\n```\n"
story_text: "In this level you can make the turtle draw you a figure. The turtle is raring to go.\nGive the turtle the starting signal by pressing the x or y key on your keyboard.\nCan you let the turtle draw you another figure?\n"
11:
start_code: '# place your code here'
story_text: "Now that you have learned of the ```for ... in range ... to ...``` rule, you can use it for ```pressed```\ntoo! for example, try moving the turtle! The turtle grows everytime you press a linked button.\nThis way the turtle can move further every step!\n"
example_code: "```\nleft = -90\nright = 90\naround = 180\nfor counter in range 1 to 15\n stepsize = counter * 5\n {if} w is {pressed}\n forward stepsize\n {if} s is {pressed}\n turn around\n {if} a is {pressed}\n turn left\n {if} d is {pressed}\n turn right\n```\n"
example_code: "```\nleft = -90\nright = 90\naround = 180\nfor counter in range 1 to 15\n stepsize = counter * 5\n {if} w {is} {pressed}\n forward stepsize\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n {if} d {is} {pressed}\n turn right\n```\n"
14:
example_code: "```\nstepsize = 15\nleft = -90\nright = 90\naround = 180\njumptime = 5\nspins = 4\nrepeat 40 times\n {if} w is {pressed}\n forward stepsize\n jumptime = jumptime - 1\n {if} s is {pressed}\n turn around\n {if} a is {pressed}\n turn left\n spins = spins - 1\n {if} d is {pressed}\n turn right\n spins = spins - 1\n {if} p is {pressed}\n {if} jumptime <= 0 or spins <= 0\n forward stepsize * 3\n jumptime = 5\n spins = 4\n```\n"
example_code: "```\nstepsize = 15\nleft = -90\nright = 90\naround = 180\njumptime = 5\nspins = 4\nrepeat 40 times\n {if} w {is} {pressed}\n forward stepsize\n jumptime = jumptime - 1\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n spins = spins - 1\n {if} d {is} {pressed}\n turn right\n spins = spins - 1\n {if} p {is} {pressed}\n {if} jumptime <= 0 or spins <= 0\n forward stepsize * 3\n jumptime = 5\n spins = 4\n```\n"
start_code: '# place your code here'
story_text: "Now that you learned how to use operators, we can use it with ```pressed```too!\nimagine the turtle being able to do a superjump forward. by pressing ```p``` the turtle can make a\nsuperjump! However, the turtle can only do this jump every 5 steps or every 4 turns\n"
15:
story_text: "Now that you have learned about the ```while``` loops, you can start using it on the turtle!\nThe turtle is now only allowed to take only 15 steps or turn 15 times, before he gets tired!\nTry to get as far as possible before the turtle gets tired! You can use your superjump after 2 turns\nor 5 steps.\n"
example_code: "```\nstepsize = 15\nleft = -90\nright = 90\naround = 180\njumptime = 5\nspins = 2\ntired_in = 15\nwhile tired_in > 0\n {if} w is {pressed}\n forward stepsize\n jumptime = jumptime - 1\n {if} s is {pressed}\n turn around\n {if} a is {pressed}\n turn left\n spins = spins - 1\n {if} d is {pressed}\n turn right\n spins = spins - 1\n {if} p is {pressed}\n {if} jumptime <= 0 or spins <= 0\n forward stepsize * 4\n jumptime = 5\n spins = 2\n tired_in = tired_in - 1\n```\n"
example_code: "```\nstepsize = 15\nleft = -90\nright = 90\naround = 180\njumptime = 5\nspins = 2\ntired_in = 15\nwhile tired_in > 0\n {if} w {is} {pressed}\n forward stepsize\n jumptime = jumptime - 1\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n spins = spins - 1\n {if} d {is} {pressed}\n turn right\n spins = spins - 1\n {if} p {is} {pressed}\n {if} jumptime <= 0 or spins <= 0\n forward stepsize * 4\n jumptime = 5\n spins = 2\n tired_in = tired_in - 1\n```\n"
start_code: '# place your code here'
16:
start_code: '# place your code here'
story_text: "Lets move a little with a game of Twister!\nWhen everyone is ready, press the x key for the next move!\n"
example_code: "```\nlimbs = ['Right Hand', 'Left Hand', 'Right Foot', 'Left Foot']\ncolours = ['Blue', 'Green', 'Red', 'Yellow']\nrepeat 20 times\n l = limbs[random]\n c = colours[random]\n {if} x is {pressed}\n {print} l + ' on ' + c + '!'\n```\n"
example_code: "```\nlimbs = ['Right Hand', 'Left Hand', 'Right Foot', 'Left Foot']\ncolours = ['Blue', 'Green', 'Red', 'Yellow']\nrepeat 20 times\n l = limbs[random]\n c = colours[random]\n {if} x {is} {pressed}\n {print} l + ' on ' + c + '!'\n```\n"
17:
story_text: "Now that you learned how to use ```elif```, we can use it with ```pressed```too! Be aware,\n```elif ... is pressed ``` is not possible! That is why we are going to nest some ```elif```\nstatements into the ```pressed``` options. We also had to add ```:``` to the code to make\neverything work! imagine the turtle being able to do a superjump forward. by pressing ```p``` the\nturtle can make a superjump! However, the turtle can only do this jump every 5 steps or every\n4 turns\n"
start_code: '# place your code here'
example_code: "```\nstepsize = 15\nleft = -90\nright = 90\naround = 180\njumptime = 5\nspins = 4\nrepeat 40 times\n {if} w is {pressed}:\n forward stepsize\n jumptime = jumptime - 1\n {if} s is {pressed}:\n turn around\n {if} a is {pressed}:\n turn left\n spins = spins - 1\n {if} d is {pressed}:\n turn right\n spins = spins - 1\n {if} p is {pressed}:\n {if} jumptime <= 0 or spins <= 0:\n forward stepsize * 3\n jumptime = 5\n spins = 4\n {elif} jumptime > 0:\n print \"you need to take more steps or turns before you can superjump!\"\n```\n"
example_code: "```\nstepsize = 15\nleft = -90\nright = 90\naround = 180\njumptime = 5\nspins = 4\nrepeat 40 times\n {if} w {is} {pressed}:\n forward stepsize\n jumptime = jumptime - 1\n {if} s {is} {pressed}:\n turn around\n {if} a {is} {pressed}:\n turn left\n spins = spins - 1\n {if} d {is} {pressed}:\n turn right\n spins = spins - 1\n {if} p {is} {pressed}:\n {if} jumptime <= 0 or spins <= 0:\n forward stepsize * 3\n jumptime = 5\n spins = 4\n {elif} jumptime > 0:\n print \"you need to take more steps or turns before you can superjump!\"\n```\n"
12:
story_text: "Are you familiar with videogames? You walk into tall grass and are suddenly approached by\na very suspicious mouse. What will you do?\nIn this level we will make a small menu with different kinds of options.\nStoring text into a variable is quite handy for repeated uses.\nOption, I choose you!\n"
example_code: "```\nchoose = 'You chose option: '\nprint 'A wild mouse appeared!'\nprint 'Choose an option and press first letter: (n)et, (c)at, (b)ag, (r)un'\n{if} n is {pressed}\n {print} choose + 'net'\n {print} 'You attempt to catch the mouse with a net..'\n sleep\n {print} 'Congratulations you did it!'\n{if} c is {pressed}\n {print} choose + 'cat'\n {print} 'You send out your cat'\n sleep\n {print} 'The mouse got scared and ran away!'\n{if} b is {pressed}\n {print} choose + 'bag'\n {print} 'The mouse jumped into you bag!'\n{if} r is {pressed}\n {print} choose + 'run'\n {print} 'You got away safely!'\n```\n"
example_code: "```\nchoose = 'You chose option: '\nprint 'A wild mouse appeared!'\nprint 'Choose an option and press first letter: (n)et, (c)at, (b)ag, (r)un'\n{if} n {is} {pressed}\n {print} choose + 'net'\n {print} 'You attempt to catch the mouse with a net..'\n sleep\n {print} 'Congratulations you did it!'\n{if} c {is} {pressed}\n {print} choose + 'cat'\n {print} 'You send out your cat'\n sleep\n {print} 'The mouse got scared and ran away!'\n{if} b {is} {pressed}\n {print} choose + 'bag'\n {print} 'The mouse jumped into you bag!'\n{if} r {is} {pressed}\n {print} choose + 'run'\n {print} 'You got away safely!'\n```\n"
start_code: '# place your code here'
13:
story_text: "Now that you learned how to use ```and``` and ```or```, we can use it with ```pressed```too!\nimagine the turtle being able to do a superjump forward. by pressing ```p``` the turtle can make a\nsuperjump! However, the turtle can only do this jump if he turns left and right first!\n"
example_code: "```\nstepsize = 10\nleft = -90\nright = 90\naround = 180\nlooked_left = 0\nlooked_right = 0\nrepeat 40 times\n {if} w is {pressed}\n forward stepsize\n {if} s is {pressed}\n turn around\n {if} a is {pressed}\n turn left\n looked_left = 1\n {if} d is {pressed}\n turn right\n looked_right = 1\n {if} p is {pressed}\n {if} looked_left is 1 and looked_right is 1\n forward 40\n looked_left = 0\n looked_right = 0\n```\n"
example_code: "```\nstepsize = 10\nleft = -90\nright = 90\naround = 180\nlooked_left = 0\nlooked_right = 0\nrepeat 40 times\n {if} w {is} {pressed}\n forward stepsize\n {if} s {is} {pressed}\n turn around\n {if} a {is} {pressed}\n turn left\n looked_left = 1\n {if} d {is} {pressed}\n turn right\n looked_right = 1\n {if} p {is} {pressed}\n {if} looked_left is 1 and looked_right is 1\n forward 40\n looked_left = 0\n looked_right = 0\n```\n"
start_code: '# place your code here'
5:
start_code: '# platziere deinen Code hier'
Expand All @@ -2682,10 +2682,10 @@ adventures:
example_code_2: "```\nfalls y ist {pressed} {print} 'Toll! Du hast die y Taste gedrückt!'\nsonst {print} 'Oh nein! Du hast nicht die y Taste gedrückt.'\n```\n"
6:
story_text: "Did you know you can also make a calculator using ```pressed```?\nGive the calculator two numbers and press the m key to multiply.\nNow you don't have to bring your own!\nTry other keys and see what happens! Do you get a different result?\n"
example_code: "```\nfirst = {ask} 'what is your first number?'\nsecond = {ask} 'what is your second number?'\nprint 'press a to add, s to substract, d to divide, m to multiply'\nif a is {pressed} result = first + second\nif s is {pressed} result = first - second\nif d is {pressed} result = first / second\nif m is {pressed} result = first * second\nprint 'The answer is ' result\n```\n"
example_code: "```\nfirst = {ask} 'what is your first number?'\nsecond = {ask} 'what is your second number?'\nprint 'press a to add, s to substract, d to divide, m to multiply'\n{if} a {is} {pressed} result = first + second\n{if} s {is} {pressed} result = first - second\n{if} d {is} {pressed} result = first / second\n{if} m {is} {pressed} result = first * second\n{print}'The answer is ' result\n```\n"
start_code: '# place your code here'
7:
example_code: "```\nrepeat 3 times if x is {pressed} forward 15\n```\n"
example_code: "```\n{repeat} 3 {times} {if} x {is} {pressed} forward 15\n```\n"
start_code: '# place your code here'
story_text: "You might have tried it in level 5 and 6, pressing the key linked to ```pressed``` multiple\ntimes. If you did, you noticed that this did nothing. but now that you have learned about repeat, we\ncan press keys multiple times! Make the turtle walk forward!\n"
name: Drück es!
Expand Down
Loading

0 comments on commit fde5d6a

Please sign in to comment.