Imagine for a second that you can compose a tree out of dots.
. ... ..... ....... ......... ........... ............. ............... ... ...
This tree is 13 dots tall.
Now imagine for a second that your filesystem looked like these dots. Your task in this challenge is to make a tree out of folders.
Given an input integer (let's call it
n), make a tree out of subdirectories.
- In each tree, you should start with a folder called 1.
- In that folder, put the folders 1, 2, and 3.
- In every level of folder thereon until
n-3, in folder 1 of this level of the tree, there should be a folder labelled 1 and 2. In folder 2 of this level of the tree, there should be a folder called 3, in folder 3, a folder called called 4, and so on until the last folder (the integer this folder is called, we'll call
k), in which there should be a folder called
kand one called
- At level
n-3, however, all of the subdirectories but the middle three folders should be replaced with a file with the name that the subdirectories would have had. The middle three subdirectories should remain as subdirectories.
- These three subdirectories should contain a folder called 1, 2, or 3 with respect to the order of these directories' name.
- These are followed by a layer of files where 1 is in folder 1, 2 is in folder 2, and 3 is in folder three.
The example shown at the top of this question is represented below in folder form.
This would be
n = 13.
- You may use builtins for folder creation, but not for subdirectory creation.
- All other standard loopholes apply.
- You must support past n=5, but do not have to support greater than n=30.