Let's play tennis 2: east-west game
Clash 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!
code-golf string ascii-art kolmogorov-complexity
add a comment |Â
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!
code-golf string ascii-art kolmogorov-complexity
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
add a comment |Â
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!
code-golf string ascii-art kolmogorov-complexity
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
code-golf string ascii-art kolmogorov-complexity
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
add a comment |Â
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
add a comment |Â
6 Answers
6
active
oldest
votes
up vote
1
down vote
Canvas, 13 12 bytes
ëÃÂâÂÂ9:gï¼·ï¼Âï½Âï¼£âÂÂâ¼
quad-palindromizes a compressed corner of the field.
Try it here!
11 bytes with uppercase X
es, using the fact that /
compresses better than x
and palindromizing would result in overlapping /
and its mirror , which results in
X
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
add a comment |Â
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
add a comment |Â
up vote
0
down vote
Perl 5, 55 bytes
say$_,x,~~reverse for('-'x6,'| 'x2,'| |--')[0..2,1,0]
Try it online!
add a comment |Â
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--| |
add a comment |Â
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!
add a comment |Â
up vote
0
down vote
Dyalog APL, 36 bytes
(â½,'x',â¢)(â¢âª'--| |'âªâÂÂ)'-'âª1 6â´' |'
Try it online!
With a little help from Adám
add a comment |Â
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:gï¼·ï¼Âï½Âï¼£âÂÂâ¼
quad-palindromizes a compressed corner of the field.
Try it here!
11 bytes with uppercase X
es, using the fact that /
compresses better than x
and palindromizing would result in overlapping /
and its mirror , which results in
X
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
add a comment |Â
up vote
1
down vote
Canvas, 13 12 bytes
ëÃÂâÂÂ9:gï¼·ï¼Âï½Âï¼£âÂÂâ¼
quad-palindromizes a compressed corner of the field.
Try it here!
11 bytes with uppercase X
es, using the fact that /
compresses better than x
and palindromizing would result in overlapping /
and its mirror , which results in
X
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
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Canvas, 13 12 bytes
ëÃÂâÂÂ9:gï¼·ï¼Âï½Âï¼£âÂÂâ¼
quad-palindromizes a compressed corner of the field.
Try it here!
11 bytes with uppercase X
es, using the fact that /
compresses better than x
and palindromizing would result in overlapping /
and its mirror , which results in
X
Canvas, 13 12 bytes
ëÃÂâÂÂ9:gï¼·ï¼Âï½Âï¼£âÂÂâ¼
quad-palindromizes a compressed corner of the field.
Try it here!
11 bytes with uppercase X
es, using the fact that /
compresses better than x
and palindromizing would result in overlapping /
and its mirror , which results in
X
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered 1 hour ago
Quintec
965517
965517
add a comment |Â
add a comment |Â
up vote
0
down vote
Perl 5, 55 bytes
say$_,x,~~reverse for('-'x6,'| 'x2,'| |--')[0..2,1,0]
Try it online!
add a comment |Â
up vote
0
down vote
Perl 5, 55 bytes
say$_,x,~~reverse for('-'x6,'| 'x2,'| |--')[0..2,1,0]
Try it online!
add a comment |Â
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!
Perl 5, 55 bytes
say$_,x,~~reverse for('-'x6,'| 'x2,'| |--')[0..2,1,0]
Try it online!
edited 38 mins ago
answered 1 hour ago
nwellnhof
4,700920
4,700920
add a comment |Â
add a comment |Â
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--| |
add a comment |Â
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--| |
add a comment |Â
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--| |
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--| |
answered 34 mins ago
Neil
76.6k744173
76.6k744173
add a comment |Â
add a comment |Â
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!
add a comment |Â
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!
add a comment |Â
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!
Pip -l
, 42 bytes
This is gonna get a lot shorter.
Y"| |--"Yy.'x.RVyYP[yR['|s]'-yR'-sy]RV@<y
Try it online!
answered 7 mins ago
DLosc
18.5k33588
18.5k33588
add a comment |Â
add a comment |Â
up vote
0
down vote
Dyalog APL, 36 bytes
(â½,'x',â¢)(â¢âª'--| |'âªâÂÂ)'-'âª1 6â´' |'
Try it online!
With a little help from Adám
add a comment |Â
up vote
0
down vote
Dyalog APL, 36 bytes
(â½,'x',â¢)(â¢âª'--| |'âªâÂÂ)'-'âª1 6â´' |'
Try it online!
With a little help from Adám
add a comment |Â
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
Dyalog APL, 36 bytes
(â½,'x',â¢)(â¢âª'--| |'âªâÂÂ)'-'âª1 6â´' |'
Try it online!
With a little help from Adám
answered 4 mins ago
dzaima
13.3k21652
13.3k21652
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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