Draw this diamond pattern

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
12
down vote

favorite












The below pattern will form the basis of this challenge.



 /
/
/
/
/
// /
/ //
/
/
/
/
/


Given an input width and height, each >=1, output the above ASCII art pattern repeated that many times, joining (and overlapping) at the small diamonds.



For example, here is an input with width = 2 and height = 1:



 / /
/ /
/ /
/ /
/ /
// // /
/ // //
/ /
/ /
/ /
/ /
/ /


Here is an input width = 3 and height = 2:



 / / /
/ / /
/ / /
/ / /
/ / /
// // // /
/ // // //
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
// // // /
/ // // //
/ / /
/ / /
/ / /
/ / /
/ / /


Rules and I/O



  • Input and output can be given by any convenient method.

  • You can print it to STDOUT or return it as a function result.

  • Either a full program or a function are acceptable.

  • Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately.


  • Standard loopholes are forbidden.

  • This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.









share|improve this question





















  • Loosely related
    – Luis Mendo
    2 hours ago














up vote
12
down vote

favorite












The below pattern will form the basis of this challenge.



 /
/
/
/
/
// /
/ //
/
/
/
/
/


Given an input width and height, each >=1, output the above ASCII art pattern repeated that many times, joining (and overlapping) at the small diamonds.



For example, here is an input with width = 2 and height = 1:



 / /
/ /
/ /
/ /
/ /
// // /
/ // //
/ /
/ /
/ /
/ /
/ /


Here is an input width = 3 and height = 2:



 / / /
/ / /
/ / /
/ / /
/ / /
// // // /
/ // // //
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
// // // /
/ // // //
/ / /
/ / /
/ / /
/ / /
/ / /


Rules and I/O



  • Input and output can be given by any convenient method.

  • You can print it to STDOUT or return it as a function result.

  • Either a full program or a function are acceptable.

  • Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately.


  • Standard loopholes are forbidden.

  • This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.









share|improve this question





















  • Loosely related
    – Luis Mendo
    2 hours ago












up vote
12
down vote

favorite









up vote
12
down vote

favorite











The below pattern will form the basis of this challenge.



 /
/
/
/
/
// /
/ //
/
/
/
/
/


Given an input width and height, each >=1, output the above ASCII art pattern repeated that many times, joining (and overlapping) at the small diamonds.



For example, here is an input with width = 2 and height = 1:



 / /
/ /
/ /
/ /
/ /
// // /
/ // //
/ /
/ /
/ /
/ /
/ /


Here is an input width = 3 and height = 2:



 / / /
/ / /
/ / /
/ / /
/ / /
// // // /
/ // // //
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
// // // /
/ // // //
/ / /
/ / /
/ / /
/ / /
/ / /


Rules and I/O



  • Input and output can be given by any convenient method.

  • You can print it to STDOUT or return it as a function result.

  • Either a full program or a function are acceptable.

  • Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately.


  • Standard loopholes are forbidden.

  • This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.









share|improve this question













The below pattern will form the basis of this challenge.



 /
/
/
/
/
// /
/ //
/
/
/
/
/


Given an input width and height, each >=1, output the above ASCII art pattern repeated that many times, joining (and overlapping) at the small diamonds.



For example, here is an input with width = 2 and height = 1:



 / /
/ /
/ /
/ /
/ /
// // /
/ // //
/ /
/ /
/ /
/ /
/ /


Here is an input width = 3 and height = 2:



 / / /
/ / /
/ / /
/ / /
/ / /
// // // /
/ // // //
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
/ / /
// // // /
/ // // //
/ / /
/ / /
/ / /
/ / /
/ / /


Rules and I/O



  • Input and output can be given by any convenient method.

  • You can print it to STDOUT or return it as a function result.

  • Either a full program or a function are acceptable.

  • Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately.


  • Standard loopholes are forbidden.

  • This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.






code-golf ascii-art






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 5 hours ago









AdmBorkBork

25.4k362223




25.4k362223











  • Loosely related
    – Luis Mendo
    2 hours ago
















  • Loosely related
    – Luis Mendo
    2 hours ago















Loosely related
– Luis Mendo
2 hours ago




Loosely related
– Luis Mendo
2 hours ago










5 Answers
5






active

oldest

votes

















up vote
4
down vote














Canvas, 26 25 24 21 bytes



4/╬/╬⁰r:⤢n⁸{╵×↔¹A×├m↶


Try it here!



Explanation:



4/ create a 4-long diagonal
╬ quad-palindromize it - big inner diamond
/╬ quad-palindromize "/" - small diamond
⁰r center the two added vertically
:⤢n overlap with its transpose
⁷{ for each input:

╵× repeat the canvas input+1 times horizontally
↔ reverse horizontally
¹ the input,
A× times 10,
├ plus 2
m mold the canvas to that width
↶ rotate the canvas anti-clockwise, setting up for the other input





share|improve this answer





























    up vote
    4
    down vote













    JavaScript (ES8), 167 161 bytes



    Takes input as (width)(height).



    w=>h=>(g=h=>h?([x=4106,4016,x,31305,21504,17010][(x=--h%10)>5?11-x:x]+'').replace(/./g,c=>'/\'[c^x>5]||''.padEnd(c-1)).repeat(w+1).slice(8)+`
    `+g(h):'')(h*10+2)


    Try it online!



    How?



    We encode the upper half of the pattern with digits:




    • $0$ means


    • $1$ means /


    • $n=2$ to $7$ means $n-1$ spaces

    This gives:



    0 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
    1 ···/····· --> [3 spaces] [] [/] [5 spaces] --> 4016
    2 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
    3 ··/······ --> [2 spaces] [/] [2 spaces] [] [4 spaces] --> 31305
    4 ·/······· --> [1 space] [/] [4 spaces] [] [3 spaces] --> 21504
    5 /······/ --> [/] [6 spaces] [] [/] [] --> 17010


    For the lower half, we use the rows $5$ to $2$ (i.e. in reverse order) with / and inverted.






    share|improve this answer





























      up vote
      1
      down vote














      Charcoal, 24 bytes



      F⁴«↖⁶¶/¶⟲T»F⊖NCχ⁰F⊖NC⁰χ


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



      F⁴«


      Repeat for each side of the original pattern.



      ↖⁶¶/¶


      Draw the long diagonal and two short lines of the small diamond.



      ⟲T»


      Rotate the entire canvas and repeat.



      F⊖NCχ⁰


      Copy the required number of times horizontally.



      F⊖NC⁰χ


      Copy the required number of times vertically.






      share|improve this answer



























        up vote
        1
        down vote














        Haskell, 179 bytes





        k '\'='/'
        k '/'='\'
        k x=x
        f x=take(10*x+2)
        w#h=map(f w.cycle).f h.drop 9.cycle$(++).reverse=<<map(map k)$["\/\ /"," \ / "," \ / "," \/ "," /\ "]


        Try it online!






        share|improve this answer





























          up vote
          0
          down vote














          Perl 5 -p, 148 bytes





          $_='3A3'x$_.$/.'3B3
          3A3
          2/2\2
          1/4\1
          A6A
          B6B
          1\4/1
          2\2/2
          3B3
          3A3
          '=~s/^.*$/$&x$_/mger x<>.'3B3'x$_;s|A+|/\|g;s|B+|\/|g;s/d/$"x$&/ge;s|^ | |gm


          Try it online!






          share|improve this answer




















            Your Answer





            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
            );
            );
            , "mathjax-editing");

            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',
            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/3.0/"u003ecc by-sa 3.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%2f175619%2fdraw-this-diamond-pattern%23new-answer', 'question_page');

            );

            Post as a guest






























            5 Answers
            5






            active

            oldest

            votes








            5 Answers
            5






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            4
            down vote














            Canvas, 26 25 24 21 bytes



            4/╬/╬⁰r:⤢n⁸{╵×↔¹A×├m↶


            Try it here!



            Explanation:



            4/ create a 4-long diagonal
            ╬ quad-palindromize it - big inner diamond
            /╬ quad-palindromize "/" - small diamond
            ⁰r center the two added vertically
            :⤢n overlap with its transpose
            ⁷{ for each input:

            ╵× repeat the canvas input+1 times horizontally
            ↔ reverse horizontally
            ¹ the input,
            A× times 10,
            ├ plus 2
            m mold the canvas to that width
            ↶ rotate the canvas anti-clockwise, setting up for the other input





            share|improve this answer


























              up vote
              4
              down vote














              Canvas, 26 25 24 21 bytes



              4/╬/╬⁰r:⤢n⁸{╵×↔¹A×├m↶


              Try it here!



              Explanation:



              4/ create a 4-long diagonal
              ╬ quad-palindromize it - big inner diamond
              /╬ quad-palindromize "/" - small diamond
              ⁰r center the two added vertically
              :⤢n overlap with its transpose
              ⁷{ for each input:

              ╵× repeat the canvas input+1 times horizontally
              ↔ reverse horizontally
              ¹ the input,
              A× times 10,
              ├ plus 2
              m mold the canvas to that width
              ↶ rotate the canvas anti-clockwise, setting up for the other input





              share|improve this answer
























                up vote
                4
                down vote










                up vote
                4
                down vote










                Canvas, 26 25 24 21 bytes



                4/╬/╬⁰r:⤢n⁸{╵×↔¹A×├m↶


                Try it here!



                Explanation:



                4/ create a 4-long diagonal
                ╬ quad-palindromize it - big inner diamond
                /╬ quad-palindromize "/" - small diamond
                ⁰r center the two added vertically
                :⤢n overlap with its transpose
                ⁷{ for each input:

                ╵× repeat the canvas input+1 times horizontally
                ↔ reverse horizontally
                ¹ the input,
                A× times 10,
                ├ plus 2
                m mold the canvas to that width
                ↶ rotate the canvas anti-clockwise, setting up for the other input





                share|improve this answer















                Canvas, 26 25 24 21 bytes



                4/╬/╬⁰r:⤢n⁸{╵×↔¹A×├m↶


                Try it here!



                Explanation:



                4/ create a 4-long diagonal
                ╬ quad-palindromize it - big inner diamond
                /╬ quad-palindromize "/" - small diamond
                ⁰r center the two added vertically
                :⤢n overlap with its transpose
                ⁷{ for each input:

                ╵× repeat the canvas input+1 times horizontally
                ↔ reverse horizontally
                ¹ the input,
                A× times 10,
                ├ plus 2
                m mold the canvas to that width
                ↶ rotate the canvas anti-clockwise, setting up for the other input






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 4 hours ago

























                answered 5 hours ago









                dzaima

                13.8k21653




                13.8k21653




















                    up vote
                    4
                    down vote













                    JavaScript (ES8), 167 161 bytes



                    Takes input as (width)(height).



                    w=>h=>(g=h=>h?([x=4106,4016,x,31305,21504,17010][(x=--h%10)>5?11-x:x]+'').replace(/./g,c=>'/\'[c^x>5]||''.padEnd(c-1)).repeat(w+1).slice(8)+`
                    `+g(h):'')(h*10+2)


                    Try it online!



                    How?



                    We encode the upper half of the pattern with digits:




                    • $0$ means


                    • $1$ means /


                    • $n=2$ to $7$ means $n-1$ spaces

                    This gives:



                    0 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
                    1 ···/····· --> [3 spaces] [] [/] [5 spaces] --> 4016
                    2 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
                    3 ··/······ --> [2 spaces] [/] [2 spaces] [] [4 spaces] --> 31305
                    4 ·/······· --> [1 space] [/] [4 spaces] [] [3 spaces] --> 21504
                    5 /······/ --> [/] [6 spaces] [] [/] [] --> 17010


                    For the lower half, we use the rows $5$ to $2$ (i.e. in reverse order) with / and inverted.






                    share|improve this answer


























                      up vote
                      4
                      down vote













                      JavaScript (ES8), 167 161 bytes



                      Takes input as (width)(height).



                      w=>h=>(g=h=>h?([x=4106,4016,x,31305,21504,17010][(x=--h%10)>5?11-x:x]+'').replace(/./g,c=>'/\'[c^x>5]||''.padEnd(c-1)).repeat(w+1).slice(8)+`
                      `+g(h):'')(h*10+2)


                      Try it online!



                      How?



                      We encode the upper half of the pattern with digits:




                      • $0$ means


                      • $1$ means /


                      • $n=2$ to $7$ means $n-1$ spaces

                      This gives:



                      0 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
                      1 ···/····· --> [3 spaces] [] [/] [5 spaces] --> 4016
                      2 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
                      3 ··/······ --> [2 spaces] [/] [2 spaces] [] [4 spaces] --> 31305
                      4 ·/······· --> [1 space] [/] [4 spaces] [] [3 spaces] --> 21504
                      5 /······/ --> [/] [6 spaces] [] [/] [] --> 17010


                      For the lower half, we use the rows $5$ to $2$ (i.e. in reverse order) with / and inverted.






                      share|improve this answer
























                        up vote
                        4
                        down vote










                        up vote
                        4
                        down vote









                        JavaScript (ES8), 167 161 bytes



                        Takes input as (width)(height).



                        w=>h=>(g=h=>h?([x=4106,4016,x,31305,21504,17010][(x=--h%10)>5?11-x:x]+'').replace(/./g,c=>'/\'[c^x>5]||''.padEnd(c-1)).repeat(w+1).slice(8)+`
                        `+g(h):'')(h*10+2)


                        Try it online!



                        How?



                        We encode the upper half of the pattern with digits:




                        • $0$ means


                        • $1$ means /


                        • $n=2$ to $7$ means $n-1$ spaces

                        This gives:



                        0 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
                        1 ···/····· --> [3 spaces] [] [/] [5 spaces] --> 4016
                        2 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
                        3 ··/······ --> [2 spaces] [/] [2 spaces] [] [4 spaces] --> 31305
                        4 ·/······· --> [1 space] [/] [4 spaces] [] [3 spaces] --> 21504
                        5 /······/ --> [/] [6 spaces] [] [/] [] --> 17010


                        For the lower half, we use the rows $5$ to $2$ (i.e. in reverse order) with / and inverted.






                        share|improve this answer














                        JavaScript (ES8), 167 161 bytes



                        Takes input as (width)(height).



                        w=>h=>(g=h=>h?([x=4106,4016,x,31305,21504,17010][(x=--h%10)>5?11-x:x]+'').replace(/./g,c=>'/\'[c^x>5]||''.padEnd(c-1)).repeat(w+1).slice(8)+`
                        `+g(h):'')(h*10+2)


                        Try it online!



                        How?



                        We encode the upper half of the pattern with digits:




                        • $0$ means


                        • $1$ means /


                        • $n=2$ to $7$ means $n-1$ spaces

                        This gives:



                        0 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
                        1 ···/····· --> [3 spaces] [] [/] [5 spaces] --> 4016
                        2 ···/····· --> [3 spaces] [/] [] [5 spaces] --> 4106
                        3 ··/······ --> [2 spaces] [/] [2 spaces] [] [4 spaces] --> 31305
                        4 ·/······· --> [1 space] [/] [4 spaces] [] [3 spaces] --> 21504
                        5 /······/ --> [/] [6 spaces] [] [/] [] --> 17010


                        For the lower half, we use the rows $5$ to $2$ (i.e. in reverse order) with / and inverted.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited 2 hours ago

























                        answered 5 hours ago









                        Arnauld

                        68k584288




                        68k584288




















                            up vote
                            1
                            down vote














                            Charcoal, 24 bytes



                            F⁴«↖⁶¶/¶⟲T»F⊖NCχ⁰F⊖NC⁰χ


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



                            F⁴«


                            Repeat for each side of the original pattern.



                            ↖⁶¶/¶


                            Draw the long diagonal and two short lines of the small diamond.



                            ⟲T»


                            Rotate the entire canvas and repeat.



                            F⊖NCχ⁰


                            Copy the required number of times horizontally.



                            F⊖NC⁰χ


                            Copy the required number of times vertically.






                            share|improve this answer
























                              up vote
                              1
                              down vote














                              Charcoal, 24 bytes



                              F⁴«↖⁶¶/¶⟲T»F⊖NCχ⁰F⊖NC⁰χ


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



                              F⁴«


                              Repeat for each side of the original pattern.



                              ↖⁶¶/¶


                              Draw the long diagonal and two short lines of the small diamond.



                              ⟲T»


                              Rotate the entire canvas and repeat.



                              F⊖NCχ⁰


                              Copy the required number of times horizontally.



                              F⊖NC⁰χ


                              Copy the required number of times vertically.






                              share|improve this answer






















                                up vote
                                1
                                down vote










                                up vote
                                1
                                down vote










                                Charcoal, 24 bytes



                                F⁴«↖⁶¶/¶⟲T»F⊖NCχ⁰F⊖NC⁰χ


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



                                F⁴«


                                Repeat for each side of the original pattern.



                                ↖⁶¶/¶


                                Draw the long diagonal and two short lines of the small diamond.



                                ⟲T»


                                Rotate the entire canvas and repeat.



                                F⊖NCχ⁰


                                Copy the required number of times horizontally.



                                F⊖NC⁰χ


                                Copy the required number of times vertically.






                                share|improve this answer













                                Charcoal, 24 bytes



                                F⁴«↖⁶¶/¶⟲T»F⊖NCχ⁰F⊖NC⁰χ


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



                                F⁴«


                                Repeat for each side of the original pattern.



                                ↖⁶¶/¶


                                Draw the long diagonal and two short lines of the small diamond.



                                ⟲T»


                                Rotate the entire canvas and repeat.



                                F⊖NCχ⁰


                                Copy the required number of times horizontally.



                                F⊖NC⁰χ


                                Copy the required number of times vertically.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered 4 hours ago









                                Neil

                                77.4k744174




                                77.4k744174




















                                    up vote
                                    1
                                    down vote














                                    Haskell, 179 bytes





                                    k '\'='/'
                                    k '/'='\'
                                    k x=x
                                    f x=take(10*x+2)
                                    w#h=map(f w.cycle).f h.drop 9.cycle$(++).reverse=<<map(map k)$["\/\ /"," \ / "," \ / "," \/ "," /\ "]


                                    Try it online!






                                    share|improve this answer


























                                      up vote
                                      1
                                      down vote














                                      Haskell, 179 bytes





                                      k '\'='/'
                                      k '/'='\'
                                      k x=x
                                      f x=take(10*x+2)
                                      w#h=map(f w.cycle).f h.drop 9.cycle$(++).reverse=<<map(map k)$["\/\ /"," \ / "," \ / "," \/ "," /\ "]


                                      Try it online!






                                      share|improve this answer
























                                        up vote
                                        1
                                        down vote










                                        up vote
                                        1
                                        down vote










                                        Haskell, 179 bytes





                                        k '\'='/'
                                        k '/'='\'
                                        k x=x
                                        f x=take(10*x+2)
                                        w#h=map(f w.cycle).f h.drop 9.cycle$(++).reverse=<<map(map k)$["\/\ /"," \ / "," \ / "," \/ "," /\ "]


                                        Try it online!






                                        share|improve this answer















                                        Haskell, 179 bytes





                                        k '\'='/'
                                        k '/'='\'
                                        k x=x
                                        f x=take(10*x+2)
                                        w#h=map(f w.cycle).f h.drop 9.cycle$(++).reverse=<<map(map k)$["\/\ /"," \ / "," \ / "," \/ "," /\ "]


                                        Try it online!







                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited 3 hours ago

























                                        answered 3 hours ago









                                        ovs

                                        18.1k21058




                                        18.1k21058




















                                            up vote
                                            0
                                            down vote














                                            Perl 5 -p, 148 bytes





                                            $_='3A3'x$_.$/.'3B3
                                            3A3
                                            2/2\2
                                            1/4\1
                                            A6A
                                            B6B
                                            1\4/1
                                            2\2/2
                                            3B3
                                            3A3
                                            '=~s/^.*$/$&x$_/mger x<>.'3B3'x$_;s|A+|/\|g;s|B+|\/|g;s/d/$"x$&/ge;s|^ | |gm


                                            Try it online!






                                            share|improve this answer
























                                              up vote
                                              0
                                              down vote














                                              Perl 5 -p, 148 bytes





                                              $_='3A3'x$_.$/.'3B3
                                              3A3
                                              2/2\2
                                              1/4\1
                                              A6A
                                              B6B
                                              1\4/1
                                              2\2/2
                                              3B3
                                              3A3
                                              '=~s/^.*$/$&x$_/mger x<>.'3B3'x$_;s|A+|/\|g;s|B+|\/|g;s/d/$"x$&/ge;s|^ | |gm


                                              Try it online!






                                              share|improve this answer






















                                                up vote
                                                0
                                                down vote










                                                up vote
                                                0
                                                down vote










                                                Perl 5 -p, 148 bytes





                                                $_='3A3'x$_.$/.'3B3
                                                3A3
                                                2/2\2
                                                1/4\1
                                                A6A
                                                B6B
                                                1\4/1
                                                2\2/2
                                                3B3
                                                3A3
                                                '=~s/^.*$/$&x$_/mger x<>.'3B3'x$_;s|A+|/\|g;s|B+|\/|g;s/d/$"x$&/ge;s|^ | |gm


                                                Try it online!






                                                share|improve this answer













                                                Perl 5 -p, 148 bytes





                                                $_='3A3'x$_.$/.'3B3
                                                3A3
                                                2/2\2
                                                1/4\1
                                                A6A
                                                B6B
                                                1\4/1
                                                2\2/2
                                                3B3
                                                3A3
                                                '=~s/^.*$/$&x$_/mger x<>.'3B3'x$_;s|A+|/\|g;s|B+|\/|g;s/d/$"x$&/ge;s|^ | |gm


                                                Try it online!







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered 2 hours ago









                                                Xcali

                                                4,870520




                                                4,870520



























                                                     

                                                    draft saved


                                                    draft discarded















































                                                     


                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function ()
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f175619%2fdraw-this-diamond-pattern%23new-answer', 'question_page');

                                                    );

                                                    Post as a guest













































































                                                    Popular posts from this blog

                                                    How to check contact read email or not when send email to Individual?

                                                    Displaying single band from multi-band raster using QGIS

                                                    How many registers does an x86_64 CPU actually have?