House of cards (version 1) Version 2 here.


Simple challenge: given an integer, draw a house of cards with the given number of stories. If the number is negative, draw the house upside-down. Examples:

Input: 2
Output:

 /\
 --
/\/\

Input: 5
Output:

    /\
    --
   /\/\
   ----
  /\/\/\
  ------
 /\/\/\/\
 --------
/\/\/\/\/\

Input: 0
Output: &lt;empty, whitespace or newline&gt;

Input: -3
Output:

\/\/\/
 ----
 \/\/
  --
  \/


Input can be numeric or a string. Output must be exactly as shown, with leading and/or trailing spaces and newlines allowed.

This is code-golf, so may the shortest program/function for each language win!
Python 2, 97 95 94 92 bytes

-2 bytes thanks to Luka
This version produces an exception  on n=0,but without printing anything


n=input()*2
m=abs(n)
for i in range(2,m+1)[::n/m]:print(i/2*'/-\-'[i%2::2][::n/m]).center(m)


Try it online!

Non-error version, Python 2, 94 bytes



n=input()*2
x=n&gt;0 or-1
for i in range(2,x*n+1)[::x]:print(i/2*'/-\-'[i%2::2][::x]).center(n*x)


Try it online!