House of cards (version 2) Thanks to FryAmTheEggman for the idea for this second version.
  Version 1 here.


Not-so-simple challenge: given a number of cards, build the biggest house of cards you can with that number of cards, according to the following building order:

                          /\       /\         /\         /\/\
                 --       --       --         ----       ----
/\  →  /\/\  →  /\/\  →  /\/\  →  /\/\/\  →  /\/\/\  →  /\/\/\  →

                /\         /\
     --         --         --
    /\/\       /\/\       /\/\
    ----       ----       ----
→  /\/\/\  →  /\/\/\  →  /\/\/\/\  →  ...


So you start with a single-storey house, then build the adjacent group, then put the bridge card, then build the group in the second floor, then start building groups and bridges from the first floor diagonally to reach the third floor, and so on.

A single card will be represented with a /, a \ or a --. If after using as many cards as possible you have one card left, just output what you have accomplished so far (see example for 3 cards, the result is the same as for 2 cards). The only exception is the case of 1 card, that must output a flat card.

Examples:

Input: 1
Output: 

--   &lt;a card lying on the floor&gt;

Input: 2
Output:

/\

Input: 3
Output:

/\

Input: 5
Output:

 --
/\/\

Input: 10
Output:

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

Input: 20
Output:

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

Input: 39
Output:

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

Input: 40
Output:

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


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

This is code-golf, so may the shortest program/function for each language win!
Charcoal, 67 bytes

Ｎθ⁼θ¹Ａ²ηＷ¬‹θη«←÷η³↓→/…\/÷η³↙Ａ⁻θηθＡ⁺³ηη»‖ＭＭ÷η³→Ｆθ≡﹪ι³¦¹«↗←\/»²«↑Ｐ²»«


Try it online! Note: The latest version of Charcoal doesn't need the »« for -2 bytes. Explanation:

Ｎθ


Read the input as an integer into θ.

⁼θ¹


Special case: if the input is 1, print a -.

Ａ²ηＷ¬‹θη«


η represents the number of cards needed to build the next layer, initially 2. A while loop repeats as long as there are enough cards for the layer.

←÷η³↓→/…\/÷η³↙


Print the left half of the next layer. (I wanted to print the right half, but I couldn't get it to reflect properly for some reason.) The number of -s is one third of the number of cards in the layer, rounded down. (See also my answer to part 1.)

Ａ⁻θηθＡ⁺³ηη»


Subtract the number of cards from the input number, and add three cards to the number required for the next layer.

‖Ｍ


Mirror the house so far. (This also turns the - into -- for the case of 1 card.)

Ｍ÷η³→


Move the cursor to the right of the house.

Ｆθ


Repeat for each remaining card (if any).

≡﹪ι³¦


If the card modulo 3 is:

¹«↗←\/»


1, then print a pair of cards;

²«↑Ｐ²»


2, then print a horizontal card;

«


Otherwise skip the card (because a pair is needed at this point).