Skip to main content
Tweeted twitter.com/StackCodeGolf/status/982503133480935425
added 28 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43

N blocks stacked on top of each other and the roof. Each block is horizontally moved compared to the previousfirst block (to either -2, 0, or 2 points), as described in the table.

N blocks stacked on top of each other and the roof. Each block is horizontally moved compared to the previous block, as described in the table.

N blocks stacked on top of each other and the roof. Each block is horizontally moved compared to the first block (to either -2, 0, or 2 points), as described in the table.

added 777 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43

The block structure:

  *********
  * ----- *
  * |   | *
  * |   | *
  * ----- *
  *********

Once they are stacked together, the top of the lower block intersects with the bottom of the higher block:

    *********
    * ----- *
    * |   | *
    * |   | *
    * ----- *
  ***********
  * ----- *
  * |   | *
  * |   | *
  * ----- *
  *********

The roof that should be stacked on top of the last, n-th block is:

      *
     ***
    ** **
   **   **

The block with the roof atop looks like this:

      *
     ***
    ** **
   **   **
  *********
  * ----- *
  * |   | *
  * |   | *
  * ----- *
  *********

##Test cases below.

##Test cases below.

The block structure:

  *********
  * ----- *
  * |   | *
  * |   | *
  * ----- *
  *********

Once they are stacked together, the top of the lower block intersects with the bottom of the higher block:

    *********
    * ----- *
    * |   | *
    * |   | *
    * ----- *
  ***********
  * ----- *
  * |   | *
  * |   | *
  * ----- *
  *********

The roof that should be stacked on top of the last, n-th block is:

      *
     ***
    ** **
   **   **

The block with the roof atop looks like this:

      *
     ***
    ** **
   **   **
  *********
  * ----- *
  * |   | *
  * |   | *
  * ----- *
  *********

##Test cases below.

added 168 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43

Positive integer (N).

##Output:

N blocks stacked on top of each other and the roof. Each block is horizontally moved compared to the previous block, as described in the table.

Positive integer.

Positive integer (N).

##Output:

N blocks stacked on top of each other and the roof. Each block is horizontally moved compared to the previous block, as described in the table.

edited title; added 70 characters in body
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading
Source Link
nicael
  • 4.8k
  • 24
  • 43
Loading