ASCII TURNED SHAPEDraw the Heart ShapeAlign a horizontally-aligned, right-angled ASCII shape along a diagonalASCII WaterworksASCII Scores ­­­­­Print out a shape in printable ASCII art based on a specific number of sides provided by the userASCII DandelionsASCII TrianglesReverse columns while preserving shapeShape Identifying ProgramWrite a Shape Simplifier

CircuiTikZ: How to change the node options of labels and annotations?

Drying clothes: windy but cold outside vs warm(ish) inside?

I have just 4 hours a month to security check a cloud based application - How to use my time?

Can abstractions and good code practice in embedded C++ eliminate the need for the debugger?

Listing files that end in ".txt" from directories with the word "SALARIO" in its name without using pipes

Famous statistical wins and horror stories for teaching purposes

Is it acceptable to mark off or comment on someones presentation based on their non-standard English accent?

1 kHz clock over long wire

Why are observers/reference frames able to see themselves moving through time but not through space?

Does 3>&1 imply 4>&3 5>&3 etc.?

Why do we worry about overfitting even if "all models are wrong"?

Is it usual for a US president to make specific comments about a UK Prime Minister's suitability during a general election?

How do I limit the scope of etoolbox environment patching?

Does Amoxicillin (as trihydrate) degrade in stomach acid?

Replacing 2-prong outlets in basement - existing wiring has two hot wires, one neutral?

Interpret numbers very literally

Function to calculate "Nd6 take highest 2, sort descending" probabilities in AnyDice

Why is the Duration of Time spent in the Dayside greater than that of the Night side of the Moon for Chandrayaan-2 Orbiter?

In the top five, I'm odd

Brute-Force algorithm in C++

How to draw a 3D point moving along a helical path?

How should a leader behave when they miss deadlines themselves?

Example satisfying Mangasarian-Fromovitz CQ but not LICQ

What would a life-form be like if it's antimatter-based



ASCII TURNED SHAPE


Draw the Heart ShapeAlign a horizontally-aligned, right-angled ASCII shape along a diagonalASCII WaterworksASCII Scores ­­­­­Print out a shape in printable ASCII art based on a specific number of sides provided by the userASCII DandelionsASCII TrianglesReverse columns while preserving shapeShape Identifying ProgramWrite a Shape Simplifier






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









15














$begingroup$


How can we depict a turned shape simply and nicely using ascii characters in 3D space?



I suggest this method :



Instead of a circle we use a square rotated by 45° for the cutting section so that we only need '/' and '' characters to draw it.




/
/
/
/


And we use '_' character for the profiles: upper, lower and median.




_________
/
/ ________
/ /
/________/


Isn't it Turning complete? Well, if you agree, write a full program or a function taking an unsigned integer value N , representing a number of steps , producing a 3d shape as described below.



The profile of this turned shape has the form of a stair step curve raising from 0 to N steps and lowering back to 0 where each step is 2 char('/') high and 5 char long ('_').



Maybe some examples describes it more clearly.



For N = 0 you may output nothing but it's not mandatory to handle it.




N = 1

_____
/
/ ____
/ /
/____/
.



N = 2

_____
/
___/_ __
/
/ ____ _____
/ / / / /
/____/ / /_/
/ /
/____/
.



N = 3
_____
/
___/_ __
/
___/_ __
/
/ ____ ____ ______
/ / / / / / / /
/____/ / / / / /_/
/ / / / /
/____/ / /_/
/ /
/____/


Rules :

- Margins are not specified.

- Standard loopholes are forbidden.

- Standard input/output methods.

- Shortest answer in bytes wins.










share|improve this question












$endgroup$










  • 3




    $begingroup$
    What if I don't agree ? I may be wrong, but I don't have any task in that case.
    $endgroup$
    – The random guy
    Oct 15 at 7:32










  • $begingroup$
    Sandbox: codegolf.meta.stackexchange.com/a/18149/84844
    $endgroup$
    – AZTECCO
    Oct 15 at 7:37

















15














$begingroup$


How can we depict a turned shape simply and nicely using ascii characters in 3D space?



I suggest this method :



Instead of a circle we use a square rotated by 45° for the cutting section so that we only need '/' and '' characters to draw it.




/
/
/
/


And we use '_' character for the profiles: upper, lower and median.




_________
/
/ ________
/ /
/________/


Isn't it Turning complete? Well, if you agree, write a full program or a function taking an unsigned integer value N , representing a number of steps , producing a 3d shape as described below.



The profile of this turned shape has the form of a stair step curve raising from 0 to N steps and lowering back to 0 where each step is 2 char('/') high and 5 char long ('_').



Maybe some examples describes it more clearly.



For N = 0 you may output nothing but it's not mandatory to handle it.




N = 1

_____
/
/ ____
/ /
/____/
.



N = 2

_____
/
___/_ __
/
/ ____ _____
/ / / / /
/____/ / /_/
/ /
/____/
.



N = 3
_____
/
___/_ __
/
___/_ __
/
/ ____ ____ ______
/ / / / / / / /
/____/ / / / / /_/
/ / / / /
/____/ / /_/
/ /
/____/


Rules :

- Margins are not specified.

- Standard loopholes are forbidden.

- Standard input/output methods.

- Shortest answer in bytes wins.










share|improve this question












$endgroup$










  • 3




    $begingroup$
    What if I don't agree ? I may be wrong, but I don't have any task in that case.
    $endgroup$
    – The random guy
    Oct 15 at 7:32










  • $begingroup$
    Sandbox: codegolf.meta.stackexchange.com/a/18149/84844
    $endgroup$
    – AZTECCO
    Oct 15 at 7:37













15












15








15





$begingroup$


How can we depict a turned shape simply and nicely using ascii characters in 3D space?



I suggest this method :



Instead of a circle we use a square rotated by 45° for the cutting section so that we only need '/' and '' characters to draw it.




/
/
/
/


And we use '_' character for the profiles: upper, lower and median.




_________
/
/ ________
/ /
/________/


Isn't it Turning complete? Well, if you agree, write a full program or a function taking an unsigned integer value N , representing a number of steps , producing a 3d shape as described below.



The profile of this turned shape has the form of a stair step curve raising from 0 to N steps and lowering back to 0 where each step is 2 char('/') high and 5 char long ('_').



Maybe some examples describes it more clearly.



For N = 0 you may output nothing but it's not mandatory to handle it.




N = 1

_____
/
/ ____
/ /
/____/
.



N = 2

_____
/
___/_ __
/
/ ____ _____
/ / / / /
/____/ / /_/
/ /
/____/
.



N = 3
_____
/
___/_ __
/
___/_ __
/
/ ____ ____ ______
/ / / / / / / /
/____/ / / / / /_/
/ / / / /
/____/ / /_/
/ /
/____/


Rules :

- Margins are not specified.

- Standard loopholes are forbidden.

- Standard input/output methods.

- Shortest answer in bytes wins.










share|improve this question












$endgroup$




How can we depict a turned shape simply and nicely using ascii characters in 3D space?



I suggest this method :



Instead of a circle we use a square rotated by 45° for the cutting section so that we only need '/' and '' characters to draw it.




/
/
/
/


And we use '_' character for the profiles: upper, lower and median.




_________
/
/ ________
/ /
/________/


Isn't it Turning complete? Well, if you agree, write a full program or a function taking an unsigned integer value N , representing a number of steps , producing a 3d shape as described below.



The profile of this turned shape has the form of a stair step curve raising from 0 to N steps and lowering back to 0 where each step is 2 char('/') high and 5 char long ('_').



Maybe some examples describes it more clearly.



For N = 0 you may output nothing but it's not mandatory to handle it.




N = 1

_____
/
/ ____
/ /
/____/
.



N = 2

_____
/
___/_ __
/
/ ____ _____
/ / / / /
/____/ / /_/
/ /
/____/
.



N = 3
_____
/
___/_ __
/
___/_ __
/
/ ____ ____ ______
/ / / / / / / /
/____/ / / / / /_/
/ / / / /
/____/ / /_/
/ /
/____/


Rules :

- Margins are not specified.

- Standard loopholes are forbidden.

- Standard input/output methods.

- Shortest answer in bytes wins.







code-golf ascii-art 3d






share|improve this question
















share|improve this question













share|improve this question




share|improve this question








edited Oct 15 at 7:05







AZTECCO

















asked Oct 15 at 7:00









AZTECCOAZTECCO

8251 silver badge14 bronze badges




8251 silver badge14 bronze badges










  • 3




    $begingroup$
    What if I don't agree ? I may be wrong, but I don't have any task in that case.
    $endgroup$
    – The random guy
    Oct 15 at 7:32










  • $begingroup$
    Sandbox: codegolf.meta.stackexchange.com/a/18149/84844
    $endgroup$
    – AZTECCO
    Oct 15 at 7:37












  • 3




    $begingroup$
    What if I don't agree ? I may be wrong, but I don't have any task in that case.
    $endgroup$
    – The random guy
    Oct 15 at 7:32










  • $begingroup$
    Sandbox: codegolf.meta.stackexchange.com/a/18149/84844
    $endgroup$
    – AZTECCO
    Oct 15 at 7:37







3




3




$begingroup$
What if I don't agree ? I may be wrong, but I don't have any task in that case.
$endgroup$
– The random guy
Oct 15 at 7:32




$begingroup$
What if I don't agree ? I may be wrong, but I don't have any task in that case.
$endgroup$
– The random guy
Oct 15 at 7:32












$begingroup$
Sandbox: codegolf.meta.stackexchange.com/a/18149/84844
$endgroup$
– AZTECCO
Oct 15 at 7:37




$begingroup$
Sandbox: codegolf.meta.stackexchange.com/a/18149/84844
$endgroup$
– AZTECCO
Oct 15 at 7:37










2 Answers
2






active

oldest

votes


















7
















$begingroup$


Charcoal, 70 69 bytes



NθFθ«J⊕×⁷⊕ι⁰≔⊗⊕ιι↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ιJ⁻×⁹θ⊗ι⊖ι__↗ι←P←__↖ι←__


Try it online! Link is to verbose version of code. Explanation:



NθFθ«


Input N and loop that many times.



J⊕×⁷⊕ι⁰


Jump to the (middle) right corner of the front slice.



≔⊗⊕ιι


Get the size of the slice.



↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ι


Draw the front slice.



J⁻×⁹θ⊗ι⊖ι


Jump to the bottom (that we can see) of the back slice.



__↗ι←P←__↖ι←__


Draw the back slice.






share|improve this answer












$endgroup$






















    7
















    $begingroup$

    JavaScript (ES8),  322 282 278  272 bytes



    Builds the output line by line.



    f=(n,y=0,Y=(k=y>2*n)?4*n-y:y,S='___/_25__,/\ \25,\/____/14_/,\ 14,\/____/,_____, \____\, / /, \ \,_\, /, \'.split`,`)=>~Y?(y-2*n?''.padEnd(n*5-(Y>>1)*5-3-y%2-k)+S[y?Y?k*2+y%2:4:5]:'/ 03').replace(/d/g,n=>S[+n+6].repeat(Y-(n>2||-k)>>1))+`
    `+f(n,y+1):''


    Try it online!



    How?



    For each row $0 le y le 4n$, we define:



    $$k=cases
    0,&textif $y le 2n$\
    1,&textif $y > 2n$
    $$

    $$Y=cases
    y,&textif $k=0$\
    4n-y,&textif $k=1$
    $$



    Each row is first converted into a main pattern. A main pattern may contain digits: they are placeholders for repeated sub-patterns that are expended afterwards.



    The middle row (when $y=2n$) is a special case which is processed separately. For all other rows, we compute the main pattern ID $p$ with:



    $$p=cases
    5,&textif $y=0$\
    4,&textif $y neq 0, Y=0$\
    2k+(y bmod 2),&textotherwise\
    $$



    There are no leading spaces for the middle row. For all other rows, the number $s$ of leading spaces is given by:



    $$s=5n-5leftlfloorfracY2rightrfloor-3-(ybmod 2)-k$$



    There are inner sub-patterns (marked with a digit $le2$) and outer sub-patterns (marked with a digit $>2$), which are repeated $n_1$ and $n_2$ times respectively:



    $$n_1=leftlfloorfracY+k2rightrfloor\
    n_2=leftlfloorfracY-12rightrfloor$$



    The above formulae apply to the middle row as well, but are irrelevant for the first and last rows, which do not have sub-patterns.



    Below is what we get for $n=3$:



     y Y k | p | s | before .replace() | n1 | n2 | after .replace()
    --------+-----+-----+----------------------+----+----+-----------------------------
    0 0 0 | 5 | 12 | ............_____ | 0 | -1 | ............_____
    1 1 0 | 1 | 11 | .........../ 25 | 0 | 0 | .........../
    2 2 0 | 0 | 7 | .......___/_25__ | 1 | 0 | .......___/_ __
    3 3 0 | 1 | 6 | ....../ 25 | 1 | 1 | ....../
    4 4 0 | 0 | 2 | ..___/_25__ | 2 | 1 | ..___/_ __
    5 5 0 | 1 | 1 | ./ 25 | 2 | 2 | ./
    6 6 0 | n/a | n/a | / 03 | 3 | 2 | / ____ ____ ______
    7 5 1 | 3 | 0 | 14 | 3 | 2 | / / / / / / / /
    8 4 1 | 2 | 1 | ./____/14_/ | 2 | 1 | ./____/ / / / / /_/
    9 3 1 | 3 | 5 | ..... 14 | 2 | 1 | ..... / / / / /
    10 2 1 | 2 | 6 | ....../____/14_/ | 1 | 0 | ....../____/ / /_/
    11 1 1 | 3 | 10 | .......... 14 | 1 | 0 | .......... / /
    12 0 1 | 4 | 11 | .........../____/ | 0 | -1 | .........../____/





    share|improve this answer












    $endgroup$
















      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "200"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );














      draft saved

      draft discarded
















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f194279%2fascii-turned-shape%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown


























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      7
















      $begingroup$


      Charcoal, 70 69 bytes



      NθFθ«J⊕×⁷⊕ι⁰≔⊗⊕ιι↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ιJ⁻×⁹θ⊗ι⊖ι__↗ι←P←__↖ι←__


      Try it online! Link is to verbose version of code. Explanation:



      NθFθ«


      Input N and loop that many times.



      J⊕×⁷⊕ι⁰


      Jump to the (middle) right corner of the front slice.



      ≔⊗⊕ιι


      Get the size of the slice.



      ↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ι


      Draw the front slice.



      J⁻×⁹θ⊗ι⊖ι


      Jump to the bottom (that we can see) of the back slice.



      __↗ι←P←__↖ι←__


      Draw the back slice.






      share|improve this answer












      $endgroup$



















        7
















        $begingroup$


        Charcoal, 70 69 bytes



        NθFθ«J⊕×⁷⊕ι⁰≔⊗⊕ιι↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ιJ⁻×⁹θ⊗ι⊖ι__↗ι←P←__↖ι←__


        Try it online! Link is to verbose version of code. Explanation:



        NθFθ«


        Input N and loop that many times.



        J⊕×⁷⊕ι⁰


        Jump to the (middle) right corner of the front slice.



        ≔⊗⊕ιι


        Get the size of the slice.



        ↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ι


        Draw the front slice.



        J⁻×⁹θ⊗ι⊖ι


        Jump to the bottom (that we can see) of the back slice.



        __↗ι←P←__↖ι←__


        Draw the back slice.






        share|improve this answer












        $endgroup$

















          7














          7










          7







          $begingroup$


          Charcoal, 70 69 bytes



          NθFθ«J⊕×⁷⊕ι⁰≔⊗⊕ιι↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ιJ⁻×⁹θ⊗ι⊖ι__↗ι←P←__↖ι←__


          Try it online! Link is to verbose version of code. Explanation:



          NθFθ«


          Input N and loop that many times.



          J⊕×⁷⊕ι⁰


          Jump to the (middle) right corner of the front slice.



          ≔⊗⊕ιι


          Get the size of the slice.



          ↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ι


          Draw the front slice.



          J⁻×⁹θ⊗ι⊖ι


          Jump to the bottom (that we can see) of the back slice.



          __↗ι←P←__↖ι←__


          Draw the back slice.






          share|improve this answer












          $endgroup$




          Charcoal, 70 69 bytes



          NθFθ«J⊕×⁷⊕ι⁰≔⊗⊕ιι↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ιJ⁻×⁹θ⊗ι⊖ι__↗ι←P←__↖ι←__


          Try it online! Link is to verbose version of code. Explanation:



          NθFθ«


          Input N and loop that many times.



          J⊕×⁷⊕ι⁰


          Jump to the (middle) right corner of the front slice.



          ≔⊗⊕ιι


          Get the size of the slice.



          ↙ι↑←×⁵_P↖²→↗ι×⁴_↖ι←×⁵_↓P↙²→↘ι


          Draw the front slice.



          J⁻×⁹θ⊗ι⊖ι


          Jump to the bottom (that we can see) of the back slice.



          __↗ι←P←__↖ι←__


          Draw the back slice.







          share|improve this answer















          share|improve this answer




          share|improve this answer








          edited Oct 15 at 12:34

























          answered Oct 15 at 11:12









          NeilNeil

          90.7k8 gold badges46 silver badges190 bronze badges




          90.7k8 gold badges46 silver badges190 bronze badges


























              7
















              $begingroup$

              JavaScript (ES8),  322 282 278  272 bytes



              Builds the output line by line.



              f=(n,y=0,Y=(k=y>2*n)?4*n-y:y,S='___/_25__,/\ \25,\/____/14_/,\ 14,\/____/,_____, \____\, / /, \ \,_\, /, \'.split`,`)=>~Y?(y-2*n?''.padEnd(n*5-(Y>>1)*5-3-y%2-k)+S[y?Y?k*2+y%2:4:5]:'/ 03').replace(/d/g,n=>S[+n+6].repeat(Y-(n>2||-k)>>1))+`
              `+f(n,y+1):''


              Try it online!



              How?



              For each row $0 le y le 4n$, we define:



              $$k=cases
              0,&textif $y le 2n$\
              1,&textif $y > 2n$
              $$

              $$Y=cases
              y,&textif $k=0$\
              4n-y,&textif $k=1$
              $$



              Each row is first converted into a main pattern. A main pattern may contain digits: they are placeholders for repeated sub-patterns that are expended afterwards.



              The middle row (when $y=2n$) is a special case which is processed separately. For all other rows, we compute the main pattern ID $p$ with:



              $$p=cases
              5,&textif $y=0$\
              4,&textif $y neq 0, Y=0$\
              2k+(y bmod 2),&textotherwise\
              $$



              There are no leading spaces for the middle row. For all other rows, the number $s$ of leading spaces is given by:



              $$s=5n-5leftlfloorfracY2rightrfloor-3-(ybmod 2)-k$$



              There are inner sub-patterns (marked with a digit $le2$) and outer sub-patterns (marked with a digit $>2$), which are repeated $n_1$ and $n_2$ times respectively:



              $$n_1=leftlfloorfracY+k2rightrfloor\
              n_2=leftlfloorfracY-12rightrfloor$$



              The above formulae apply to the middle row as well, but are irrelevant for the first and last rows, which do not have sub-patterns.



              Below is what we get for $n=3$:



               y Y k | p | s | before .replace() | n1 | n2 | after .replace()
              --------+-----+-----+----------------------+----+----+-----------------------------
              0 0 0 | 5 | 12 | ............_____ | 0 | -1 | ............_____
              1 1 0 | 1 | 11 | .........../ 25 | 0 | 0 | .........../
              2 2 0 | 0 | 7 | .......___/_25__ | 1 | 0 | .......___/_ __
              3 3 0 | 1 | 6 | ....../ 25 | 1 | 1 | ....../
              4 4 0 | 0 | 2 | ..___/_25__ | 2 | 1 | ..___/_ __
              5 5 0 | 1 | 1 | ./ 25 | 2 | 2 | ./
              6 6 0 | n/a | n/a | / 03 | 3 | 2 | / ____ ____ ______
              7 5 1 | 3 | 0 | 14 | 3 | 2 | / / / / / / / /
              8 4 1 | 2 | 1 | ./____/14_/ | 2 | 1 | ./____/ / / / / /_/
              9 3 1 | 3 | 5 | ..... 14 | 2 | 1 | ..... / / / / /
              10 2 1 | 2 | 6 | ....../____/14_/ | 1 | 0 | ....../____/ / /_/
              11 1 1 | 3 | 10 | .......... 14 | 1 | 0 | .......... / /
              12 0 1 | 4 | 11 | .........../____/ | 0 | -1 | .........../____/





              share|improve this answer












              $endgroup$



















                7
















                $begingroup$

                JavaScript (ES8),  322 282 278  272 bytes



                Builds the output line by line.



                f=(n,y=0,Y=(k=y>2*n)?4*n-y:y,S='___/_25__,/\ \25,\/____/14_/,\ 14,\/____/,_____, \____\, / /, \ \,_\, /, \'.split`,`)=>~Y?(y-2*n?''.padEnd(n*5-(Y>>1)*5-3-y%2-k)+S[y?Y?k*2+y%2:4:5]:'/ 03').replace(/d/g,n=>S[+n+6].repeat(Y-(n>2||-k)>>1))+`
                `+f(n,y+1):''


                Try it online!



                How?



                For each row $0 le y le 4n$, we define:



                $$k=cases
                0,&textif $y le 2n$\
                1,&textif $y > 2n$
                $$

                $$Y=cases
                y,&textif $k=0$\
                4n-y,&textif $k=1$
                $$



                Each row is first converted into a main pattern. A main pattern may contain digits: they are placeholders for repeated sub-patterns that are expended afterwards.



                The middle row (when $y=2n$) is a special case which is processed separately. For all other rows, we compute the main pattern ID $p$ with:



                $$p=cases
                5,&textif $y=0$\
                4,&textif $y neq 0, Y=0$\
                2k+(y bmod 2),&textotherwise\
                $$



                There are no leading spaces for the middle row. For all other rows, the number $s$ of leading spaces is given by:



                $$s=5n-5leftlfloorfracY2rightrfloor-3-(ybmod 2)-k$$



                There are inner sub-patterns (marked with a digit $le2$) and outer sub-patterns (marked with a digit $>2$), which are repeated $n_1$ and $n_2$ times respectively:



                $$n_1=leftlfloorfracY+k2rightrfloor\
                n_2=leftlfloorfracY-12rightrfloor$$



                The above formulae apply to the middle row as well, but are irrelevant for the first and last rows, which do not have sub-patterns.



                Below is what we get for $n=3$:



                 y Y k | p | s | before .replace() | n1 | n2 | after .replace()
                --------+-----+-----+----------------------+----+----+-----------------------------
                0 0 0 | 5 | 12 | ............_____ | 0 | -1 | ............_____
                1 1 0 | 1 | 11 | .........../ 25 | 0 | 0 | .........../
                2 2 0 | 0 | 7 | .......___/_25__ | 1 | 0 | .......___/_ __
                3 3 0 | 1 | 6 | ....../ 25 | 1 | 1 | ....../
                4 4 0 | 0 | 2 | ..___/_25__ | 2 | 1 | ..___/_ __
                5 5 0 | 1 | 1 | ./ 25 | 2 | 2 | ./
                6 6 0 | n/a | n/a | / 03 | 3 | 2 | / ____ ____ ______
                7 5 1 | 3 | 0 | 14 | 3 | 2 | / / / / / / / /
                8 4 1 | 2 | 1 | ./____/14_/ | 2 | 1 | ./____/ / / / / /_/
                9 3 1 | 3 | 5 | ..... 14 | 2 | 1 | ..... / / / / /
                10 2 1 | 2 | 6 | ....../____/14_/ | 1 | 0 | ....../____/ / /_/
                11 1 1 | 3 | 10 | .......... 14 | 1 | 0 | .......... / /
                12 0 1 | 4 | 11 | .........../____/ | 0 | -1 | .........../____/





                share|improve this answer












                $endgroup$

















                  7














                  7










                  7







                  $begingroup$

                  JavaScript (ES8),  322 282 278  272 bytes



                  Builds the output line by line.



                  f=(n,y=0,Y=(k=y>2*n)?4*n-y:y,S='___/_25__,/\ \25,\/____/14_/,\ 14,\/____/,_____, \____\, / /, \ \,_\, /, \'.split`,`)=>~Y?(y-2*n?''.padEnd(n*5-(Y>>1)*5-3-y%2-k)+S[y?Y?k*2+y%2:4:5]:'/ 03').replace(/d/g,n=>S[+n+6].repeat(Y-(n>2||-k)>>1))+`
                  `+f(n,y+1):''


                  Try it online!



                  How?



                  For each row $0 le y le 4n$, we define:



                  $$k=cases
                  0,&textif $y le 2n$\
                  1,&textif $y > 2n$
                  $$

                  $$Y=cases
                  y,&textif $k=0$\
                  4n-y,&textif $k=1$
                  $$



                  Each row is first converted into a main pattern. A main pattern may contain digits: they are placeholders for repeated sub-patterns that are expended afterwards.



                  The middle row (when $y=2n$) is a special case which is processed separately. For all other rows, we compute the main pattern ID $p$ with:



                  $$p=cases
                  5,&textif $y=0$\
                  4,&textif $y neq 0, Y=0$\
                  2k+(y bmod 2),&textotherwise\
                  $$



                  There are no leading spaces for the middle row. For all other rows, the number $s$ of leading spaces is given by:



                  $$s=5n-5leftlfloorfracY2rightrfloor-3-(ybmod 2)-k$$



                  There are inner sub-patterns (marked with a digit $le2$) and outer sub-patterns (marked with a digit $>2$), which are repeated $n_1$ and $n_2$ times respectively:



                  $$n_1=leftlfloorfracY+k2rightrfloor\
                  n_2=leftlfloorfracY-12rightrfloor$$



                  The above formulae apply to the middle row as well, but are irrelevant for the first and last rows, which do not have sub-patterns.



                  Below is what we get for $n=3$:



                   y Y k | p | s | before .replace() | n1 | n2 | after .replace()
                  --------+-----+-----+----------------------+----+----+-----------------------------
                  0 0 0 | 5 | 12 | ............_____ | 0 | -1 | ............_____
                  1 1 0 | 1 | 11 | .........../ 25 | 0 | 0 | .........../
                  2 2 0 | 0 | 7 | .......___/_25__ | 1 | 0 | .......___/_ __
                  3 3 0 | 1 | 6 | ....../ 25 | 1 | 1 | ....../
                  4 4 0 | 0 | 2 | ..___/_25__ | 2 | 1 | ..___/_ __
                  5 5 0 | 1 | 1 | ./ 25 | 2 | 2 | ./
                  6 6 0 | n/a | n/a | / 03 | 3 | 2 | / ____ ____ ______
                  7 5 1 | 3 | 0 | 14 | 3 | 2 | / / / / / / / /
                  8 4 1 | 2 | 1 | ./____/14_/ | 2 | 1 | ./____/ / / / / /_/
                  9 3 1 | 3 | 5 | ..... 14 | 2 | 1 | ..... / / / / /
                  10 2 1 | 2 | 6 | ....../____/14_/ | 1 | 0 | ....../____/ / /_/
                  11 1 1 | 3 | 10 | .......... 14 | 1 | 0 | .......... / /
                  12 0 1 | 4 | 11 | .........../____/ | 0 | -1 | .........../____/





                  share|improve this answer












                  $endgroup$



                  JavaScript (ES8),  322 282 278  272 bytes



                  Builds the output line by line.



                  f=(n,y=0,Y=(k=y>2*n)?4*n-y:y,S='___/_25__,/\ \25,\/____/14_/,\ 14,\/____/,_____, \____\, / /, \ \,_\, /, \'.split`,`)=>~Y?(y-2*n?''.padEnd(n*5-(Y>>1)*5-3-y%2-k)+S[y?Y?k*2+y%2:4:5]:'/ 03').replace(/d/g,n=>S[+n+6].repeat(Y-(n>2||-k)>>1))+`
                  `+f(n,y+1):''


                  Try it online!



                  How?



                  For each row $0 le y le 4n$, we define:



                  $$k=cases
                  0,&textif $y le 2n$\
                  1,&textif $y > 2n$
                  $$

                  $$Y=cases
                  y,&textif $k=0$\
                  4n-y,&textif $k=1$
                  $$



                  Each row is first converted into a main pattern. A main pattern may contain digits: they are placeholders for repeated sub-patterns that are expended afterwards.



                  The middle row (when $y=2n$) is a special case which is processed separately. For all other rows, we compute the main pattern ID $p$ with:



                  $$p=cases
                  5,&textif $y=0$\
                  4,&textif $y neq 0, Y=0$\
                  2k+(y bmod 2),&textotherwise\
                  $$



                  There are no leading spaces for the middle row. For all other rows, the number $s$ of leading spaces is given by:



                  $$s=5n-5leftlfloorfracY2rightrfloor-3-(ybmod 2)-k$$



                  There are inner sub-patterns (marked with a digit $le2$) and outer sub-patterns (marked with a digit $>2$), which are repeated $n_1$ and $n_2$ times respectively:



                  $$n_1=leftlfloorfracY+k2rightrfloor\
                  n_2=leftlfloorfracY-12rightrfloor$$



                  The above formulae apply to the middle row as well, but are irrelevant for the first and last rows, which do not have sub-patterns.



                  Below is what we get for $n=3$:



                   y Y k | p | s | before .replace() | n1 | n2 | after .replace()
                  --------+-----+-----+----------------------+----+----+-----------------------------
                  0 0 0 | 5 | 12 | ............_____ | 0 | -1 | ............_____
                  1 1 0 | 1 | 11 | .........../ 25 | 0 | 0 | .........../
                  2 2 0 | 0 | 7 | .......___/_25__ | 1 | 0 | .......___/_ __
                  3 3 0 | 1 | 6 | ....../ 25 | 1 | 1 | ....../
                  4 4 0 | 0 | 2 | ..___/_25__ | 2 | 1 | ..___/_ __
                  5 5 0 | 1 | 1 | ./ 25 | 2 | 2 | ./
                  6 6 0 | n/a | n/a | / 03 | 3 | 2 | / ____ ____ ______
                  7 5 1 | 3 | 0 | 14 | 3 | 2 | / / / / / / / /
                  8 4 1 | 2 | 1 | ./____/14_/ | 2 | 1 | ./____/ / / / / /_/
                  9 3 1 | 3 | 5 | ..... 14 | 2 | 1 | ..... / / / / /
                  10 2 1 | 2 | 6 | ....../____/14_/ | 1 | 0 | ....../____/ / /_/
                  11 1 1 | 3 | 10 | .......... 14 | 1 | 0 | .......... / /
                  12 0 1 | 4 | 11 | .........../____/ | 0 | -1 | .........../____/






                  share|improve this answer















                  share|improve this answer




                  share|improve this answer








                  edited Oct 16 at 14:32

























                  answered Oct 15 at 13:09









                  ArnauldArnauld

                  96.7k7 gold badges114 silver badges392 bronze badges




                  96.7k7 gold badges114 silver badges392 bronze badges































                      draft saved

                      draft discarded















































                      If this is an answer to a challenge…



                      • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


                      • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
                        Explanations of your answer make it more interesting to read and are very much encouraged.


                      • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.


                      More generally…



                      • …Please make sure to answer the question and provide sufficient detail.


                      • …Avoid asking for help, clarification or responding to other answers (use comments instead).




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f194279%2fascii-turned-shape%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown









                      Popular posts from this blog

                      Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                      Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                      Tom Holland Mục lục Đầu đời và giáo dục | Sự nghiệp | Cuộc sống cá nhân | Phim tham gia | Giải thưởng và đề cử | Chú thích | Liên kết ngoài | Trình đơn chuyển hướngProfile“Person Details for Thomas Stanley Holland, "England and Wales Birth Registration Index, 1837-2008" — FamilySearch.org”"Meet Tom Holland... the 16-year-old star of The Impossible""Schoolboy actor Tom Holland finds himself in Oscar contention for role in tsunami drama"“Naomi Watts on the Prince William and Harry's reaction to her film about the late Princess Diana”lưu trữ"Holland and Pflueger Are West End's Two New 'Billy Elliots'""I'm so envious of my son, the movie star! British writer Dominic Holland's spent 20 years trying to crack Hollywood - but he's been beaten to it by a very unlikely rival"“Richard and Margaret Povey of Jersey, Channel Islands, UK: Information about Thomas Stanley Holland”"Tom Holland to play Billy Elliot""New Billy Elliot leaving the garage"Billy Elliot the Musical - Tom Holland - Billy"A Tale of four Billys: Tom Holland""The Feel Good Factor""Thames Christian College schoolboys join Myleene Klass for The Feelgood Factor""Government launches £600,000 arts bursaries pilot""BILLY's Chapman, Holland, Gardner & Jackson-Keen Visit Prime Minister""Elton John 'blown away' by Billy Elliot fifth birthday" (video with John's interview and fragments of Holland's performance)"First News interviews Arrietty's Tom Holland"“33rd Critics' Circle Film Awards winners”“National Board of Review Current Awards”Bản gốc"Ron Howard Whaling Tale 'In The Heart Of The Sea' Casts Tom Holland"“'Spider-Man' Finds Tom Holland to Star as New Web-Slinger”lưu trữ“Captain America: Civil War (2016)”“Film Review: ‘Captain America: Civil War’”lưu trữ“‘Captain America: Civil War’ review: Choose your own avenger”lưu trữ“The Lost City of Z reviews”“Sony Pictures and Marvel Studios Find Their 'Spider-Man' Star and Director”“‘Mary Magdalene’, ‘Current War’ & ‘Wind River’ Get 2017 Release Dates From Weinstein”“Lionsgate Unleashing Daisy Ridley & Tom Holland Starrer ‘Chaos Walking’ In Cannes”“PTA's 'Master' Leads Chicago Film Critics Nominations, UPDATED: Houston and Indiana Critics Nominations”“Nominaciones Goya 2013 Telecinco Cinema – ENG”“Jameson Empire Film Awards: Martin Freeman wins best actor for performance in The Hobbit”“34th Annual Young Artist Awards”Bản gốc“Teen Choice Awards 2016—Captain America: Civil War Leads Second Wave of Nominations”“BAFTA Film Award Nominations: ‘La La Land’ Leads Race”“Saturn Awards Nominations 2017: 'Rogue One,' 'Walking Dead' Lead”Tom HollandTom HollandTom HollandTom Hollandmedia.gettyimages.comWorldCat Identities300279794no20130442900000 0004 0355 42791085670554170004732cb16706349t(data)XX5557367