Help the architects visualize the skyline As part of a city planning project, you've gotten the assignment of creating a program or function that will display the city skyline, given some input from the architects. The project is only in the startup phase, so a very rough sketch is sufficient. The easiest approach is of course to simply draw the skyline in ASCII-art. 

All buildings will be by the river, thus they are all aligned. The architects will give the height of each building as input, and your code should display the skyline. 

The input from the architects will either be an integer or a half-integer. If the number is an integer, the building will have a flat roof, while a half-integer will result in a pitched roof. A zero will just be flat ground. The walls of a building are 3 characters apart, while a zero will be a single character wide. Adjacent buildings share walls. 

For details and clarifications regarding the output, please have a look at the examples below:

N = 3
 ___
|   |
|   |
|___|

N = 3.5
  _      
 / \
|   |
|   |
|___|

N = 6
 ___
|   |
|   |
|   |
|   |
|   |
|___|

n = 0
_


Example input: 3 3.5 0 2

      _
 ___ / \  
|   |   |  ___
|   |   | |   |
|___|___|_|___|


Example input: 0 0 2.5 3 0 4 1

             ___
    _  ___  |   |
   / \|   | |   |
  |   |   | |   |___
__|___|___|_|___|___|


Louisville, 0 2 1 3.5 0 4 2 4 2 4 6 1 6 0 5 1

                                    ___     ___
                                   |   |   |   |  ___
           _    ___     ___     ___|   |   |   | |   |
          / \  |   |   |   |   |   |   |   |   | |   |
  ___    |   | |   |___|   |___|   |   |   |   | |   |
 |   |___|   | |   |   |   |   |   |   |___|   | |   |___
_|___|___|___|_|___|___|___|___|___|___|___|___|_|___|___|


The ASCII-characters used are: newline, space, and /\_| (code points 10, 32, 47, 92, 95, 124).

Rules:


It's optional to make a program that only take integers as input, by multiplying all numbers by two. So, instead of taking 3 3.5 2, your program may take 6 7 4. If the second input format is chosen, an input of 6 should result in a 3 story building, 7 should be a 3 story building with pitched roofs etc.
The output should be exactly as described above, but trailing spaces and newlines are OK.
The exact format of the input is optional. Whatever is best in your language.
The result must be displayed on the screen, so that the architects can have a look at it.
You can assume there will be at least one integer given, and that only valid input will be given.


This is codegolf, so the shortest code in bytes win.
MATLAB, 219 209 203 bytes
i=input('');x=1;c=0;m(1:4*numel(i))='_';for a=i;b=fix(a);m(1:b,x)='|';s=95;if a~=b;m(b+2,x+2)=95;s='/ \';end;m(b+1,x+(1:3))=s;x=x+(a&gt;0)*3+1;m(1:b,x)='|';x=x+(a&lt;1&amp;c&gt;0);c=a;end;disp(flipud(m(:,1:x-(a&lt;1))))

This unfortunately doesn't work on Octave. Not entirely sure why, seems to be something to do with the disp/flipud bit that breaks.
Also, there is currently no definition of what a 0.5 height building looks like, nor any mention of them, so in this code I assume that they are disallowed.
The following is the code in a slightly more readable way:
i=input(''); %e.g. [0 0 2 1 3.5 0 4 2 4 2 4 6 1 6 0 5 1 0 0 1 0]
x=1;
c=0;
m(1:4*numel(i))='_';
for a=i;
    b=fix(a);
    m(1:b,x)='|';
    s=95;
    if a~=b;
        m(b+2,x+2)=95;
        s='/ \';
    end;
    m(b+1,x+(1:3))=s;
    x=x+(a&gt;0)*3+1;
    m(1:b,x)='|';
    x=x+(a&lt;1&amp;c&gt;0);
    c=a;
end;
disp(flipud(m(:,1:x-(a&lt;1))))


First we take an input as an array, and do some variable initialisation.
i=input(''); %e.g. [0 0 2 1 3.5 0 4 2 4 2 4 6 1 6 0 5 1]
x=1;
c=0;

Because the zero height buildings are a pain - they basically end up with a width which is dependent on what they are next to (though what is printed doesn't change), we simplify things by drawing enough ground for all of the buildings. We assume each building will be 4 characters wide (because adjacent buildings merge together) - zero height ones aren't, but the excess will be trimmed later.
m(1:4*numel(i))='_';

Now we draw out each building in turn.
for a=i

First we get the integer part of the height as this will determine how many '|' we need.
    b=fix(a);

Now draw in the wall for this building - if there are two adjacent buildings, the wall for this new one will be in the same column as the wall from the last one.
    m(1:b,x)='|';

Check to see if this is a half height building. If it is, then the roof will be different. For the half heights, the roof is going to be / \ whereas full height ones it will be ___ (Matlab will implicitly replicate this from a single underscore, so save a couple of bytes there). There is an extra bit of roof one row higher for the half height buildings, so that is added as well.
    s=95;
    if a~=b;
        m(b+2,x+2)=95;
        s='/ \';
    end;

Draw in the roof
    m(b+1,x+(1:3))=s;

Now move to the start of the next building and draw in the shared wall (if the wall is too short at this point, it will be made larger when the next building is drawn). Note that zero height buildings are 1 wide, normal buildings are 4 wide, so we simplify what would otherwise be an if-else by treating (a&gt;0) as a decimal number not a Boolean.
    x=x+(a&gt;0)*3+1;
    m(1:b,x)='|';

Next comes a bit of hackery to work with zero height buildings. Basically what this says is if this building was zero height, and the one before that wasn't, it means the place of the next building needs incrementing by 1 because a zero height building sandwiched between two other buildings is effectively twice as wide - this accounts for the extra wall which is normally shared with an adjacent building. We also keep track of this building height for doing this check next time.
    x=x+(a&lt;1&amp;c&gt;0);
    c=a;
end;

Once done, flip the building matrix to be the correct way up, and display it. Note that we also trim off any excess ground here as well.
disp(flipud(m(:,1:x-(a&lt;1))))


So, when we run this script, we are asked for our input, for example:
[0 0 2 1 3.5 0 4 2 4 2 4 6 1 6 0 5 1 0 0 1 0]

It then generates the building and displays the result. For the above input, the following is generated:
                                     ___     ___                   
                                    |   |   |   |  ___             
            _    ___     ___     ___|   |   |   | |   |            
           / \  |   |   |   |   |   |   |   |   | |   |            
   ___    |   | |   |___|   |___|   |   |   |   | |   |            
  |   |___|   | |   |   |   |   |   |   |___|   | |   |___    ___  
__|___|___|___|_|___|___|___|___|___|___|___|___|_|___|___|__|___|_