C4_4 Reflection!The Characters in the String Go Round and RoundASCII Doodling: Laser in a BoxRotate a Chinese checkerboardASCII art reflectionSimulate a Rubik's cubeHexaGolf: RotatagonsSame length, different stringBinary tree rotationsRotate ASCII Art by 45 DegreesIs this skew symmetry?

A demigod among men

'Kukhtarev's model' or 'THE Kukhtarev's model'?

Can't make a xubuntu persistent live USB

Does Australia produce unique 'specialty steel'?

How can demon technology be prevented from surpassing humans?

Can the bass be used instead of drums?

"Dear Stack Exchange, I am very disappointed in you" - How to construct a strong opening line in a letter?

How can I attach a set of five panniers?

Could Alpha Centauri be made of anti-matter?

Did smallpox emerge in 1580?

What's the most efficient way to draw this region?

An idiomatic word for "very little" in this context?

How to handle shared mortgage payment if one person can't pay their share?

What does "drop" mean in this context?

How can AnyDVD destroy a DVD drive?

How did Ron get five hundred Chocolate Frog cards?

How honest to be with US immigration about uncertainty about travel plans?

Fantasy novel/series with young man who discovers he can use magic that is outlawed

First aid scissors confiscated by Dubai airport security

What causes standard door hinges to close up to a certain amount automatically?

Why is coffee provided during big chess events when it contains a banned substance?

What is the German word for: "It only works when I try to show you how it does not work"?

Can you decide not to sneak into a room after seeing your roll?

Is consistent disregard for students' time "normal" in undergraduate research?



C4_4 Reflection!


The Characters in the String Go Round and RoundASCII Doodling: Laser in a BoxRotate a Chinese checkerboardASCII art reflectionSimulate a Rubik's cubeHexaGolf: RotatagonsSame length, different stringBinary tree rotationsRotate ASCII Art by 45 DegreesIs this skew symmetry?






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









5














$begingroup$


Sorry if this is a dupe.



In this challenge, your task is to input a rectangle ASCII pattern (You may assume only printable characters need to be handled, and you may assume a trailing newline or not), C4_4 symmetrify, and output it.



Here, C4_4 symmetric means symmetric under 90-degree rotation around a corner of the corner character. The corresponding "symmetrify" process is copy and rotate 90-degree clockwise three times, and then put all four copies together. For the precise arrangement, you can look at Test Cases.



Test Cases



Input:
asdf
jkl;

Output:
ja
ks
asdfld
jkl;;f
f;;lkj
dlfdsa
sk
aj

Input:
.O.
..O
OOO

Output:

.O.O..
..OO.O
OOOOO.
.OOOOO
O.OO..
..O.O.










share|improve this question











$endgroup$











  • 1




    $begingroup$
    I'd suggest to add a test case where the height of the input is strictly greater than its width.
    $endgroup$
    – Arnauld
    11 hours ago

















5














$begingroup$


Sorry if this is a dupe.



In this challenge, your task is to input a rectangle ASCII pattern (You may assume only printable characters need to be handled, and you may assume a trailing newline or not), C4_4 symmetrify, and output it.



Here, C4_4 symmetric means symmetric under 90-degree rotation around a corner of the corner character. The corresponding "symmetrify" process is copy and rotate 90-degree clockwise three times, and then put all four copies together. For the precise arrangement, you can look at Test Cases.



Test Cases



Input:
asdf
jkl;

Output:
ja
ks
asdfld
jkl;;f
f;;lkj
dlfdsa
sk
aj

Input:
.O.
..O
OOO

Output:

.O.O..
..OO.O
OOOOO.
.OOOOO
O.OO..
..O.O.










share|improve this question











$endgroup$











  • 1




    $begingroup$
    I'd suggest to add a test case where the height of the input is strictly greater than its width.
    $endgroup$
    – Arnauld
    11 hours ago













5












5








5





$begingroup$


Sorry if this is a dupe.



In this challenge, your task is to input a rectangle ASCII pattern (You may assume only printable characters need to be handled, and you may assume a trailing newline or not), C4_4 symmetrify, and output it.



Here, C4_4 symmetric means symmetric under 90-degree rotation around a corner of the corner character. The corresponding "symmetrify" process is copy and rotate 90-degree clockwise three times, and then put all four copies together. For the precise arrangement, you can look at Test Cases.



Test Cases



Input:
asdf
jkl;

Output:
ja
ks
asdfld
jkl;;f
f;;lkj
dlfdsa
sk
aj

Input:
.O.
..O
OOO

Output:

.O.O..
..OO.O
OOOOO.
.OOOOO
O.OO..
..O.O.










share|improve this question











$endgroup$




Sorry if this is a dupe.



In this challenge, your task is to input a rectangle ASCII pattern (You may assume only printable characters need to be handled, and you may assume a trailing newline or not), C4_4 symmetrify, and output it.



Here, C4_4 symmetric means symmetric under 90-degree rotation around a corner of the corner character. The corresponding "symmetrify" process is copy and rotate 90-degree clockwise three times, and then put all four copies together. For the precise arrangement, you can look at Test Cases.



Test Cases



Input:
asdf
jkl;

Output:
ja
ks
asdfld
jkl;;f
f;;lkj
dlfdsa
sk
aj

Input:
.O.
..O
OOO

Output:

.O.O..
..OO.O
OOOOO.
.OOOOO
O.OO..
..O.O.







code-golf ascii-art






share|improve this question















share|improve this question













share|improve this question




share|improve this question



share|improve this question








edited 10 hours ago









alephalpha

22.8k3 gold badges32 silver badges98 bronze badges




22.8k3 gold badges32 silver badges98 bronze badges










asked 12 hours ago









TwilightSparkleTwilightSparkle

7374 silver badges15 bronze badges




7374 silver badges15 bronze badges










  • 1




    $begingroup$
    I'd suggest to add a test case where the height of the input is strictly greater than its width.
    $endgroup$
    – Arnauld
    11 hours ago












  • 1




    $begingroup$
    I'd suggest to add a test case where the height of the input is strictly greater than its width.
    $endgroup$
    – Arnauld
    11 hours ago







1




1




$begingroup$
I'd suggest to add a test case where the height of the input is strictly greater than its width.
$endgroup$
– Arnauld
11 hours ago




$begingroup$
I'd suggest to add a test case where the height of the input is strictly greater than its width.
$endgroup$
– Arnauld
11 hours ago










4 Answers
4






active

oldest

votes


















5
















$begingroup$


Charcoal, 6 bytes



A⟲C²⁴⁶


Try it online! Link is to verbose version of code. Explanation: implicitly prints the input, performs the rotation, signifies to keep copies, and ²⁴⁶ represents the numbers of 45-degree rotations to make. (Charcoal defaults to rotating around the bottom-right corner as desired.)






share|improve this answer










$endgroup$














  • $begingroup$
    Yet another fastest gun! Yeah, Charcoal is very suitable for this challenge. Have a +1!
    $endgroup$
    – TwilightSparkle
    12 hours ago


















2
















$begingroup$


Python 3, 193 bytes





def f(s):q=len(s[0])-len(s);s=[[" "]*len(s[0])]*q+s;s=[[" "]*-q+l for l in s];j=lambda a,b:[x+y for x,y in zip(a,b)];r=lambda x:[*map(list,zip(*x[::-1]))];return j(s,r(s))+j(r(r(r(s))),r(r(s)))


Try it online!






share|improve this answer










$endgroup$










  • 1




    $begingroup$
    I was not expecting this to happen. Nice work!
    $endgroup$
    – TwilightSparkle
    11 hours ago


















1
















$begingroup$


J, 38 bytes



(,|."1@|.)@(,.|:@|.)@((2$_1*>./)@${.])


Try it online!



No doubt it can be golfed much further.






share|improve this answer












$endgroup$






















    1
















    $begingroup$

    JavaScript (ES6),  178  173 bytes



    Takes input as an array of strings. Returns a string.





    m=>(g=x=>~y?(Y=y<w?y:W-y,X=x<w?x:W-x,Z=y<w^x<w?Y:X,(m[Z-z*d]||0)[(X^Y^Z)+!z*d]||' ')+[`
    `[x-W]]+g(x<W?x+1:!y--):'')(0,w=m[0].length,h=m.length,d=w-h,(z=d>0)?0:w=h,y=W=w*2-1)


    Try it online!






    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%2f193951%2fc4-4-reflection%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown


























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      5
















      $begingroup$


      Charcoal, 6 bytes



      A⟲C²⁴⁶


      Try it online! Link is to verbose version of code. Explanation: implicitly prints the input, performs the rotation, signifies to keep copies, and ²⁴⁶ represents the numbers of 45-degree rotations to make. (Charcoal defaults to rotating around the bottom-right corner as desired.)






      share|improve this answer










      $endgroup$














      • $begingroup$
        Yet another fastest gun! Yeah, Charcoal is very suitable for this challenge. Have a +1!
        $endgroup$
        – TwilightSparkle
        12 hours ago















      5
















      $begingroup$


      Charcoal, 6 bytes



      A⟲C²⁴⁶


      Try it online! Link is to verbose version of code. Explanation: implicitly prints the input, performs the rotation, signifies to keep copies, and ²⁴⁶ represents the numbers of 45-degree rotations to make. (Charcoal defaults to rotating around the bottom-right corner as desired.)






      share|improve this answer










      $endgroup$














      • $begingroup$
        Yet another fastest gun! Yeah, Charcoal is very suitable for this challenge. Have a +1!
        $endgroup$
        – TwilightSparkle
        12 hours ago













      5














      5










      5







      $begingroup$


      Charcoal, 6 bytes



      A⟲C²⁴⁶


      Try it online! Link is to verbose version of code. Explanation: implicitly prints the input, performs the rotation, signifies to keep copies, and ²⁴⁶ represents the numbers of 45-degree rotations to make. (Charcoal defaults to rotating around the bottom-right corner as desired.)






      share|improve this answer










      $endgroup$




      Charcoal, 6 bytes



      A⟲C²⁴⁶


      Try it online! Link is to verbose version of code. Explanation: implicitly prints the input, performs the rotation, signifies to keep copies, and ²⁴⁶ represents the numbers of 45-degree rotations to make. (Charcoal defaults to rotating around the bottom-right corner as desired.)







      share|improve this answer













      share|improve this answer




      share|improve this answer



      share|improve this answer










      answered 12 hours ago









      NeilNeil

      89.5k8 gold badges46 silver badges188 bronze badges




      89.5k8 gold badges46 silver badges188 bronze badges














      • $begingroup$
        Yet another fastest gun! Yeah, Charcoal is very suitable for this challenge. Have a +1!
        $endgroup$
        – TwilightSparkle
        12 hours ago
















      • $begingroup$
        Yet another fastest gun! Yeah, Charcoal is very suitable for this challenge. Have a +1!
        $endgroup$
        – TwilightSparkle
        12 hours ago















      $begingroup$
      Yet another fastest gun! Yeah, Charcoal is very suitable for this challenge. Have a +1!
      $endgroup$
      – TwilightSparkle
      12 hours ago




      $begingroup$
      Yet another fastest gun! Yeah, Charcoal is very suitable for this challenge. Have a +1!
      $endgroup$
      – TwilightSparkle
      12 hours ago













      2
















      $begingroup$


      Python 3, 193 bytes





      def f(s):q=len(s[0])-len(s);s=[[" "]*len(s[0])]*q+s;s=[[" "]*-q+l for l in s];j=lambda a,b:[x+y for x,y in zip(a,b)];r=lambda x:[*map(list,zip(*x[::-1]))];return j(s,r(s))+j(r(r(r(s))),r(r(s)))


      Try it online!






      share|improve this answer










      $endgroup$










      • 1




        $begingroup$
        I was not expecting this to happen. Nice work!
        $endgroup$
        – TwilightSparkle
        11 hours ago















      2
















      $begingroup$


      Python 3, 193 bytes





      def f(s):q=len(s[0])-len(s);s=[[" "]*len(s[0])]*q+s;s=[[" "]*-q+l for l in s];j=lambda a,b:[x+y for x,y in zip(a,b)];r=lambda x:[*map(list,zip(*x[::-1]))];return j(s,r(s))+j(r(r(r(s))),r(r(s)))


      Try it online!






      share|improve this answer










      $endgroup$










      • 1




        $begingroup$
        I was not expecting this to happen. Nice work!
        $endgroup$
        – TwilightSparkle
        11 hours ago













      2














      2










      2







      $begingroup$


      Python 3, 193 bytes





      def f(s):q=len(s[0])-len(s);s=[[" "]*len(s[0])]*q+s;s=[[" "]*-q+l for l in s];j=lambda a,b:[x+y for x,y in zip(a,b)];r=lambda x:[*map(list,zip(*x[::-1]))];return j(s,r(s))+j(r(r(r(s))),r(r(s)))


      Try it online!






      share|improve this answer










      $endgroup$




      Python 3, 193 bytes





      def f(s):q=len(s[0])-len(s);s=[[" "]*len(s[0])]*q+s;s=[[" "]*-q+l for l in s];j=lambda a,b:[x+y for x,y in zip(a,b)];r=lambda x:[*map(list,zip(*x[::-1]))];return j(s,r(s))+j(r(r(r(s))),r(r(s)))


      Try it online!







      share|improve this answer













      share|improve this answer




      share|improve this answer



      share|improve this answer










      answered 11 hours ago









      HyperNeutrinoHyperNeutrino

      20.6k4 gold badges41 silver badges155 bronze badges




      20.6k4 gold badges41 silver badges155 bronze badges










      • 1




        $begingroup$
        I was not expecting this to happen. Nice work!
        $endgroup$
        – TwilightSparkle
        11 hours ago












      • 1




        $begingroup$
        I was not expecting this to happen. Nice work!
        $endgroup$
        – TwilightSparkle
        11 hours ago







      1




      1




      $begingroup$
      I was not expecting this to happen. Nice work!
      $endgroup$
      – TwilightSparkle
      11 hours ago




      $begingroup$
      I was not expecting this to happen. Nice work!
      $endgroup$
      – TwilightSparkle
      11 hours ago











      1
















      $begingroup$


      J, 38 bytes



      (,|."1@|.)@(,.|:@|.)@((2$_1*>./)@${.])


      Try it online!



      No doubt it can be golfed much further.






      share|improve this answer












      $endgroup$



















        1
















        $begingroup$


        J, 38 bytes



        (,|."1@|.)@(,.|:@|.)@((2$_1*>./)@${.])


        Try it online!



        No doubt it can be golfed much further.






        share|improve this answer












        $endgroup$

















          1














          1










          1







          $begingroup$


          J, 38 bytes



          (,|."1@|.)@(,.|:@|.)@((2$_1*>./)@${.])


          Try it online!



          No doubt it can be golfed much further.






          share|improve this answer












          $endgroup$




          J, 38 bytes



          (,|."1@|.)@(,.|:@|.)@((2$_1*>./)@${.])


          Try it online!



          No doubt it can be golfed much further.







          share|improve this answer















          share|improve this answer




          share|improve this answer



          share|improve this answer








          edited 11 hours ago

























          answered 11 hours ago









          Galen IvanovGalen Ivanov

          9,7071 gold badge14 silver badges40 bronze badges




          9,7071 gold badge14 silver badges40 bronze badges
























              1
















              $begingroup$

              JavaScript (ES6),  178  173 bytes



              Takes input as an array of strings. Returns a string.





              m=>(g=x=>~y?(Y=y<w?y:W-y,X=x<w?x:W-x,Z=y<w^x<w?Y:X,(m[Z-z*d]||0)[(X^Y^Z)+!z*d]||' ')+[`
              `[x-W]]+g(x<W?x+1:!y--):'')(0,w=m[0].length,h=m.length,d=w-h,(z=d>0)?0:w=h,y=W=w*2-1)


              Try it online!






              share|improve this answer












              $endgroup$



















                1
















                $begingroup$

                JavaScript (ES6),  178  173 bytes



                Takes input as an array of strings. Returns a string.





                m=>(g=x=>~y?(Y=y<w?y:W-y,X=x<w?x:W-x,Z=y<w^x<w?Y:X,(m[Z-z*d]||0)[(X^Y^Z)+!z*d]||' ')+[`
                `[x-W]]+g(x<W?x+1:!y--):'')(0,w=m[0].length,h=m.length,d=w-h,(z=d>0)?0:w=h,y=W=w*2-1)


                Try it online!






                share|improve this answer












                $endgroup$

















                  1














                  1










                  1







                  $begingroup$

                  JavaScript (ES6),  178  173 bytes



                  Takes input as an array of strings. Returns a string.





                  m=>(g=x=>~y?(Y=y<w?y:W-y,X=x<w?x:W-x,Z=y<w^x<w?Y:X,(m[Z-z*d]||0)[(X^Y^Z)+!z*d]||' ')+[`
                  `[x-W]]+g(x<W?x+1:!y--):'')(0,w=m[0].length,h=m.length,d=w-h,(z=d>0)?0:w=h,y=W=w*2-1)


                  Try it online!






                  share|improve this answer












                  $endgroup$



                  JavaScript (ES6),  178  173 bytes



                  Takes input as an array of strings. Returns a string.





                  m=>(g=x=>~y?(Y=y<w?y:W-y,X=x<w?x:W-x,Z=y<w^x<w?Y:X,(m[Z-z*d]||0)[(X^Y^Z)+!z*d]||' ')+[`
                  `[x-W]]+g(x<W?x+1:!y--):'')(0,w=m[0].length,h=m.length,d=w-h,(z=d>0)?0:w=h,y=W=w*2-1)


                  Try it online!







                  share|improve this answer















                  share|improve this answer




                  share|improve this answer



                  share|improve this answer








                  edited 11 hours ago

























                  answered 11 hours ago









                  ArnauldArnauld

                  94.3k7 gold badges111 silver badges383 bronze badges




                  94.3k7 gold badges111 silver badges383 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%2f193951%2fc4-4-reflection%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

                      Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її