Write a program or function that takes in an integer greater than 1 or less than -1. That is, the input won't be 0, 1, or -1.
If the input is 2
, the output should be:
|\_/|
|___|
If the input is 3
, the output should be:
|\_/\_/|
|______|
If the input is 4
, the output should be:
|\_/\_/\_/|
|_________|
The pattern continues in the same exact manner for larger inputs. For example, if the input is 10
, the output should be:
|\_/\_/\_/\_/\_/\_/\_/\_/\_/|
|___________________________|
If the input is -2
, the output should be:
____
| |
|_/\_|
If the input is -3
, the output should be:
_______
| |
|_/\_/\_|
If the input is -4
, the output should be:
__________
| |
|_/\_/\_/\_|
The pattern continues in the same exact manner for smaller inputs. For example, if the input is -10
, the output should be:
____________________________
| |
|_/\_/\_/\_/\_/\_/\_/\_/\_/\_|
The output can be printed or returned as a string with an optional trailing newline. The top right "empty" corner of the output for negative inputs may be a space or it may remain empty.
The shortest code in bytes wins.