Bake me a slice of cake
Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
My birthday is in a month, and this is a slice of tasty cake.
.-""-.
.-" "-.
|""--.. "-.
| ""--.. "-.
|""--.. ""--..
| ""--.. |
| ""--..|
""--.. |
""--.. |
""--..|
In the fewest number of bytes, construct this slice of cake for me. You can print it to STDOUT or return it as a function result.
Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately.
Rules and I/O
- No input
- Output can be given by any convenient method.
- Either a full program or a function are acceptable.
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 kolmogorov-complexity
add a comment |Â
up vote
5
down vote
favorite
My birthday is in a month, and this is a slice of tasty cake.
.-""-.
.-" "-.
|""--.. "-.
| ""--.. "-.
|""--.. ""--..
| ""--.. |
| ""--..|
""--.. |
""--.. |
""--..|
In the fewest number of bytes, construct this slice of cake for me. You can print it to STDOUT or return it as a function result.
Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately.
Rules and I/O
- No input
- Output can be given by any convenient method.
- Either a full program or a function are acceptable.
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 kolmogorov-complexity
@Arnauld Hah, no, that was a mistake on my part when copy-pasting. Let me fix that.
â AdmBorkBork
2 hours ago
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
My birthday is in a month, and this is a slice of tasty cake.
.-""-.
.-" "-.
|""--.. "-.
| ""--.. "-.
|""--.. ""--..
| ""--.. |
| ""--..|
""--.. |
""--.. |
""--..|
In the fewest number of bytes, construct this slice of cake for me. You can print it to STDOUT or return it as a function result.
Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately.
Rules and I/O
- No input
- Output can be given by any convenient method.
- Either a full program or a function are acceptable.
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 kolmogorov-complexity
My birthday is in a month, and this is a slice of tasty cake.
.-""-.
.-" "-.
|""--.. "-.
| ""--.. "-.
|""--.. ""--..
| ""--.. |
| ""--..|
""--.. |
""--.. |
""--..|
In the fewest number of bytes, construct this slice of cake for me. You can print it to STDOUT or return it as a function result.
Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately.
Rules and I/O
- No input
- Output can be given by any convenient method.
- Either a full program or a function are acceptable.
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 kolmogorov-complexity
code-golf ascii-art kolmogorov-complexity
edited 2 hours ago
asked 2 hours ago
AdmBorkBork
25k360217
25k360217
@Arnauld Hah, no, that was a mistake on my part when copy-pasting. Let me fix that.
â AdmBorkBork
2 hours ago
add a comment |Â
@Arnauld Hah, no, that was a mistake on my part when copy-pasting. Let me fix that.
â AdmBorkBork
2 hours ago
@Arnauld Hah, no, that was a mistake on my part when copy-pasting. Let me fix that.
â AdmBorkBork
2 hours ago
@Arnauld Hah, no, that was a mistake on my part when copy-pasting. Let me fix that.
â AdmBorkBork
2 hours ago
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
1
down vote
JavaScript (ES8), 115 112 bytes
Saved 3 bytes thanks to @ovs
_=>`4.-""-.
1.-"6"-.
|06"-.
|603"-.
|060\
|606|
|660|
1066|
706|
670|`.replace(/d/g,n=>''.padEnd(n)||'""--..')
Try it online!
112 bytes
â ovs
38 mins ago
add a comment |Â
up vote
1
down vote
Charcoal, 40 bytes
FóëâÂÂFù⸿âÂÂFóö""--..ÃȉÂÂâµâÂÂFâ´âÂÂö.-"FòëâÂÂ"-.âÂÂÃȉÂÂâµ
Try it online! Link is to verbose version of code. Explanation:
Fóë
Loop over the three horizontal lines.
âÂÂFù⸿âÂÂ
The lines overlap by an amount depending on which line we're on. This calculates the correct amount of overlap but also moves the cursor to the left of the canvas again.
Fóö""--..û
Repeat three times, move the cursor down one line and then print a third of the horizontal line.
âÂÂâµâÂÂ
Print the vertical line on the right and the backslash on the corner.
Fâ´âÂÂö.-"
Repeat four times, move the cursor up one line and then print a quarter of the diagonal.
FòëâÂÂ"-.âÂÂû
Print the other diagonal. (I couldn't find a way of combining the printing with the movement but this is still 2 bytes shorter than the next best way I could find.)
âÂÂâµ
Print the vertical line on the left.
add a comment |Â
up vote
1
down vote
Canvas, 77 65 58 54 44 43 42 40 bytes
"-.ï¼Â\\\
ï¼Ââ¸ñï¼Ââ¸ï¼Âï¼Ââ¸ï¼Âï¼Âï¼ÂâÂÂâÂÂï¼Âï¼ÂâÂÂï¼Â|ï¼Âï¼ÂâÂÂÃÂâÂÂâÂÂAëï¼ÂâÂÂï¼Âï¼ÂâÂÂ
Try it here!
add a comment |Â
up vote
0
down vote
R, 47+61=108 bytes
Once again stolen from @DigEmAll's nice answer previously, just compress to gzip and decompress in a 2 part answer.
cat(memDecompress(readBin('a','raw',61),'g',T))
Try it online!
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
JavaScript (ES8), 115 112 bytes
Saved 3 bytes thanks to @ovs
_=>`4.-""-.
1.-"6"-.
|06"-.
|603"-.
|060\
|606|
|660|
1066|
706|
670|`.replace(/d/g,n=>''.padEnd(n)||'""--..')
Try it online!
112 bytes
â ovs
38 mins ago
add a comment |Â
up vote
1
down vote
JavaScript (ES8), 115 112 bytes
Saved 3 bytes thanks to @ovs
_=>`4.-""-.
1.-"6"-.
|06"-.
|603"-.
|060\
|606|
|660|
1066|
706|
670|`.replace(/d/g,n=>''.padEnd(n)||'""--..')
Try it online!
112 bytes
â ovs
38 mins ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
JavaScript (ES8), 115 112 bytes
Saved 3 bytes thanks to @ovs
_=>`4.-""-.
1.-"6"-.
|06"-.
|603"-.
|060\
|606|
|660|
1066|
706|
670|`.replace(/d/g,n=>''.padEnd(n)||'""--..')
Try it online!
JavaScript (ES8), 115 112 bytes
Saved 3 bytes thanks to @ovs
_=>`4.-""-.
1.-"6"-.
|06"-.
|603"-.
|060\
|606|
|660|
1066|
706|
670|`.replace(/d/g,n=>''.padEnd(n)||'""--..')
Try it online!
edited 25 mins ago
answered 1 hour ago
Arnauld
66.8k584281
66.8k584281
112 bytes
â ovs
38 mins ago
add a comment |Â
112 bytes
â ovs
38 mins ago
112 bytes
â ovs
38 mins ago
112 bytes
â ovs
38 mins ago
add a comment |Â
up vote
1
down vote
Charcoal, 40 bytes
FóëâÂÂFù⸿âÂÂFóö""--..ÃȉÂÂâµâÂÂFâ´âÂÂö.-"FòëâÂÂ"-.âÂÂÃȉÂÂâµ
Try it online! Link is to verbose version of code. Explanation:
Fóë
Loop over the three horizontal lines.
âÂÂFù⸿âÂÂ
The lines overlap by an amount depending on which line we're on. This calculates the correct amount of overlap but also moves the cursor to the left of the canvas again.
Fóö""--..û
Repeat three times, move the cursor down one line and then print a third of the horizontal line.
âÂÂâµâÂÂ
Print the vertical line on the right and the backslash on the corner.
Fâ´âÂÂö.-"
Repeat four times, move the cursor up one line and then print a quarter of the diagonal.
FòëâÂÂ"-.âÂÂû
Print the other diagonal. (I couldn't find a way of combining the printing with the movement but this is still 2 bytes shorter than the next best way I could find.)
âÂÂâµ
Print the vertical line on the left.
add a comment |Â
up vote
1
down vote
Charcoal, 40 bytes
FóëâÂÂFù⸿âÂÂFóö""--..ÃȉÂÂâµâÂÂFâ´âÂÂö.-"FòëâÂÂ"-.âÂÂÃȉÂÂâµ
Try it online! Link is to verbose version of code. Explanation:
Fóë
Loop over the three horizontal lines.
âÂÂFù⸿âÂÂ
The lines overlap by an amount depending on which line we're on. This calculates the correct amount of overlap but also moves the cursor to the left of the canvas again.
Fóö""--..û
Repeat three times, move the cursor down one line and then print a third of the horizontal line.
âÂÂâµâÂÂ
Print the vertical line on the right and the backslash on the corner.
Fâ´âÂÂö.-"
Repeat four times, move the cursor up one line and then print a quarter of the diagonal.
FòëâÂÂ"-.âÂÂû
Print the other diagonal. (I couldn't find a way of combining the printing with the movement but this is still 2 bytes shorter than the next best way I could find.)
âÂÂâµ
Print the vertical line on the left.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Charcoal, 40 bytes
FóëâÂÂFù⸿âÂÂFóö""--..ÃȉÂÂâµâÂÂFâ´âÂÂö.-"FòëâÂÂ"-.âÂÂÃȉÂÂâµ
Try it online! Link is to verbose version of code. Explanation:
Fóë
Loop over the three horizontal lines.
âÂÂFù⸿âÂÂ
The lines overlap by an amount depending on which line we're on. This calculates the correct amount of overlap but also moves the cursor to the left of the canvas again.
Fóö""--..û
Repeat three times, move the cursor down one line and then print a third of the horizontal line.
âÂÂâµâÂÂ
Print the vertical line on the right and the backslash on the corner.
Fâ´âÂÂö.-"
Repeat four times, move the cursor up one line and then print a quarter of the diagonal.
FòëâÂÂ"-.âÂÂû
Print the other diagonal. (I couldn't find a way of combining the printing with the movement but this is still 2 bytes shorter than the next best way I could find.)
âÂÂâµ
Print the vertical line on the left.
Charcoal, 40 bytes
FóëâÂÂFù⸿âÂÂFóö""--..ÃȉÂÂâµâÂÂFâ´âÂÂö.-"FòëâÂÂ"-.âÂÂÃȉÂÂâµ
Try it online! Link is to verbose version of code. Explanation:
Fóë
Loop over the three horizontal lines.
âÂÂFù⸿âÂÂ
The lines overlap by an amount depending on which line we're on. This calculates the correct amount of overlap but also moves the cursor to the left of the canvas again.
Fóö""--..û
Repeat three times, move the cursor down one line and then print a third of the horizontal line.
âÂÂâµâÂÂ
Print the vertical line on the right and the backslash on the corner.
Fâ´âÂÂö.-"
Repeat four times, move the cursor up one line and then print a quarter of the diagonal.
FòëâÂÂ"-.âÂÂû
Print the other diagonal. (I couldn't find a way of combining the printing with the movement but this is still 2 bytes shorter than the next best way I could find.)
âÂÂâµ
Print the vertical line on the left.
answered 22 mins ago
Neil
76.9k744173
76.9k744173
add a comment |Â
add a comment |Â
up vote
1
down vote
Canvas, 77 65 58 54 44 43 42 40 bytes
"-.ï¼Â\\\
ï¼Ââ¸ñï¼Ââ¸ï¼Âï¼Ââ¸ï¼Âï¼Âï¼ÂâÂÂâÂÂï¼Âï¼ÂâÂÂï¼Â|ï¼Âï¼ÂâÂÂÃÂâÂÂâÂÂAëï¼ÂâÂÂï¼Âï¼ÂâÂÂ
Try it here!
add a comment |Â
up vote
1
down vote
Canvas, 77 65 58 54 44 43 42 40 bytes
"-.ï¼Â\\\
ï¼Ââ¸ñï¼Ââ¸ï¼Âï¼Ââ¸ï¼Âï¼Âï¼ÂâÂÂâÂÂï¼Âï¼ÂâÂÂï¼Â|ï¼Âï¼ÂâÂÂÃÂâÂÂâÂÂAëï¼ÂâÂÂï¼Âï¼ÂâÂÂ
Try it here!
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Canvas, 77 65 58 54 44 43 42 40 bytes
"-.ï¼Â\\\
ï¼Ââ¸ñï¼Ââ¸ï¼Âï¼Ââ¸ï¼Âï¼Âï¼ÂâÂÂâÂÂï¼Âï¼ÂâÂÂï¼Â|ï¼Âï¼ÂâÂÂÃÂâÂÂâÂÂAëï¼ÂâÂÂï¼Âï¼ÂâÂÂ
Try it here!
Canvas, 77 65 58 54 44 43 42 40 bytes
"-.ï¼Â\\\
ï¼Ââ¸ñï¼Ââ¸ï¼Âï¼Ââ¸ï¼Âï¼Âï¼ÂâÂÂâÂÂï¼Âï¼ÂâÂÂï¼Â|ï¼Âï¼ÂâÂÂÃÂâÂÂâÂÂAëï¼ÂâÂÂï¼Âï¼ÂâÂÂ
Try it here!
edited 6 mins ago
answered 2 hours ago
dzaima
13.4k21652
13.4k21652
add a comment |Â
add a comment |Â
up vote
0
down vote
R, 47+61=108 bytes
Once again stolen from @DigEmAll's nice answer previously, just compress to gzip and decompress in a 2 part answer.
cat(memDecompress(readBin('a','raw',61),'g',T))
Try it online!
add a comment |Â
up vote
0
down vote
R, 47+61=108 bytes
Once again stolen from @DigEmAll's nice answer previously, just compress to gzip and decompress in a 2 part answer.
cat(memDecompress(readBin('a','raw',61),'g',T))
Try it online!
add a comment |Â
up vote
0
down vote
up vote
0
down vote
R, 47+61=108 bytes
Once again stolen from @DigEmAll's nice answer previously, just compress to gzip and decompress in a 2 part answer.
cat(memDecompress(readBin('a','raw',61),'g',T))
Try it online!
R, 47+61=108 bytes
Once again stolen from @DigEmAll's nice answer previously, just compress to gzip and decompress in a 2 part answer.
cat(memDecompress(readBin('a','raw',61),'g',T))
Try it online!
answered 11 mins ago
J.Doe
1,741112
1,741112
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%2f174709%2fbake-me-a-slice-of-cake%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
@Arnauld Hah, no, that was a mistake on my part when copy-pasting. Let me fix that.
â AdmBorkBork
2 hours ago