I have a chocolate bar and I need help eating it so you'll be writing a program just to do that.
Explanation
The first line is the input. Examples are separated by an empty line.
7
____
__|__|
|__|__|
|__|__|
|__|__|
6
_______
|__|__|
|__|__|
|__|__|
5
____
__|__|
|__|__|
|__|__|
0
1
____
|__|
Spec
Hopefully the examples clearly specify this challenge but to avoid any possible confusion, here's a spec:
You can have a single optional trailing/leading whitespace
An input of 0
is an empty output.
If the input is even, the top rows looks like:
_______
|__|__|
If it's odd, the top row is:
____
|__|
If it's odd and greater than 1, the top rows are:
____
__|__|
The following rows are:
|__|__|
until the number of instances of |__|
is the same as the input
1
? Does input of0
need to be supported? \$\endgroup\$ – Doorknob♦ Feb 6 '16 at 17:49