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

[CONTENT] Level 6 problem in debugging and calculator adventures #4788

Merged
merged 5 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions content/adventures/ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -878,34 +878,34 @@ adventures:
**Warning! This code needs to be debugged!**
```
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
```
start_code: |
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
7:
story_text: |-
Expand Down
38 changes: 22 additions & 16 deletions content/adventures/bg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ adventures:
```
story_text_2: |
You can also let the computer do random calculations on its own using {random}.
This is how you choose a number of tables to practice, and from that you always get a different sum:
example_code_2: |
```
tables = 4, 5, 6, 8
Expand All @@ -549,7 +548,14 @@ adventures:
```
story_text_3: |
You can also let the computer do random calculations on its own using {random}.
This is how you choose a number of tables to practice, and from that you always get a different sum:
example_code_3: |
numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
number_1 = _
number_2 = _
correct_answer = number_1 * number_2
given_answer = 'What is ' number_1 ' times ' number_2 '?'
{if} _
{else} _
start_code: '{print} ''Welcome to this calculator!'''
9:
story_text: |
Expand Down Expand Up @@ -902,34 +908,34 @@ adventures:
**Warning! This code needs to be debugged!**
```
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
```
start_code: |
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
7:
story_text: |-
Expand Down
38 changes: 22 additions & 16 deletions content/adventures/bn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ adventures:
```
story_text_2: |
You can also let the computer do random calculations on its own using {random}.
This is how you choose a number of tables to practice, and from that you always get a different sum:
example_code_2: |
```
tables = 4, 5, 6, 8
Expand All @@ -543,7 +542,14 @@ adventures:
```
story_text_3: |
You can also let the computer do random calculations on its own using {random}.
This is how you choose a number of tables to practice, and from that you always get a different sum:
example_code_3: |
numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
number_1 = _
number_2 = _
correct_answer = number_1 * number_2
given_answer = 'What is ' number_1 ' times ' number_2 '?'
{if} _
{else} _
start_code: '{print} ''Welcome to this calculator!'''
9:
story_text: |
Expand Down Expand Up @@ -897,34 +903,34 @@ adventures:
**Warning! This code needs to be debugged!**
```
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
```
start_code: |
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
7:
story_text: |-
Expand Down
37 changes: 22 additions & 15 deletions content/adventures/ca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,14 @@ adventures:
```
story_text_3: |
You can also let the computer do random calculations on its own using {random}.
This is how you choose a number of tables to practice, and from that you always get a different sum:
example_code_3: |
numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
number_1 = _
number_2 = _
correct_answer = number_1 * number_2
given_answer = 'What is ' number_1 ' times ' number_2 '?'
{if} _
{else} _
start_code: '{print} ''Welcome to this calculator!'''
9:
story_text: |
Expand Down Expand Up @@ -927,34 +934,34 @@ adventures:
**Warning! This code needs to be debugged!**
```
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
```
start_code: |
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
7:
story_text: |-
Expand Down
38 changes: 22 additions & 16 deletions content/adventures/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ adventures:
```
story_text_2: |
You can also let the computer do random calculations on its own using {random}.
This is how you choose a number of tables to practice, and from that you always get a different sum:
example_code_2: |
```
tables = 4, 5, 6, 8
Expand All @@ -543,7 +542,14 @@ adventures:
```
story_text_3: |
You can also let the computer do random calculations on its own using {random}.
This is how you choose a number of tables to practice, and from that you always get a different sum:
example_code_3: |
numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
number_1 = _
number_2 = _
correct_answer = number_1 * number_2
given_answer = 'What is ' number_1 ' times ' number_2 '?'
{if} _
{else} _
start_code: '{print} ''Welcome to this calculator!'''
9:
story_text: |
Expand Down Expand Up @@ -896,34 +902,34 @@ adventures:
**Warning! This code needs to be debugged!**
```
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
```
start_code: |
{print} 'Vending machine'
chosen_product = {ask} 'Please select a product'
chosen_product = {ask} 'Please select a product'
1_dollar_products = coke orange juice water
2_dollar_products = chocolate, cookie, museli bar
3_dollar_prodcuts = potato chips, beef jerky, banana bread
{if} chosen {in} 1_dollar_products
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
{if} chosen_product {in} 3_dollar_products
price = 3
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_products
total = price + amount_of_product
{print} 'That will be $' price 'please'
7:
story_text: |-
Expand Down
Loading
Loading