Encode the date in Christmas Eve format
The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve.
Your job is to take the date the program is run and encode it in Christmas Eve format.
- If your program is run on Christmas, it should output the string "Christmas".
- If your program is not run on Christmas, it should output the string "Christmas", followed by the string " Eve" repeated
n
times, wheren
is the number of days until Christmas.
- Note that this must be based on the next Christmas. For example, if the day is April 26, 2019, you must do your calculation based on December 25, 2019, not any other Christmas.
- Remember to count leap days.
- Christmas is December 25th of every year.
This is code-golf, so the shortest code wins! Note though that the goal is not to find the shortest program in any language, but to find the shortest program in every particular language. For example, if you find the shortest C++ program, then it wins this contest for C++, even if someone finds a shorter program in Python.
code-golf string date
|
show 5 more comments
The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve.
Your job is to take the date the program is run and encode it in Christmas Eve format.
- If your program is run on Christmas, it should output the string "Christmas".
- If your program is not run on Christmas, it should output the string "Christmas", followed by the string " Eve" repeated
n
times, wheren
is the number of days until Christmas.
- Note that this must be based on the next Christmas. For example, if the day is April 26, 2019, you must do your calculation based on December 25, 2019, not any other Christmas.
- Remember to count leap days.
- Christmas is December 25th of every year.
This is code-golf, so the shortest code wins! Note though that the goal is not to find the shortest program in any language, but to find the shortest program in every particular language. For example, if you find the shortest C++ program, then it wins this contest for C++, even if someone finds a shorter program in Python.
code-golf string date
Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
– Black Owl Kai
4 hours ago
@BlackOwlKai what cartoon?
– PyRulez
4 hours ago
3
A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
– Black Owl Kai
4 hours ago
@BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
– PyRulez
4 hours ago
You should specify that you mean Dec 25 for "Christmas", unless you want submissions that use a local date or calendar.
– Sparr
3 hours ago
|
show 5 more comments
The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve.
Your job is to take the date the program is run and encode it in Christmas Eve format.
- If your program is run on Christmas, it should output the string "Christmas".
- If your program is not run on Christmas, it should output the string "Christmas", followed by the string " Eve" repeated
n
times, wheren
is the number of days until Christmas.
- Note that this must be based on the next Christmas. For example, if the day is April 26, 2019, you must do your calculation based on December 25, 2019, not any other Christmas.
- Remember to count leap days.
- Christmas is December 25th of every year.
This is code-golf, so the shortest code wins! Note though that the goal is not to find the shortest program in any language, but to find the shortest program in every particular language. For example, if you find the shortest C++ program, then it wins this contest for C++, even if someone finds a shorter program in Python.
code-golf string date
The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be
Christmas Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve Eve.
Your job is to take the date the program is run and encode it in Christmas Eve format.
- If your program is run on Christmas, it should output the string "Christmas".
- If your program is not run on Christmas, it should output the string "Christmas", followed by the string " Eve" repeated
n
times, wheren
is the number of days until Christmas.
- Note that this must be based on the next Christmas. For example, if the day is April 26, 2019, you must do your calculation based on December 25, 2019, not any other Christmas.
- Remember to count leap days.
- Christmas is December 25th of every year.
This is code-golf, so the shortest code wins! Note though that the goal is not to find the shortest program in any language, but to find the shortest program in every particular language. For example, if you find the shortest C++ program, then it wins this contest for C++, even if someone finds a shorter program in Python.
code-golf string date
code-golf string date
edited 1 hour ago
asked 5 hours ago
PyRulez
3,35742054
3,35742054
Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
– Black Owl Kai
4 hours ago
@BlackOwlKai what cartoon?
– PyRulez
4 hours ago
3
A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
– Black Owl Kai
4 hours ago
@BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
– PyRulez
4 hours ago
You should specify that you mean Dec 25 for "Christmas", unless you want submissions that use a local date or calendar.
– Sparr
3 hours ago
|
show 5 more comments
Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
– Black Owl Kai
4 hours ago
@BlackOwlKai what cartoon?
– PyRulez
4 hours ago
3
A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
– Black Owl Kai
4 hours ago
@BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
– PyRulez
4 hours ago
You should specify that you mean Dec 25 for "Christmas", unless you want submissions that use a local date or calendar.
– Sparr
3 hours ago
Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
– Black Owl Kai
4 hours ago
Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
– Black Owl Kai
4 hours ago
@BlackOwlKai what cartoon?
– PyRulez
4 hours ago
@BlackOwlKai what cartoon?
– PyRulez
4 hours ago
3
3
A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
– Black Owl Kai
4 hours ago
A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
– Black Owl Kai
4 hours ago
@BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
– PyRulez
4 hours ago
@BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
– PyRulez
4 hours ago
You should specify that you mean Dec 25 for "Christmas", unless you want submissions that use a local date or calendar.
– Sparr
3 hours ago
You should specify that you mean Dec 25 for "Christmas", unless you want submissions that use a local date or calendar.
– Sparr
3 hours ago
|
show 5 more comments
2 Answers
2
active
oldest
votes
R, 112 106 bytes
function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))
Try it online!
Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.
Pick the non-negative one and cat
"Christmas" with that many "Eves".
You only usey
once so you can just use it directly for 108 bytes.
– Giuseppe
2 hours ago
Also wouldz[z>=0][1]
work instead ofmin
?
– Giuseppe
2 hours ago
add a comment |
Perl 6, 61 bytes
say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})
Try it online!
Date.today ...^ { .month == 12 && .day == 25 }
is the sequence of dates starting at today and ending the day before Christmas. The string " Eve"
is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas"
.
add a comment |
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',
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/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
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f178003%2fencode-the-date-in-christmas-eve-format%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
R, 112 106 bytes
function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))
Try it online!
Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.
Pick the non-negative one and cat
"Christmas" with that many "Eves".
You only usey
once so you can just use it directly for 108 bytes.
– Giuseppe
2 hours ago
Also wouldz[z>=0][1]
work instead ofmin
?
– Giuseppe
2 hours ago
add a comment |
R, 112 106 bytes
function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))
Try it online!
Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.
Pick the non-negative one and cat
"Christmas" with that many "Eves".
You only usey
once so you can just use it directly for 108 bytes.
– Giuseppe
2 hours ago
Also wouldz[z>=0][1]
work instead ofmin
?
– Giuseppe
2 hours ago
add a comment |
R, 112 106 bytes
function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))
Try it online!
Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.
Pick the non-negative one and cat
"Christmas" with that many "Eves".
R, 112 106 bytes
function(x,z=as.Date(paste0(strtoi(format(x,"%Y"))+0:1,"-12-25"))-x)cat("Christmas",rep("Eve",z[z>=0][1]))
Try it online!
Explanation: everyone's at church so I have time to do this. Extract the year, coerce to integer. Make vector of that year's Xmas and the next year's Xmas and subtract the input date to get a vector of two differences between the input date and those two Xmases.
Pick the non-negative one and cat
"Christmas" with that many "Eves".
edited 2 hours ago
answered 2 hours ago
ngm
3,22924
3,22924
You only usey
once so you can just use it directly for 108 bytes.
– Giuseppe
2 hours ago
Also wouldz[z>=0][1]
work instead ofmin
?
– Giuseppe
2 hours ago
add a comment |
You only usey
once so you can just use it directly for 108 bytes.
– Giuseppe
2 hours ago
Also wouldz[z>=0][1]
work instead ofmin
?
– Giuseppe
2 hours ago
You only use
y
once so you can just use it directly for 108 bytes.– Giuseppe
2 hours ago
You only use
y
once so you can just use it directly for 108 bytes.– Giuseppe
2 hours ago
Also would
z[z>=0][1]
work instead of min
?– Giuseppe
2 hours ago
Also would
z[z>=0][1]
work instead of min
?– Giuseppe
2 hours ago
add a comment |
Perl 6, 61 bytes
say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})
Try it online!
Date.today ...^ { .month == 12 && .day == 25 }
is the sequence of dates starting at today and ending the day before Christmas. The string " Eve"
is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas"
.
add a comment |
Perl 6, 61 bytes
say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})
Try it online!
Date.today ...^ { .month == 12 && .day == 25 }
is the sequence of dates starting at today and ending the day before Christmas. The string " Eve"
is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas"
.
add a comment |
Perl 6, 61 bytes
say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})
Try it online!
Date.today ...^ { .month == 12 && .day == 25 }
is the sequence of dates starting at today and ending the day before Christmas. The string " Eve"
is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas"
.
Perl 6, 61 bytes
say 'Christmas'~' Eve'x(Date.today...^{.month==12&&.day==25})
Try it online!
Date.today ...^ { .month == 12 && .day == 25 }
is the sequence of dates starting at today and ending the day before Christmas. The string " Eve"
is replicated a number of times equal to the length of that sequence, and is output after the string "Christmas"
.
answered 1 hour ago
Sean
3,29636
3,29636
add a comment |
add a comment |
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).
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f178003%2fencode-the-date-in-christmas-eve-format%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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
Somehow I knew that this was going to be a PPCG challenge the moment I saw the cartoon - +1 from me
– Black Owl Kai
4 hours ago
@BlackOwlKai what cartoon?
– PyRulez
4 hours ago
3
A xkcd cartoon that was published today. imgs.xkcd.com/comics/christmas_eve_eve.png
– Black Owl Kai
4 hours ago
@BlackOwlKai LMBO I didn't even see that comic until your comment. I had already planned to post this, and was just waiting for Christmas Eve. Great minds think alike, I guess?
– PyRulez
4 hours ago
You should specify that you mean Dec 25 for "Christmas", unless you want submissions that use a local date or calendar.
– Sparr
3 hours ago