Recursion

Recursion
Recursion is a technique of solving a problem by breaking it down into smaller problems until it can't be broken down anymore. There are two ways to apply recursion. The first way is to use a loop, typically a while loop. The second way is to have a function call itself.
For example, to determine if a number is a power of 3, divide the number by 3. If the result is not a whole number, then the number is not a power of 3. But if it is a whole number, continue the process until the result is 1.
Project 1: Droste Effect
Template: Click this link, fork, and invite mrcodeswildride: new project
Hint: Create a div with a background-image for each mirror. Append each div to the previous mirror.
Project 2: Prime Factorization
Template: Click this link, fork, and invite mrcodeswildride: new project
Hint: For determining if a number is a factor, use the remainder operator.
Project 3: Decimal Converter
Template: Click this link, fork, and invite mrcodeswildride: new project
Hint: Output one or two Roman numerals at a time, subtracting the value from the number until it reaches zero.
Project 4: Wildcards
Template: Click this link, fork, and invite mrcodeswildride: new project
Hint: Loop through every character in the user input. Each time through the loop, get all of the possibilities for the character, and combine each possibility with each of the previously found words.
Hint: For getting all of the possibilities for each character, refer to the character codes page.
Hint: For determining if a word is an actual word, refer to the word dictionary page.
Project 5: Anagrams
Template: Click this link, fork, and invite mrcodeswildride: new project
Hint: Loop through every character in the user input. Each time through the loop, insert the character in every possible position for each of the previously found words.
Hint: For extracting parts of a string, use the substring method.
Last section Next section