Skip to content

Commit

Permalink
Fix minor issues with recursion lesson
Browse files Browse the repository at this point in the history
  • Loading branch information
uellenberg committed Nov 29, 2023
1 parent ba50cab commit 3d1070a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions sections/60_continuing_cs/00_recursion_intro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ more to it than that, but it's a good starting point.

---

Let's take a look at a similar example. [Click here to see how we can use recursion to calculate Fibonacci Numbers](./fibonacci.js).
Let's take a look at a similar example.

[Click here to see how we can use recursion to calculate Fibonacci Numbers](./fibonacci.js).

---

Expand Down Expand Up @@ -172,7 +174,7 @@ That's it! Our function will now print every item in the tree out, all on its ow
Here are some hints if you get stuck (click to reveal):
* ||LOCATION 1: You can think about a file as being your base case. There's no need to recurse further when you hit a file, just print it out.||
* ||LOCATION 2: Take a look at the code above. The problem you're working on is a bit more complicated, but the recursive part is exactly the same.||
* ||LOCATION 1: `console.log(fileName + ": " + fileData);`||
* ||LOCATION 2: `printFilesInFolder(fileData);`||
* ||LOCATION 1: console.log(fileName + ": " + fileData);||
* ||LOCATION 2: printFilesInFolder(fileData);||

Good luck!
6 changes: 4 additions & 2 deletions sections/60_continuing_cs/00_recursion_intro/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const myFiles = {

// Here's some code to get you started.
// Give it a try, and if you get stuck, that's alright!
// This is a really tricky topic, so there are hints included in the lesson (click the blacked out text to reveal them).
// This is a really tricky topic, so there are hints included in the lesson (click the blurred out text to reveal them).
function printFilesInFolder(filesObject) {
// This is a for loop going through every key in `filesObject`.
// It will look at every file/folder in the object.
Expand Down Expand Up @@ -72,4 +72,6 @@ function printFilesInFolder(filesObject) {
printFilesInFolder(myFiles);

// By the way, the source code for this website actually uses a piece of code super similar to this to
// deal with files, as well as lessons.
// deal with files, as well as lessons.
// This lesson was also uploaded by code like this:
// https://github.com/Cratecode/client/blob/8b2b034d7ef0d6c43719fe078be3fc802ed12baa/src/upload/manifest.ts#L60.

0 comments on commit 3d1070a

Please sign in to comment.