Skip to content

Instantly share code, notes, and snippets.

@marsrvr
Created March 19, 2019 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marsrvr/a0d8af627c9e7ae5af4da85a605f1c74 to your computer and use it in GitHub Desktop.
Save marsrvr/a0d8af627c9e7ae5af4da85a605f1c74 to your computer and use it in GitHub Desktop.
IvanOnTech Smart Contract Programming Course, Eloquent JavaScript Chapter 2, Problem 1: Create an n-tall/wide tree from a pattern (nominally '#'s)
function recursetree(pattern, endlevel ) {
// Create an n-tall/wide tree from a pattern (nominally '#'s)
// Recursive solution by Bob Clark 3/19/19
console.log(pattern);
if (pattern.length < endlevel) {
recursetree(pattern + '#', endlevel);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment