Output the date in the Mel calendarValiDate ISO 8601 by RXResolving the Date Format DisputeRollover CalendarForgotten Realms date calculatorRoman-style date formattingFriday the 13thBeat Pure Regular Expressions at Validating ISO 8601 DatesThe Last MondayWhat's the Date?Date Occurrences
Is there an idiom that means "revealing a secret unintentionally"?
Was the Highlands Ranch shooting the 115th mass shooting in the US in 2019
How to find the transfer orbit from a initial circular orbit to a final elliptical orbit
Why is there a cap on 401k contributions?
Gift for mentor after his thesis defense?
Does a surprised creature obey the 1st level spell Command?
Why use steam instead of just hot air?
Can I use a 11-23 11-speed shimano cassette with the RD-R8000 11-speed Ultegra Shadow Rear Derailleur (short cage)?
Is it a good idea to copy a trader when investing?
What dice to use in a game that revolves around triangles?
Why is it wrong to *implement* myself a known, published, widely believed to be secure crypto algorithm?
How to get MAX value using SOQL when there are more than 50,000 rows
Was Mohammed the most popular first name for boys born in Berlin in 2018?
How can it be that ssh somename works, while nslookup somename does not?
Which spells are in some way related to shadows or the Shadowfell?
Why does the electron wavefunction not collapse within atoms at room temperature in gas, liquids or solids due to decoherence?
What does the "DS" in "DS-..." US visa application forms stand for?
Rusty Chain and back cassette – Replace or Repair?
Double underlining a result in a system of equations with calculation steps on the right side
When do you stop "pushing" a book?
Does Thread.yield() do anything if we have enough processors to service all threads?
Do Monks gain the 9th level Unarmored Movement benefit when wearing armor or using a shield?
My perfect evil overlord plan... or is it?
TeX Gyre Pagella Math Integral sign much too small
Output the date in the Mel calendar
ValiDate ISO 8601 by RXResolving the Date Format DisputeRollover CalendarForgotten Realms date calculatorRoman-style date formattingFriday the 13thBeat Pure Regular Expressions at Validating ISO 8601 DatesThe Last MondayWhat's the Date?Date Occurrences
$begingroup$
The Mel calendar is used in the fictional world of Kaldia. Your goal is to convert dates into the Mel calendar.
This calendar has 13 months of 28 days each, plus 1 or 2 extra days after the last month. A year that is divisible by 4 but not by 100, or divisible by 400 has 366 days, and other years have 365 (i.e. our leap year rules, but with years in the Mel calendar).
You should use the month and day name abbreviations:
months: dia vio lis gil ful dyu mel ral zan pal mik fav ruj
days: dia vio lis gil ful dyu mel ral zan pal mik fav ruj ser rav tan lin rez jil din ket len lax nen pin mat kun mir
The extra days outside of any month have the month name of myuxet
(no abbreviation here), and the day names are axet
and teems
, respectively.
0 dia dia
is 1988/11/30.
You can take the input date as a string or a (year, month, day) tuple; alternatively, for functions, the parameter can be in your standard library's date type. The output should be a space-separated string.
Test cases
1776-07-04 => -213 ral ket
1859-12-15 => -129 dia rav
1917-04-14 => -72 ful nen
1981-02-04 => -8 lis mik
1988-11-30 => 0 dia dia
1988-12-01 => 0 dia vio
1988-12-28 => 0 vio dia
2017-01-01 => 28 vio ful
2019-04-22 => 30 dyu lis
2019-11-30 => 30 myuxet axet
2019-12-01 => 31 dia dia
2021-11-29 => 32 myuxet axet
2021-11-30 => 32 myuxet teems
2089-11-30 => 101 dia dia
2389-11-30 => 400 myuxet teems
Reference implementation in Perl 6
Standard loopholes are forbidden.
code-golf date
$endgroup$
add a comment |
$begingroup$
The Mel calendar is used in the fictional world of Kaldia. Your goal is to convert dates into the Mel calendar.
This calendar has 13 months of 28 days each, plus 1 or 2 extra days after the last month. A year that is divisible by 4 but not by 100, or divisible by 400 has 366 days, and other years have 365 (i.e. our leap year rules, but with years in the Mel calendar).
You should use the month and day name abbreviations:
months: dia vio lis gil ful dyu mel ral zan pal mik fav ruj
days: dia vio lis gil ful dyu mel ral zan pal mik fav ruj ser rav tan lin rez jil din ket len lax nen pin mat kun mir
The extra days outside of any month have the month name of myuxet
(no abbreviation here), and the day names are axet
and teems
, respectively.
0 dia dia
is 1988/11/30.
You can take the input date as a string or a (year, month, day) tuple; alternatively, for functions, the parameter can be in your standard library's date type. The output should be a space-separated string.
Test cases
1776-07-04 => -213 ral ket
1859-12-15 => -129 dia rav
1917-04-14 => -72 ful nen
1981-02-04 => -8 lis mik
1988-11-30 => 0 dia dia
1988-12-01 => 0 dia vio
1988-12-28 => 0 vio dia
2017-01-01 => 28 vio ful
2019-04-22 => 30 dyu lis
2019-11-30 => 30 myuxet axet
2019-12-01 => 31 dia dia
2021-11-29 => 32 myuxet axet
2021-11-30 => 32 myuxet teems
2089-11-30 => 101 dia dia
2389-11-30 => 400 myuxet teems
Reference implementation in Perl 6
Standard loopholes are forbidden.
code-golf date
$endgroup$
3
$begingroup$
You should probably include in your post thataxet
andteems
are at the end of the year, I was confused until I looked at the link
$endgroup$
– Embodiment of Ignorance
47 mins ago
$begingroup$
It has to be a space-separated string.
$endgroup$
– bb94
14 mins ago
$begingroup$
Can we take input as a three value named tuple or a list of three values each signifying year, month, and day?
$endgroup$
– Embodiment of Ignorance
10 mins ago
$begingroup$
Yes, that's fine.
$endgroup$
– bb94
9 mins ago
add a comment |
$begingroup$
The Mel calendar is used in the fictional world of Kaldia. Your goal is to convert dates into the Mel calendar.
This calendar has 13 months of 28 days each, plus 1 or 2 extra days after the last month. A year that is divisible by 4 but not by 100, or divisible by 400 has 366 days, and other years have 365 (i.e. our leap year rules, but with years in the Mel calendar).
You should use the month and day name abbreviations:
months: dia vio lis gil ful dyu mel ral zan pal mik fav ruj
days: dia vio lis gil ful dyu mel ral zan pal mik fav ruj ser rav tan lin rez jil din ket len lax nen pin mat kun mir
The extra days outside of any month have the month name of myuxet
(no abbreviation here), and the day names are axet
and teems
, respectively.
0 dia dia
is 1988/11/30.
You can take the input date as a string or a (year, month, day) tuple; alternatively, for functions, the parameter can be in your standard library's date type. The output should be a space-separated string.
Test cases
1776-07-04 => -213 ral ket
1859-12-15 => -129 dia rav
1917-04-14 => -72 ful nen
1981-02-04 => -8 lis mik
1988-11-30 => 0 dia dia
1988-12-01 => 0 dia vio
1988-12-28 => 0 vio dia
2017-01-01 => 28 vio ful
2019-04-22 => 30 dyu lis
2019-11-30 => 30 myuxet axet
2019-12-01 => 31 dia dia
2021-11-29 => 32 myuxet axet
2021-11-30 => 32 myuxet teems
2089-11-30 => 101 dia dia
2389-11-30 => 400 myuxet teems
Reference implementation in Perl 6
Standard loopholes are forbidden.
code-golf date
$endgroup$
The Mel calendar is used in the fictional world of Kaldia. Your goal is to convert dates into the Mel calendar.
This calendar has 13 months of 28 days each, plus 1 or 2 extra days after the last month. A year that is divisible by 4 but not by 100, or divisible by 400 has 366 days, and other years have 365 (i.e. our leap year rules, but with years in the Mel calendar).
You should use the month and day name abbreviations:
months: dia vio lis gil ful dyu mel ral zan pal mik fav ruj
days: dia vio lis gil ful dyu mel ral zan pal mik fav ruj ser rav tan lin rez jil din ket len lax nen pin mat kun mir
The extra days outside of any month have the month name of myuxet
(no abbreviation here), and the day names are axet
and teems
, respectively.
0 dia dia
is 1988/11/30.
You can take the input date as a string or a (year, month, day) tuple; alternatively, for functions, the parameter can be in your standard library's date type. The output should be a space-separated string.
Test cases
1776-07-04 => -213 ral ket
1859-12-15 => -129 dia rav
1917-04-14 => -72 ful nen
1981-02-04 => -8 lis mik
1988-11-30 => 0 dia dia
1988-12-01 => 0 dia vio
1988-12-28 => 0 vio dia
2017-01-01 => 28 vio ful
2019-04-22 => 30 dyu lis
2019-11-30 => 30 myuxet axet
2019-12-01 => 31 dia dia
2021-11-29 => 32 myuxet axet
2021-11-30 => 32 myuxet teems
2089-11-30 => 101 dia dia
2389-11-30 => 400 myuxet teems
Reference implementation in Perl 6
Standard loopholes are forbidden.
code-golf date
code-golf date
edited 8 mins ago
bb94
asked 2 hours ago
bb94bb94
1,307714
1,307714
3
$begingroup$
You should probably include in your post thataxet
andteems
are at the end of the year, I was confused until I looked at the link
$endgroup$
– Embodiment of Ignorance
47 mins ago
$begingroup$
It has to be a space-separated string.
$endgroup$
– bb94
14 mins ago
$begingroup$
Can we take input as a three value named tuple or a list of three values each signifying year, month, and day?
$endgroup$
– Embodiment of Ignorance
10 mins ago
$begingroup$
Yes, that's fine.
$endgroup$
– bb94
9 mins ago
add a comment |
3
$begingroup$
You should probably include in your post thataxet
andteems
are at the end of the year, I was confused until I looked at the link
$endgroup$
– Embodiment of Ignorance
47 mins ago
$begingroup$
It has to be a space-separated string.
$endgroup$
– bb94
14 mins ago
$begingroup$
Can we take input as a three value named tuple or a list of three values each signifying year, month, and day?
$endgroup$
– Embodiment of Ignorance
10 mins ago
$begingroup$
Yes, that's fine.
$endgroup$
– bb94
9 mins ago
3
3
$begingroup$
You should probably include in your post that
axet
and teems
are at the end of the year, I was confused until I looked at the link$endgroup$
– Embodiment of Ignorance
47 mins ago
$begingroup$
You should probably include in your post that
axet
and teems
are at the end of the year, I was confused until I looked at the link$endgroup$
– Embodiment of Ignorance
47 mins ago
$begingroup$
It has to be a space-separated string.
$endgroup$
– bb94
14 mins ago
$begingroup$
It has to be a space-separated string.
$endgroup$
– bb94
14 mins ago
$begingroup$
Can we take input as a three value named tuple or a list of three values each signifying year, month, and day?
$endgroup$
– Embodiment of Ignorance
10 mins ago
$begingroup$
Can we take input as a three value named tuple or a list of three values each signifying year, month, and day?
$endgroup$
– Embodiment of Ignorance
10 mins ago
$begingroup$
Yes, that's fine.
$endgroup$
– bb94
9 mins ago
$begingroup$
Yes, that's fine.
$endgroup$
– bb94
9 mins ago
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Ruby, 199 bytes
Oof, only 23 bytes saved over the sample Perl code... I blame the fact that I have to subtract a bigger number due to using a Time
class instead of what I assume is a Date
class in Perl. (AFAIK importing Ruby's Date
class is 2 bytes longer)
->dd-=62764070400;y=d.yday;m=y/28;s="diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".scan /.../;[d.year,m<13?s[m]:"myuxet",(m<13?s:%w[axet teems])[y%28-1]]*' '
Try it online!
$endgroup$
add a comment |
$begingroup$
Perl 6, 174 bytes
[X]("diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".comb(3)xx 2)[^364],o*-726436
Try it online!
Generate a list of all the valid dates and then indexes the day of the year into that list.
$endgroup$
add a comment |
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/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%2f185339%2foutput-the-date-in-the-mel-calendar%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
$begingroup$
Ruby, 199 bytes
Oof, only 23 bytes saved over the sample Perl code... I blame the fact that I have to subtract a bigger number due to using a Time
class instead of what I assume is a Date
class in Perl. (AFAIK importing Ruby's Date
class is 2 bytes longer)
->dd-=62764070400;y=d.yday;m=y/28;s="diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".scan /.../;[d.year,m<13?s[m]:"myuxet",(m<13?s:%w[axet teems])[y%28-1]]*' '
Try it online!
$endgroup$
add a comment |
$begingroup$
Ruby, 199 bytes
Oof, only 23 bytes saved over the sample Perl code... I blame the fact that I have to subtract a bigger number due to using a Time
class instead of what I assume is a Date
class in Perl. (AFAIK importing Ruby's Date
class is 2 bytes longer)
->dd-=62764070400;y=d.yday;m=y/28;s="diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".scan /.../;[d.year,m<13?s[m]:"myuxet",(m<13?s:%w[axet teems])[y%28-1]]*' '
Try it online!
$endgroup$
add a comment |
$begingroup$
Ruby, 199 bytes
Oof, only 23 bytes saved over the sample Perl code... I blame the fact that I have to subtract a bigger number due to using a Time
class instead of what I assume is a Date
class in Perl. (AFAIK importing Ruby's Date
class is 2 bytes longer)
->dd-=62764070400;y=d.yday;m=y/28;s="diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".scan /.../;[d.year,m<13?s[m]:"myuxet",(m<13?s:%w[axet teems])[y%28-1]]*' '
Try it online!
$endgroup$
Ruby, 199 bytes
Oof, only 23 bytes saved over the sample Perl code... I blame the fact that I have to subtract a bigger number due to using a Time
class instead of what I assume is a Date
class in Perl. (AFAIK importing Ruby's Date
class is 2 bytes longer)
->dd-=62764070400;y=d.yday;m=y/28;s="diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".scan /.../;[d.year,m<13?s[m]:"myuxet",(m<13?s:%w[axet teems])[y%28-1]]*' '
Try it online!
answered 57 mins ago
Value InkValue Ink
7,895731
7,895731
add a comment |
add a comment |
$begingroup$
Perl 6, 174 bytes
[X]("diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".comb(3)xx 2)[^364],o*-726436
Try it online!
Generate a list of all the valid dates and then indexes the day of the year into that list.
$endgroup$
add a comment |
$begingroup$
Perl 6, 174 bytes
[X]("diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".comb(3)xx 2)[^364],o*-726436
Try it online!
Generate a list of all the valid dates and then indexes the day of the year into that list.
$endgroup$
add a comment |
$begingroup$
Perl 6, 174 bytes
[X]("diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".comb(3)xx 2)[^364],o*-726436
Try it online!
Generate a list of all the valid dates and then indexes the day of the year into that list.
$endgroup$
Perl 6, 174 bytes
[X]("diaviolisgilfuldyumelralzanpalmikfavrujserravtanlinrezjildinketlenlaxnenpinmatkunmir".comb(3)xx 2)[^364],o*-726436
Try it online!
Generate a list of all the valid dates and then indexes the day of the year into that list.
edited 13 mins ago
answered 21 mins ago
Jo KingJo King
28k366134
28k366134
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).
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%2f185339%2foutput-the-date-in-the-mel-calendar%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
3
$begingroup$
You should probably include in your post that
axet
andteems
are at the end of the year, I was confused until I looked at the link$endgroup$
– Embodiment of Ignorance
47 mins ago
$begingroup$
It has to be a space-separated string.
$endgroup$
– bb94
14 mins ago
$begingroup$
Can we take input as a three value named tuple or a list of three values each signifying year, month, and day?
$endgroup$
– Embodiment of Ignorance
10 mins ago
$begingroup$
Yes, that's fine.
$endgroup$
– bb94
9 mins ago