Skip to content

Commit 2772e38

Browse files
committed
remove chapter folder
1 parent 2f59448 commit 2772e38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+259
-183
lines changed

coderoad.json

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{
1212
"description": "Set `first` to the first item in the `students` array.",
1313
"tests": [
14-
"1/00/01-setup"
14+
"00/01-setup"
1515
],
1616
"actions": [
1717
"open('00-setup.js')",
@@ -25,7 +25,7 @@
2525
{
2626
"description": "Set `myName` to the \"name\" of the first student in the list.",
2727
"tests": [
28-
"1/00/02-setup"
28+
"00/02-setup"
2929
],
3030
"actions": [
3131
"insert('var myName= ::>\n')"
@@ -39,7 +39,7 @@
3939
{
4040
"description": "Log your name to the console.",
4141
"tests": [
42-
"1/00/03-setup"
42+
"00/03-setup"
4343
],
4444
"actions": [
4545
"insert('\nconsole.log(::>);\n')"
@@ -59,7 +59,7 @@
5959
{
6060
"description": "Write a filter condition function called `isAda` that returns true only if the name matches your name: \"Ada Lovelace\".",
6161
"tests": [
62-
"1/01/01-filter"
62+
"01/01-filter"
6363
],
6464
"actions": [
6565
"open('01-filter.js')",
@@ -74,7 +74,7 @@
7474
{
7575
"description": "Set `var myData` to filter with the `isAda` function.",
7676
"tests": [
77-
"1/01/02-filter"
77+
"01/02-filter"
7878
],
7979
"actions": [
8080
"insert('// run the function name in filter\nvar myData = students.filter(::>);\n')"
@@ -87,7 +87,7 @@
8787
{
8888
"description": "Write a filter condition called `isGoodGrade` that will filter out any \"D\" or \"F\" grades.",
8989
"tests": [
90-
"1/01/03-filter"
90+
"01/03-filter"
9191
],
9292
"actions": [
9393
"insert('\n\n// return true if student.grade is not a \"D\" or \"F\"\nfunction isGoodGrade(student) {\n ::>\n}\n')"
@@ -117,7 +117,7 @@
117117
{
118118
"description": "`compareScore` should return 1 if the first score is less than the second",
119119
"tests": [
120-
"1/02/01-sort"
120+
"02/01-sort"
121121
],
122122
"actions": [
123123
"open('02-sort.js')",
@@ -127,7 +127,7 @@
127127
{
128128
"description": "`compareScore` should return -1 if the first score is more than the second",
129129
"tests": [
130-
"1/02/02-sort"
130+
"02/02-sort"
131131
],
132132
"hints": [
133133
"set the second case to `b.score < a.score`"
@@ -136,7 +136,7 @@
136136
{
137137
"description": "`compareScore` should return 0 if the first score is the same as the second",
138138
"tests": [
139-
"1/02/03-sort"
139+
"02/03-sort"
140140
],
141141
"hints": [
142142
"no case is necessary, use the `default` case"
@@ -145,7 +145,7 @@
145145
{
146146
"description": "Set `mySorted` to the result of `myBest` sorted by `compareScore`",
147147
"tests": [
148-
"1/02/04-sort"
148+
"02/04-sort"
149149
],
150150
"actions": [
151151
"insert('// use the compare function to sort myBest\nvar mySorted = myBest::>\n')"
@@ -164,7 +164,7 @@
164164
{
165165
"description": "Make a function `changeGrade` that takes student data and changes all grades to \"A\"s.",
166166
"tests": [
167-
"1/03/01-map"
167+
"03/01-map"
168168
],
169169
"actions": [
170170
"open('03-map.js')",
@@ -179,7 +179,7 @@
179179
{
180180
"description": "Map over the `myData` with the `changeGrade` function. Set `myChanged` to the result.",
181181
"tests": [
182-
"1/03/02-map"
182+
"03/02-map"
183183
],
184184
"actions": [
185185
"insert('// map over `myData` with the `changeGrade` function\nvar myChanged = myData.map(::>);\n')"
@@ -188,7 +188,7 @@
188188
{
189189
"description": "Hold up. An A in \"Data Science\" class looks way to suspicious. Your parents might catch on to your cheating.\n\nLet's go back to `myData` and instead increment each score by 12 points.",
190190
"tests": [
191-
"1/03/03-map"
191+
"03/03-map"
192192
],
193193
"actions": [
194194
"insert('\nfunction increaseScore(::>) {\n\n}\n\n// map over `mySlightlyChanged` with a function `increaseScore` to increment each score by 12\nvar mySlightlyChanged = myData;\n')"
@@ -212,7 +212,7 @@
212212
{
213213
"description": "One more problem. Now the scores don't match the grades. you have 95 score in \"3D Computer Graphics\", but only a \"B\" grade. Set `myFixed` as the result of using the `getGrade` function to set grades according to their new scores.",
214214
"tests": [
215-
"1/03/05-map"
215+
"03/05-map"
216216
],
217217
"actions": [
218218
"insert('\n// change `getGrade` to accept an object\n// and return an object\nfunction getGrade(score) {\n switch (true) {\n case (score >= 90):\n return \"A\";\n case (score >= 80):\n return \"B\";\n case (score >= 70):\n return \"C\";\n case (score >= 60):\n return \"D\";\n default:\n return \"F\";\n }\n}\n\n// map `myFixed` to update grades to the new scores\nvar myFixed = mySlightlyChanged;\n')"
@@ -226,7 +226,7 @@
226226
{
227227
"description": "Check to make sure everything is working. Set `scoresAndGrades` to an array of scores and grades only.",
228228
"tests": [
229-
"1/03/06-map"
229+
"03/06-map"
230230
],
231231
"actions": [
232232
"insert('\n// set `scoresAndGrades` to an array of scores and grades\n// it should return an array of objects like this: {score: 75, grade: 'C'}\nvar scoresAndGrades = myFixed::>\n')"
@@ -247,7 +247,7 @@
247247
{
248248
"description": "Use `forEach` to log out your report card to the console",
249249
"tests": [
250-
"1/04/01-forEach"
250+
"04/01-forEach"
251251
],
252252
"actions": [
253253
"open('04-forEach.js')",
@@ -260,7 +260,7 @@
260260
{
261261
"description": "Add a second parameter to `logCourseWithIndex` called `index`. Then call the function with `myFixed.forEach`.",
262262
"tests": [
263-
"1/04/02-forEach"
263+
"04/02-forEach"
264264
],
265265
"actions": [
266266
"insert('\n// add a second param called 'index' to the function\nfunction logCourseWithIndex(course::>) {\n console.log(`${index + 1} ${course.grade} ${course.score} ${course.title}`);\n}\n\n// log your grades to the console with an index\nmyFixed.forEach(logCourseWithIndex);\n')"
@@ -273,7 +273,7 @@
273273
{
274274
"description": "Add a third parameter called `array` to `logCourseWithIndexAndArray`, then call the function with `myFixed.forEach`.",
275275
"tests": [
276-
"1/04/03-forEach"
276+
"04/03-forEach"
277277
],
278278
"actions": [
279279
"insert('\n// add a third param called 'array' to the function\nfunction logCourseWithIndexAndArray(course, index::>) {\n console.log(`${index + 1}/${array.length} ${course.grade} ${course.score} ${course.title}`);\n}\n\n// log your grades to the console with an index and array length\nmyFixed.forEach(logCourseWithIndexAndArray);\n')"
@@ -286,7 +286,7 @@
286286
{
287287
"description": "What??? Suddenly Your data has all disappeared!\n\nIt seems `myFixed` relies on a chain of methods.\n\n```js\nmyFixed = students\n .filter(isAda)\n .sort(compareScore)\n .map(increaseScore)\n .map(getGrade)\n .forEach(logCourseWithIndexAndArray)\n```\n\nThis is why side-effects are dangerous. Students data must have changed, and now all of your transformations are effected.",
288288
"tests": [
289-
"1/04/04-forEach"
289+
"04/04-forEach"
290290
],
291291
"actions": [
292292
"insert('\nconsole.log(myFixed);\n')"
@@ -302,7 +302,7 @@
302302
{
303303
"description": "`filter` to `students` in the class titled \"Web Security\"",
304304
"tests": [
305-
"1/05/01-find"
305+
"05/01-find"
306306
],
307307
"actions": [
308308
"open('05-find.js')",
@@ -316,7 +316,7 @@
316316
{
317317
"description": "`find` the name in `myClass` that isn't in the list of known students",
318318
"tests": [
319-
"1/05/02-find"
319+
"05/02-find"
320320
],
321321
"actions": [
322322
"insert('\nvar otherStudents = [\"Albert Gonzalez\", \"Brian Kernaghan\", \"Danielle Bunten Berry\", \"Donald Knuth\", \"Grace Hopper\", \"Hack Kerr\", \"James Gosling\", \"Ken Thompson\", \"Kevin Mitnick\", \"Linus Torvalds\", \"Niklaus Wirth\", \"Rebecca Heineman\", \"Tim Berners-Lee\", \"Xiao Tian\", \"Ying Cracker\"];\n\n')",
@@ -331,7 +331,7 @@
331331
{
332332
"description": "`filter` down to students without known names",
333333
"tests": [
334-
"1/05/03-find"
334+
"05/03-find"
335335
],
336336
"actions": [
337337
"insert('\n// filter using `notInList`\nvar unknownStudentList = students.filter(::>);\n')"
@@ -343,7 +343,7 @@
343343
{
344344
"description": "`map` over the result to get only the `name` property",
345345
"tests": [
346-
"1/05/04-find"
346+
"05/04-find"
347347
],
348348
"actions": [
349349
"insert('\n// list only student names\nvar unknownStudentNames = unknownStudentList.map(::>);\n')"
@@ -355,7 +355,7 @@
355355
{
356356
"description": "`join('')` the array of names to output the result as a string",
357357
"tests": [
358-
"1/05/05-find"
358+
"05/05-find"
359359
],
360360
"actions": [
361361
"insert('\n// use `.join('')` to join the array of strings\nvar decodedName = unknownStudentNames::>;\nconsole.log(decodedName);\n')"
@@ -374,7 +374,7 @@
374374
{
375375
"description": "First, test out `flatten` on the `flattenedArray`",
376376
"tests": [
377-
"1/06/01-concat"
377+
"06/01-concat"
378378
],
379379
"actions": [
380380
"open('06-concat.js')",
@@ -388,7 +388,7 @@
388388
{
389389
"description": "Now `map` over the courses array, and `map` over the students array inside of it.\nReturn the fields:\n\n * title\n * instructor\n * name\n * grade\n * score",
390390
"tests": [
391-
"1/06/02-concat"
391+
"06/02-concat"
392392
],
393393
"actions": [
394394
"insert('\n// map over courses then\n// map over students inside of courses\nvar doubleArray = courses.map(function(course) {\n return course.students.map(function(student) {\n return {\n // fill in the fields\n title: ::>'',\n instructor: '',\n name: '',\n score: '',\n grade: ''\n };\n });\n});\n\n')"
@@ -401,7 +401,7 @@
401401
{
402402
"description": "Use `flatten` to put all data into a single array. Set `students` to the result.",
403403
"tests": [
404-
"1/06/03-concat"
404+
"06/03-concat"
405405
],
406406
"actions": [
407407
"insert('// `flatten` doubleArray\nvar students = doubleArray::>;\n')"
@@ -413,7 +413,7 @@
413413
{
414414
"description": "Use the `suspects` array to `filter` to only \"Hack Kerr\"'s data",
415415
"tests": [
416-
"1/06/04-concat"
416+
"06/04-concat"
417417
],
418418
"actions": [
419419
"insert('\nvar suspects = [\"Hack Kerr\"];\n// filter to data matching `suspects`\n\nvar suspectData = students::>;\n')"
@@ -422,7 +422,7 @@
422422
{
423423
"description": "You just thought of two more suspects! Make a new variable called `newSuspects` and add it above `suspects`.\n\n```js\nvar newSuspects = ['Albert Gonzalez', 'Kevin Mitnick'];\n```\n\n`concat` the `newSuspects` onto the `suspects` list.",
424424
"tests": [
425-
"1/06/05-concat"
425+
"06/05-concat"
426426
],
427427
"hints": [
428428
"call `suspects.concat()` with `newSuspects`"
@@ -438,7 +438,7 @@
438438
{
439439
"description": "Use `reduce` to sum the numbers in the `practice` array",
440440
"tests": [
441-
"1/07/01-reduce"
441+
"07/01-reduce"
442442
],
443443
"actions": [
444444
"open('07-reduce.js')",
@@ -452,7 +452,7 @@
452452
{
453453
"description": "Not all reduce functions are so easy. `reduce` is a little more difficult to master.\n\n`map` over each course and use `reduce` to calculate the class averages for each class. Set `averages` to the resulting array of all class averages.",
454454
"tests": [
455-
"1/07/02-reduce"
455+
"07/02-reduce"
456456
],
457457
"actions": [
458458
"insert('\nvar averages = courses.map(function(course) {\n var sum = course.students.reduce(function(total, student) {\n ::>\n\n });\n return Math.round(sum / course.students.length, 0);\n});\n')"
@@ -466,7 +466,7 @@
466466
{
467467
"description": "`reduce` to an array of suspect scores from the `suspectData` we collected previously.",
468468
"tests": [
469-
"1/07/03-reduce"
469+
"07/03-reduce"
470470
],
471471
"actions": [
472472
"insert('\n// [{ name: 'suspectName', scores: [ 50, 65, 75, 85...] } ...]\nvar suspectScores = suspectData.reduce(function(total, next) {\n // see if suspect name has a list yet\n var index = total.findIndex(function(suspect) {\n return suspect.name === next.name;\n });\n if (index < 0) {\n total.push({\n ::>\n\n });\n } else {\n // push the next score onto the suspects scores\n total[index].scores.push();\n }\n return total;\n}, []);\n\n')"
@@ -481,7 +481,7 @@
481481
{
482482
"description": "`map` over suspect data to find the `\"difference\"` from subtracting the students score from the average score. Add this to `suspectScores` using the key `difference`. The resulting array should look like this:\n```js\n[{\n name: 'suspectName',\n scores: [50, 65, 75 ...],\n difference: 15\n}]\n```",
483483
"tests": [
484-
"1/07/04-reduce"
484+
"07/04-reduce"
485485
],
486486
"actions": [
487487
"insert('\nvar suspectStats = suspectScores.map(function(suspect) {\n // calculate the total difference in scores from the averages\n var difference = suspect.scores.reduce(::>);\n\n return {\n name: suspect.name,\n scores: suspect.scores,\n difference: difference\n };\n});\n')"
@@ -495,7 +495,7 @@
495495
{
496496
"description": "`reduce` down to likely suspect names by filtering with the `isCheater` function.\n\nThis could be done with a `filter` & `map`, but it is simpler to just use one `reduce`.",
497497
"tests": [
498-
"1/07/05-reduce"
498+
"07/05-reduce"
499499
],
500500
"actions": [
501501
"insert('\nfunction isCheater(suspect) {\n return suspect.difference > 200;\n}\n\n// reduce down to a string of likely suspects\nvar likelySuspects = suspectStats.reduce(function(::>) {}, []);\n')"
@@ -507,7 +507,7 @@
507507
{
508508
"description": "It looks like we have a likely suspect.",
509509
"tests": [
510-
"1/07/06-reduce"
510+
"07/06-reduce"
511511
],
512512
"actions": [
513513
"insert('console.log(likelySuspects);\n')"

0 commit comments

Comments
 (0)