18
2
Challenge
You just bought a brand new chair! Problem is, you have no idea how to control it so you'll need to write a program to do it for you.
You can only sit in the unadjusted chair for so long. So your code will need to be as short as possible.
Examples
5,3,2,2,1
O
|
|
| _
| |
|_|_
|
|
O
3,5,2,3,5
O
| _
| |
|__|__
|
|
__|__
OOOOO
2,13,1,1,13
O
| _
|______|______
______|______
OOOOOOOOOOOOO
Am I the only one who thinks this look like an airplane?
Chair parts
The chair has various components:
O
|
| <- Backrest
| _ <- Armrest
| |
|__|__ <- Seat
|
| <- Leg
_|_
OOO <- Wheels
Input
You will be outputting a chair given various variables.
The input will be in the following order, all inputs will be positive integers (always greater than 0) and will always be provided.
- Backrest Height
- Seat Width always odd
- Armrest Height Always less than backrest height
- Leg Height
- Wheel count Always less than or equal to seat width and Always odd
Detailed part Descriptions
The parts of the chair are:
Backrest: This amount of | is the Backrest Height
O
|
|
Seat: The amount of _ is the Seat Width, insert a | in the middle for the armrest.
__|__
Armrest: The amount of | is the Armrest Height. This should be inserted in the middle of the seat.
_
|
|
Leg: The amount of | is determined by Leg Height
|
|
Wheels: The wheels are centered below the legs. If they are more than one, all but the center wheel should have _ in the line above them.
_ _
OOO
Output
The output may have a trailing newline. Each line may have trailing spaces. Leading whitespace is not allowed



The third test case appears to be wrong. The seat width is far more than 2. – Doorknob – 2015-12-18T02:36:50.213
@Doorknob冰 whoops, that was a problem with the input order, I've fixed it. – Downgoat – 2015-12-18T02:38:28.447
The "airplane" one reminds me a lot of these tanks from Super Mario Bros 3.
– El'endia Starman – 2015-12-18T02:58:54.470