Build an ASCII Hotel

5

Every 3 seconds, add a room to the house.

A house with one room looks like this:

|---|
|[=]|
|---|

Two rooms:

|---||---|
|[=]||[=]|
|---||---|

Three rooms:

|---|
|[=]|
|---|

|---||---|
|[=]||[=]|
|---||---|

Four rooms:

|---||---|
|[=]||[=]|
|---||---|
|---||---|
|[=]||[=]|
|---||---|

Five rooms:

|---||---|
|[=]||[=]|
|---||---|
|---||---||---|
|[=]||[=]||[=]|
|---||---||---|
  • The rooms have to form a square, or as close as you can get, as shown above.
  • You must use stdout or the equivalent

Smallest number of bytes wins.

Lolums

Posted 2015-09-12T17:11:17.553

Reputation: 159

Question was closed 2015-09-12T19:59:36.773

For the two rooms, could they go on top of each other, since that's just as close to a square as next to each other? (This also applies similarly for larger inputs) – jrich – 2015-09-12T17:17:10.560

2The order the rooms are added are inconsistent. Does it matter how we add the rooms as long as it forms a square (or as close as possible)? – Downgoat – 2015-09-12T17:17:37.513

5Why is there a space between the rows of rooms for 3 rooms, but not for 4 rooms? – Reto Koradi – 2015-09-12T18:02:19.510

7What it does mean to be as close to a square as possible? – xnor – 2015-09-12T18:54:19.673

1Expanding on @xnor's point, which is squarer for 15, 5x3 perfect rectangle, or 4x4 with the corner missing? Are we allowed to move rooms that have already been drawn? If we're not allowed to move rooms, I'd go for the latter, but it's up to you to specify. – Level River St – 2015-09-12T20:20:39.337

No answers