Your task is to create a program or function that generates a zipper with a length of 10 lines. Each line of the zipper is represented by two dashes --
:
--
--
--
--
--
--
--
--
--
--
The program/function will take a percentage (divisible by 10) as input, and the output will be the zipper "unzipped" (dashes separated) from the top by the percentage, revealing the 1-indexed, lowest level repeated 2 times, with all prior levels repeated 4, 6, 8, ...etc. times, while keeping the bottom of the zipper centered.
Examples
>>10%
-11-
--
--
--
--
--
--
--
--
--
>>50%
-1111111111-
-22222222-
-333333-
-4444-
-55-
--
--
--
--
--
>>100%
-11111111111111111111-
-222222222222222222-
-3333333333333333-
-44444444444444-
-555555555555-
-6666666666-
-77777777-
-888888-
-9999-
-10-
The input (percentage) can be formatted however you like (50%, .5, 50, 5 [zero implied], etc), and it will always be in the range of 0 to 100 and divisible by 10. The spacing in the examples must be preserved in your output.
0%
? Are we allowed to take the input divided by 10? e.g. instead of50%
, get5
? \$\endgroup\$5
? \$\endgroup\$