Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📜 Cleaning up level 12 up and also adds new adventure in level 16 #5264

Merged
merged 11 commits into from
Mar 15, 2024
Merged
57 changes: 42 additions & 15 deletions content/adventures/ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,10 @@ adventures:
If you want, you can get another card, and its points will be added to your total. The dealer can also choose to take another card.
But be careful not to get more than 21 points, because if you do, you lose!
The player who gets closest to 21, without going over it, wins!

Have fun!

### Exercise
This code works fine, but it's awfully long and cumbersome. Can you shorten the code by using functions?
example_code: |
```
{print} 'BLACKJACK'
Expand Down Expand Up @@ -433,14 +435,14 @@ adventures:
points = points + 10
{elif} card_3 == 'Ace':
{if} points > 11:
points = points + 11
{else}:
points = points + 1
{else}:
points = points + 11
{else}:
points = points + card_3
print 'You get an extra ' card_3 ' (' points ' points)'
{print} 'You get an extra ' card_3 ' (' points ' points)'
{else}:
print 'No extra cards'
{print} 'No extra cards'
# Winner
{if} points > 21 {or} dealer_points > points {or} dealer_points == 21:
{print} 'You lose'
Expand Down Expand Up @@ -575,7 +577,7 @@ adventures:
### Exercise 1
Let's make the practice program a bit harder. The player now has to answers two questions correctly. Fill out the blanks to complete the program.

### Exercise 2 Extra
### Exercise 2
Sometimes, calculations have multiple correct answers. For example, 10 can be divided by 5 and by 2. So the question 'What number divides 10?' can be answered by 2 and by 5.
Ask for a calculation that has multiple correct answers, ask the player to answer it, and determine if it is correct using `{or}`.
Empty the programming field and create your own solution.
Expand Down Expand Up @@ -2523,10 +2525,10 @@ adventures:
```
12:
story_text: |
Use functions in you songs! As you can see in the example code, you can make a function for each line of Twinkle Twinkle little star. Once you've programmed the first three lines, all you have to do is call the functions in the order you want them played in.
Use functions in your songs! As you can see in the example code, you can make a function for each line of Twinkle Twinkle Little Star. Once you've programmed the first three lines, all you have to do is call the functions in the order you want them played in.

### Exercise
Finish the song of Twinkle Twinkle little star.
Finish the song of Twinkle Twinkle Little Star.
Then look back at all the songs you've programmed in the levels before, can you make those codes better and shorter using functions too?
example_code: |
```
Expand Down Expand Up @@ -2569,7 +2571,7 @@ adventures:
```
13:
story_text: |
You can use a function with an argument for songs that have line taht are almost the same, but slightly different each time.
You can use a function with an argument for songs that have line that are almost the same, but slightly different each time.
One example is the song 'Yankee Doodle'. The first 4 notes of the first lines are the same, buyt each time they are followed by a different couple of notes.

### Exercise
Expand Down Expand Up @@ -3919,6 +3921,33 @@ adventures:
{print} 'Like a diamond in the sky'
{call} _
```
16:
story_text: |
### Exercise
Finish the nursery rhyme!
example_code: |
```
number = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten']
object = ['on his drum', 'on his shoe', 'on his knee', 'on his door', 'on his hive', 'on his sticks', 'up in heaven', 'on his gate', 'on his vine', 'once again']

_
{print} 'This old man'
{print} 'He played ' _
{print} 'He played knick-knack ' _
{print} 'With a knick-knack paddywhack'
{print} 'Give the dog a bone'
{print} 'This old man came rolling home'
{sleep} 8
{clear}
```
story_text_2: |
### Exersice 2
Now create your own code for the nursery rhyme 'The wheels on the bus' on the same way!
example_code_2: |
```
object = ['wheels', 'doors', _]
movement = [ 'round and round', 'open and shut', _]
```
tic:
name: لعبة إكس-أو
default_save_name: Tic
Expand Down Expand Up @@ -4478,7 +4507,7 @@ adventures:
example_code: |
Hint:
```
chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L?
chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L?'
{if} _
```
6:
Expand Down Expand Up @@ -4618,12 +4647,10 @@ adventures:
story_text: |
### Exercise
Recreate the drawings with the turtle!
Hint: Bracelet designing program. Firstly, define a function **for each shape** you want to use on the bacelet. Then, add the shapes to the bacelet like this:
</div>
Bracelet Designing program <img src="https://github.com/hedyorg/hedy/assets/80678586/549d7f3a-c492-4b4a-b173-746eb3400951" width="500">
example_code: |
Hint: Bracelet designing program


Firstly, define a function **for each shape** you want to use on the bacelet. Then, add the shapes to the bacelet like this:

```
{define} draw_a_square
_
Expand Down
57 changes: 42 additions & 15 deletions content/adventures/bg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,10 @@ adventures:
If you want, you can get another card, and its points will be added to your total. The dealer can also choose to take another card.
But be careful not to get more than 21 points, because if you do, you lose!
The player who gets closest to 21, without going over it, wins!

Have fun!

### Exercise
This code works fine, but it's awfully long and cumbersome. Can you shorten the code by using functions?
example_code: |
```
{print} 'BLACKJACK'
Expand Down Expand Up @@ -454,14 +456,14 @@ adventures:
points = points + 10
{elif} card_3 == 'Ace':
{if} points > 11:
points = points + 11
{else}:
points = points + 1
{else}:
points = points + 11
{else}:
points = points + card_3
print 'You get an extra ' card_3 ' (' points ' points)'
{print} 'You get an extra ' card_3 ' (' points ' points)'
{else}:
print 'No extra cards'
{print} 'No extra cards'
# Winner
{if} points > 21 {or} dealer_points > points {or} dealer_points == 21:
{print} 'You lose'
Expand Down Expand Up @@ -604,7 +606,7 @@ adventures:
### Exercise 1
Let's make the practice program a bit harder. The player now has to answers two questions correctly. Fill out the blanks to complete the program.

### Exercise 2 Extra
### Exercise 2
Sometimes, calculations have multiple correct answers. For example, 10 can be divided by 5 and by 2. So the question 'What number divides 10?' can be answered by 2 and by 5.
Ask for a calculation that has multiple correct answers, ask the player to answer it, and determine if it is correct using `{or}`.
Empty the programming field and create your own solution.
Expand Down Expand Up @@ -2668,10 +2670,10 @@ adventures:
```
12:
story_text: |
Use functions in you songs! As you can see in the example code, you can make a function for each line of Twinkle Twinkle little star. Once you've programmed the first three lines, all you have to do is call the functions in the order you want them played in.
Use functions in your songs! As you can see in the example code, you can make a function for each line of Twinkle Twinkle Little Star. Once you've programmed the first three lines, all you have to do is call the functions in the order you want them played in.

### Exercise
Finish the song of Twinkle Twinkle little star.
Finish the song of Twinkle Twinkle Little Star.
Then look back at all the songs you've programmed in the levels before, can you make those codes better and shorter using functions too?
example_code: |
```
Expand Down Expand Up @@ -2714,7 +2716,7 @@ adventures:
```
13:
story_text: |
You can use a function with an argument for songs that have line taht are almost the same, but slightly different each time.
You can use a function with an argument for songs that have line that are almost the same, but slightly different each time.
One example is the song 'Yankee Doodle'. The first 4 notes of the first lines are the same, buyt each time they are followed by a different couple of notes.

### Exercise
Expand Down Expand Up @@ -4032,6 +4034,33 @@ adventures:
{print} 'Like a diamond in the sky'
{call} _
```
16:
story_text: |
### Exercise
Finish the nursery rhyme!
example_code: |
```
number = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten']
object = ['on his drum', 'on his shoe', 'on his knee', 'on his door', 'on his hive', 'on his sticks', 'up in heaven', 'on his gate', 'on his vine', 'once again']

_
{print} 'This old man'
{print} 'He played ' _
{print} 'He played knick-knack ' _
{print} 'With a knick-knack paddywhack'
{print} 'Give the dog a bone'
{print} 'This old man came rolling home'
{sleep} 8
{clear}
```
story_text_2: |
### Exersice 2
Now create your own code for the nursery rhyme 'The wheels on the bus' on the same way!
example_code_2: |
```
object = ['wheels', 'doors', _]
movement = [ 'round and round', 'open and shut', _]
```
tic:
name: Tic Tac Toe
default_save_name: Tic
Expand Down Expand Up @@ -4613,7 +4642,7 @@ adventures:
example_code: |
Hint:
```
chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L?
chosen_letter {is} {ask} 'Which letter would you like to see? F, E or L?'
{if} _
```
6:
Expand Down Expand Up @@ -4753,12 +4782,10 @@ adventures:
story_text: |
### Exercise
Recreate the drawings with the turtle!
Hint: Bracelet designing program. Firstly, define a function **for each shape** you want to use on the bacelet. Then, add the shapes to the bacelet like this:
</div>
Bracelet Designing program <img src="https://github.com/hedyorg/hedy/assets/80678586/549d7f3a-c492-4b4a-b173-746eb3400951" width="500">
example_code: |
Hint: Bracelet designing program


Firstly, define a function **for each shape** you want to use on the bacelet. Then, add the shapes to the bacelet like this:

```
{define} draw_a_square
_
Expand Down
Loading
Loading