Let's play tennis 2: east-west game

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











up vote
3
down vote

favorite












There is a topic Let's play tennis by Daniel. He proposes to place a court in the North-South direction. My proposal is to create a court to play tennis in the East-West direction too.



You have to print a tennis court, but you have to do it in the fewest bytes possible because of confidential reasons.



Tennis court



------x------
| | x | |
| |--x--| |
| | x | |
------x------


Original rules are:



  • no extra spaces;

  • tabs would be unfair;

  • only one optional trailing newline is allowed.

This is code-golf, so shortest code in bytes wins!










share|improve this question























  • Is trailing whitespace on each line or trailing newline allowed?
    – Quintec
    2 hours ago










  • In original topic rule was: 'no. You may only have an optional trailing newline'
    – mazzy
    1 hour ago














up vote
3
down vote

favorite












There is a topic Let's play tennis by Daniel. He proposes to place a court in the North-South direction. My proposal is to create a court to play tennis in the East-West direction too.



You have to print a tennis court, but you have to do it in the fewest bytes possible because of confidential reasons.



Tennis court



------x------
| | x | |
| |--x--| |
| | x | |
------x------


Original rules are:



  • no extra spaces;

  • tabs would be unfair;

  • only one optional trailing newline is allowed.

This is code-golf, so shortest code in bytes wins!










share|improve this question























  • Is trailing whitespace on each line or trailing newline allowed?
    – Quintec
    2 hours ago










  • In original topic rule was: 'no. You may only have an optional trailing newline'
    – mazzy
    1 hour ago












up vote
3
down vote

favorite









up vote
3
down vote

favorite











There is a topic Let's play tennis by Daniel. He proposes to place a court in the North-South direction. My proposal is to create a court to play tennis in the East-West direction too.



You have to print a tennis court, but you have to do it in the fewest bytes possible because of confidential reasons.



Tennis court



------x------
| | x | |
| |--x--| |
| | x | |
------x------


Original rules are:



  • no extra spaces;

  • tabs would be unfair;

  • only one optional trailing newline is allowed.

This is code-golf, so shortest code in bytes wins!










share|improve this question















There is a topic Let's play tennis by Daniel. He proposes to place a court in the North-South direction. My proposal is to create a court to play tennis in the East-West direction too.



You have to print a tennis court, but you have to do it in the fewest bytes possible because of confidential reasons.



Tennis court



------x------
| | x | |
| |--x--| |
| | x | |
------x------


Original rules are:



  • no extra spaces;

  • tabs would be unfair;

  • only one optional trailing newline is allowed.

This is code-golf, so shortest code in bytes wins!







code-golf string ascii-art kolmogorov-complexity






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago

























asked 2 hours ago









mazzy

1,241311




1,241311











  • Is trailing whitespace on each line or trailing newline allowed?
    – Quintec
    2 hours ago










  • In original topic rule was: 'no. You may only have an optional trailing newline'
    – mazzy
    1 hour ago
















  • Is trailing whitespace on each line or trailing newline allowed?
    – Quintec
    2 hours ago










  • In original topic rule was: 'no. You may only have an optional trailing newline'
    – mazzy
    1 hour ago















Is trailing whitespace on each line or trailing newline allowed?
– Quintec
2 hours ago




Is trailing whitespace on each line or trailing newline allowed?
– Quintec
2 hours ago












In original topic rule was: 'no. You may only have an optional trailing newline'
– mazzy
1 hour ago




In original topic rule was: 'no. You may only have an optional trailing newline'
– mazzy
1 hour ago










6 Answers
6






active

oldest

votes

















up vote
1
down vote














Canvas, 13 12 bytes



«ω↕9:gW:tC‟┼


quad-palindromizes a compressed corner of the field.



Try it here!



11 bytes with uppercase Xes, using the fact that / compresses better than x and palindromizing would result in overlapping / and its mirror , which results in X






share|improve this answer






















  • See, my thinking when I first saw this question was "do I have enough time to go learn Canvas right now and then post a solution?" Evidently not :P
    – Quintec
    52 mins ago

















up vote
0
down vote













Python 3, 75 bytes



s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p;print(w,a,p+w[4:9]+p,a,w,sep='n')


Probably golfable - I've never really tried kolmogorov-complexity challenges before.



Try it online!



In Python 2 I could get it to 76 bytes



s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p
for i in w,a,p+w[4:9]+p,a,w:print i





share|improve this answer



























    up vote
    0
    down vote














    Perl 5, 55 bytes





    say$_,x,~~reverse for('-'x6,'| 'x2,'| |--')[0..2,1,0]


    Try it online!






    share|improve this answer





























      up vote
      0
      down vote














      Charcoal, 15 bytes



      ↑²←⁶↓xx→x²↑²‖O¬


      Try it online! Link is to verbose version of code. By way of explanation I will show the result after each of the drawing commands up to the final reflection:



      ↑² |
      |

      ------
      ←⁶ |
      |

      x------
      ↓xx x |
      |

      x------
      →x² x |
      x-- |

      x------
      ↑² x | |
      x--| |





      share|improve this answer



























        up vote
        0
        down vote














        Pip -l, 42 bytes



        This is gonna get a lot shorter.



        Y"| |--"Yy.'x.RVyYP[yR['|s]'-yR'-sy]RV@<y


        Try it online!





        share



























          up vote
          0
          down vote













          Dyalog APL, 36 bytes





          (⌽,'x',⊢)(⊢⍪'--| |'⍪⊖)'-'⍪1 6⍴' |'


          Try it online!



          With a little help from Adám





          share




















            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: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f174427%2flets-play-tennis-2-east-west-game%23new-answer', 'question_page');

            );

            Post as a guest






























            6 Answers
            6






            active

            oldest

            votes








            6 Answers
            6






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote














            Canvas, 13 12 bytes



            «ω↕9:gW:tC‟┼


            quad-palindromizes a compressed corner of the field.



            Try it here!



            11 bytes with uppercase Xes, using the fact that / compresses better than x and palindromizing would result in overlapping / and its mirror , which results in X






            share|improve this answer






















            • See, my thinking when I first saw this question was "do I have enough time to go learn Canvas right now and then post a solution?" Evidently not :P
              – Quintec
              52 mins ago














            up vote
            1
            down vote














            Canvas, 13 12 bytes



            «ω↕9:gW:tC‟┼


            quad-palindromizes a compressed corner of the field.



            Try it here!



            11 bytes with uppercase Xes, using the fact that / compresses better than x and palindromizing would result in overlapping / and its mirror , which results in X






            share|improve this answer






















            • See, my thinking when I first saw this question was "do I have enough time to go learn Canvas right now and then post a solution?" Evidently not :P
              – Quintec
              52 mins ago












            up vote
            1
            down vote










            up vote
            1
            down vote










            Canvas, 13 12 bytes



            «ω↕9:gW:tC‟┼


            quad-palindromizes a compressed corner of the field.



            Try it here!



            11 bytes with uppercase Xes, using the fact that / compresses better than x and palindromizing would result in overlapping / and its mirror , which results in X






            share|improve this answer















            Canvas, 13 12 bytes



            «ω↕9:gW:tC‟┼


            quad-palindromizes a compressed corner of the field.



            Try it here!



            11 bytes with uppercase Xes, using the fact that / compresses better than x and palindromizing would result in overlapping / and its mirror , which results in X







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 28 mins ago

























            answered 1 hour ago









            dzaima

            13.3k21652




            13.3k21652











            • See, my thinking when I first saw this question was "do I have enough time to go learn Canvas right now and then post a solution?" Evidently not :P
              – Quintec
              52 mins ago
















            • See, my thinking when I first saw this question was "do I have enough time to go learn Canvas right now and then post a solution?" Evidently not :P
              – Quintec
              52 mins ago















            See, my thinking when I first saw this question was "do I have enough time to go learn Canvas right now and then post a solution?" Evidently not :P
            – Quintec
            52 mins ago




            See, my thinking when I first saw this question was "do I have enough time to go learn Canvas right now and then post a solution?" Evidently not :P
            – Quintec
            52 mins ago










            up vote
            0
            down vote













            Python 3, 75 bytes



            s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p;print(w,a,p+w[4:9]+p,a,w,sep='n')


            Probably golfable - I've never really tried kolmogorov-complexity challenges before.



            Try it online!



            In Python 2 I could get it to 76 bytes



            s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p
            for i in w,a,p+w[4:9]+p,a,w:print i





            share|improve this answer
























              up vote
              0
              down vote













              Python 3, 75 bytes



              s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p;print(w,a,p+w[4:9]+p,a,w,sep='n')


              Probably golfable - I've never really tried kolmogorov-complexity challenges before.



              Try it online!



              In Python 2 I could get it to 76 bytes



              s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p
              for i in w,a,p+w[4:9]+p,a,w:print i





              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                Python 3, 75 bytes



                s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p;print(w,a,p+w[4:9]+p,a,w,sep='n')


                Probably golfable - I've never really tried kolmogorov-complexity challenges before.



                Try it online!



                In Python 2 I could get it to 76 bytes



                s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p
                for i in w,a,p+w[4:9]+p,a,w:print i





                share|improve this answer












                Python 3, 75 bytes



                s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p;print(w,a,p+w[4:9]+p,a,w,sep='n')


                Probably golfable - I've never really tried kolmogorov-complexity challenges before.



                Try it online!



                In Python 2 I could get it to 76 bytes



                s='-'*6;p='| |';w=s+'x'+s;a=p+' x '+p
                for i in w,a,p+w[4:9]+p,a,w:print i






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                Quintec

                965517




                965517




















                    up vote
                    0
                    down vote














                    Perl 5, 55 bytes





                    say$_,x,~~reverse for('-'x6,'| 'x2,'| |--')[0..2,1,0]


                    Try it online!






                    share|improve this answer


























                      up vote
                      0
                      down vote














                      Perl 5, 55 bytes





                      say$_,x,~~reverse for('-'x6,'| 'x2,'| |--')[0..2,1,0]


                      Try it online!






                      share|improve this answer
























                        up vote
                        0
                        down vote










                        up vote
                        0
                        down vote










                        Perl 5, 55 bytes





                        say$_,x,~~reverse for('-'x6,'| 'x2,'| |--')[0..2,1,0]


                        Try it online!






                        share|improve this answer















                        Perl 5, 55 bytes





                        say$_,x,~~reverse for('-'x6,'| 'x2,'| |--')[0..2,1,0]


                        Try it online!







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited 38 mins ago

























                        answered 1 hour ago









                        nwellnhof

                        4,700920




                        4,700920




















                            up vote
                            0
                            down vote














                            Charcoal, 15 bytes



                            ↑²←⁶↓xx→x²↑²‖O¬


                            Try it online! Link is to verbose version of code. By way of explanation I will show the result after each of the drawing commands up to the final reflection:



                            ↑² |
                            |

                            ------
                            ←⁶ |
                            |

                            x------
                            ↓xx x |
                            |

                            x------
                            →x² x |
                            x-- |

                            x------
                            ↑² x | |
                            x--| |





                            share|improve this answer
























                              up vote
                              0
                              down vote














                              Charcoal, 15 bytes



                              ↑²←⁶↓xx→x²↑²‖O¬


                              Try it online! Link is to verbose version of code. By way of explanation I will show the result after each of the drawing commands up to the final reflection:



                              ↑² |
                              |

                              ------
                              ←⁶ |
                              |

                              x------
                              ↓xx x |
                              |

                              x------
                              →x² x |
                              x-- |

                              x------
                              ↑² x | |
                              x--| |





                              share|improve this answer






















                                up vote
                                0
                                down vote










                                up vote
                                0
                                down vote










                                Charcoal, 15 bytes



                                ↑²←⁶↓xx→x²↑²‖O¬


                                Try it online! Link is to verbose version of code. By way of explanation I will show the result after each of the drawing commands up to the final reflection:



                                ↑² |
                                |

                                ------
                                ←⁶ |
                                |

                                x------
                                ↓xx x |
                                |

                                x------
                                →x² x |
                                x-- |

                                x------
                                ↑² x | |
                                x--| |





                                share|improve this answer













                                Charcoal, 15 bytes



                                ↑²←⁶↓xx→x²↑²‖O¬


                                Try it online! Link is to verbose version of code. By way of explanation I will show the result after each of the drawing commands up to the final reflection:



                                ↑² |
                                |

                                ------
                                ←⁶ |
                                |

                                x------
                                ↓xx x |
                                |

                                x------
                                →x² x |
                                x-- |

                                x------
                                ↑² x | |
                                x--| |






                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered 34 mins ago









                                Neil

                                76.6k744173




                                76.6k744173




















                                    up vote
                                    0
                                    down vote














                                    Pip -l, 42 bytes



                                    This is gonna get a lot shorter.



                                    Y"| |--"Yy.'x.RVyYP[yR['|s]'-yR'-sy]RV@<y


                                    Try it online!





                                    share
























                                      up vote
                                      0
                                      down vote














                                      Pip -l, 42 bytes



                                      This is gonna get a lot shorter.



                                      Y"| |--"Yy.'x.RVyYP[yR['|s]'-yR'-sy]RV@<y


                                      Try it online!





                                      share






















                                        up vote
                                        0
                                        down vote










                                        up vote
                                        0
                                        down vote










                                        Pip -l, 42 bytes



                                        This is gonna get a lot shorter.



                                        Y"| |--"Yy.'x.RVyYP[yR['|s]'-yR'-sy]RV@<y


                                        Try it online!





                                        share













                                        Pip -l, 42 bytes



                                        This is gonna get a lot shorter.



                                        Y"| |--"Yy.'x.RVyYP[yR['|s]'-yR'-sy]RV@<y


                                        Try it online!






                                        share











                                        share


                                        share










                                        answered 7 mins ago









                                        DLosc

                                        18.5k33588




                                        18.5k33588




















                                            up vote
                                            0
                                            down vote













                                            Dyalog APL, 36 bytes





                                            (⌽,'x',⊢)(⊢⍪'--| |'⍪⊖)'-'⍪1 6⍴' |'


                                            Try it online!



                                            With a little help from Adám





                                            share
























                                              up vote
                                              0
                                              down vote













                                              Dyalog APL, 36 bytes





                                              (⌽,'x',⊢)(⊢⍪'--| |'⍪⊖)'-'⍪1 6⍴' |'


                                              Try it online!



                                              With a little help from Adám





                                              share






















                                                up vote
                                                0
                                                down vote










                                                up vote
                                                0
                                                down vote









                                                Dyalog APL, 36 bytes





                                                (⌽,'x',⊢)(⊢⍪'--| |'⍪⊖)'-'⍪1 6⍴' |'


                                                Try it online!



                                                With a little help from Adám





                                                share












                                                Dyalog APL, 36 bytes





                                                (⌽,'x',⊢)(⊢⍪'--| |'⍪⊖)'-'⍪1 6⍴' |'


                                                Try it online!



                                                With a little help from Adám






                                                share











                                                share


                                                share










                                                answered 4 mins ago









                                                dzaima

                                                13.3k21652




                                                13.3k21652



























                                                     

                                                    draft saved


                                                    draft discarded















































                                                     


                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function ()
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f174427%2flets-play-tennis-2-east-west-game%23new-answer', 'question_page');

                                                    );

                                                    Post as a guest













































































                                                    Comments

                                                    Popular posts from this blog

                                                    What does second last employer means? [closed]

                                                    Installing NextGIS Connect into QGIS 3?

                                                    One-line joke