Skip to content

Commit 21bd3d5

Browse files
content changes (-mehal)
1 parent 93b863b commit 21bd3d5

7 files changed

+8
-22
lines changed

dashboard/config/scripts/levels/U3 - Loops And Arrays - Add 5.level

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"edit_code": true,
3838
"embed": "false",
3939
"instructions": "Add 5 to all the values in an array (Click to see full instructions)",
40-
"markdown_instructions": "# Updating Values in Array with For Loop\r\n\r\nThe `for` loop you set up on the last level is actually so common we will rarely deviate from this `for` loop setup.\r\n\r\n<img src=\"https://images.code.org/fba4d95636869c1c1c1a539fe81ded72-image-1447346793054.45.50 AM.png\" style=\"width: 350px\">\r\n\r\nThis `for` loop basically means \"for every possible index in `myArray`...\" and we use it as a basic building block for processing arrays all the time. \r\n\r\nWith a basic structure that allows us to visit every element in an array we can begin thinking about ways to process arrays. We can display all the values, we can change them, we can add them all up, we can compare elements that are next to each other, we can search for values, we can re-order things, etc. \r\n\r\nYou already displayed all the values. Let's try changing every element. \r\n\r\n# Do This\r\n\r\n**Add 5 to each value in the array.**\r\n\r\n**Starting code:** We've given you some starting code that adds a bunch of random values to an array, displays the array, and set up a `for` loop that loops over every index in the array.\r\n\r\n* You should **add code inside the loop** to add 5 to the value at every location in the array. ** Remember: ** myArray[i] refers to the spot in the array at the current value of i.\r\n\r\n* Verify that it works by inspecting the before and after messages in the console.",
40+
"markdown_instructions": "# Updating Values in Array with For Loop\r\n\r\nThe `for` loop you set up on the last level is actually so common we will rarely deviate from this `for` loop setup.\r\n\r\n<img src=\"https://images.code.org/fba4d95636869c1c1c1a539fe81ded72-image-1447346793054.45.50 AM.png\" style=\"width: 350px\">\r\n\r\nThis `for` loop basically means \"for every possible index in `myArray`...\" and we use it as a basic building block for processing arrays. Common array processing techniques like searching for a value, updating all values, or calculating simple summary statistics will all be completed with a `for` loop written with the syntax above.\r\n\r\nIn fact, we're going to see that happen right now as we **use a for loop to add 5 to every value in an array**.\r\n\r\n# Do This\r\n\r\n* **Starter code** has been provided that creates an array of random values. Below you are given a `for` loop that loops over every index in the array, **using the syntax shown above**.\r\n* Add code inside the loop to **add 5 to the value at every location in the array**. \r\n\t* ** Remember: ** `myArray[i]` refers to the index in the array at the current value of i.\r\n* Confirm your code works by **displaying the values is your array before and after your loop**.\r\n\r\n![](https://images.code.org/aaf36ac93098ef7f43fdda04243d17ad-image-1447792214666.29.41 PM.png)",
4141
"is_k1": "false",
4242
"skip_instructions_popup": "false",
4343
"never_autoplay_video": "false",
@@ -67,7 +67,7 @@
6767
"submittable": "false",
6868
"hide_view_data_button": "true",
6969
"debugger_disabled": "false",
70-
"start_blocks": "var myArray = [];\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\n\r\nconsole.log(\"Before: \" + myArray);\r\n\r\nfor( var i=0; i<myArray.length; i++){\r\n \r\n}\r\n\r\nconsole.log(\"After: \" + myArray);"
70+
"start_blocks": "var myArray = [];\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\n\r\nconsole.log(\"Before: \" + myArray);\r\n\r\nfor(var i=0; i<myArray.length; i++){\r\n \r\n //Your code goes here\r\n \r\n}\r\n\r\nconsole.log(\"After: \" + myArray);"
7171
}
7272
}]]></config>
7373
<blocks/>

dashboard/config/scripts/levels/U3 - Loops And Arrays - General Search Param.level

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,7 @@
165165
"submittable": "false",
166166
"hide_view_data_button": "true",
167167
"debugger_disabled": "false",
168-
"project_template_level_name": "U3 - Loops And Arrays - Linear Search Function Template",
169-
"encrypted_examples": [
170-
171-
]
168+
"project_template_level_name": "U3 - Loops And Arrays - Linear Search Function Template"
172169
}
173170
}]]></config>
174171
<blocks/>

dashboard/config/scripts/levels/U3 - Loops And Arrays - Intro For Loop.level

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@
6666
"beginner_mode": "false",
6767
"submittable": "false",
6868
"hide_view_data_button": "true",
69-
"debugger_disabled": "false",
70-
"encrypted_examples": [
71-
72-
]
69+
"debugger_disabled": "false"
7370
}
7471
}]]></config>
7572
<blocks/>

dashboard/config/scripts/levels/U3 - Loops And Arrays - Print Array.level

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@
6767
"submittable": "false",
6868
"hide_view_data_button": "true",
6969
"debugger_disabled": "false",
70-
"start_blocks": "var myArray = [];\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));",
71-
"encrypted_examples": [
72-
73-
]
70+
"start_blocks": "var myArray = [];\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));\r\nappendItem(myArray, randomNumber(1,10));"
7471
}
7572
}]]></config>
7673
<blocks/>

dashboard/config/scripts/levels/U3L12 Chaser Template.level

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@
5555
"return": null
5656
},
5757
"edit_code": true,
58-
"encrypted_examples": [
59-
60-
],
6158
"embed": "false",
6259
"instructions": "This is a project template!",
6360
"is_k1": "false",

dashboard/config/scripts/levels/U3L14 - moving memory challenge2.level

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"debugger_disabled": "true",
4646
"instructions": "Using only the variables provided, assignment (=) and arithmetic (+ - * /) re-assign the values to make the console.log statement display the correct value(s). (Click to see full instructions)",
4747
"lock_zero_param_functions": "false",
48-
"execute_palette_apis_only": "false"
48+
"execute_palette_apis_only": "false",
49+
"encrypted_examples": "hTdkXJ6GfxVOSdlnnNuVRrd6eHaiSf6qJlWF9/ZHjVY5s8/b81+MIF9dn2s7\nABeb\n"
4950
}
5051
}]]></config>
5152
<blocks/>

dashboard/config/scripts/levels/U3L19 - test reassignment of two vars.level

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@
4545
"debugger_disabled": "true",
4646
"video_key": "csp_applab_variables_2",
4747
"lock_zero_param_functions": "false",
48-
"execute_palette_apis_only": "false",
49-
"encrypted_examples": [
50-
51-
]
48+
"execute_palette_apis_only": "false"
5249
}
5350
}]]></config>
5451
<blocks/>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy