Discordian date: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (add Refal) |
|||
Line 4,472: | Line 4,472: | ||
2012-03-01 is Setting Orange, the 60th day of Chaos in the YOLD 3178 |
2012-03-01 is Setting Orange, the 60th day of Chaos in the YOLD 3178 |
||
</pre> |
</pre> |
||
=={{header|Refal}}== |
|||
<syntaxhighlight lang="refal">$ENTRY Go { |
|||
, <Numb <Arg 1>>: s.GY |
|||
, <Numb <Arg 2>>: s.GM |
|||
, <Numb <Arg 3>>: s.GD |
|||
, <DisDate s.GY s.GM s.GD>: { |
|||
True e.Desc = <Prout e.Desc>; |
|||
False = <Prout 'Invalid input'>; |
|||
}; |
|||
}; |
|||
DisDate { |
|||
s.GY 2 29, <IsLeapYear s.GY>: True = |
|||
True 'St. Tib\'s day in the YOLD ' <Symb <+ 1166 s.GY>>; |
|||
s.GY s.GM s.GD, <Compare s.GM 1>: '-' = False; |
|||
s.GY s.GM s.GD, <Compare s.GM 12>: '+' = False; |
|||
s.GY s.GM s.GD, <Compare s.GD 1>: '-' = False; |
|||
s.GY s.GM s.GD, <Compare s.GD <Item s.GM <MonthLength>>>: '+' = False; |
|||
s.GY s.GM s.GD, |
|||
<+ <Item s.GM <MonthOffset>> s.GD>: s.DOY, |
|||
<Divmod <- s.DOY 1> 73>: (s.DS1) s.DD1, |
|||
<+ s.DS1 1>: s.DS, |
|||
<+ s.DD1 1>: s.DD, |
|||
<+ <Mod <- s.DOY 1> 5> 1>: s.DWD, |
|||
<Item s.DWD <Weekday>>: (e.Weekday), |
|||
<Item s.DS <Seasons>>: (e.Season), |
|||
e.Weekday ', day ' <Symb s.DD> ' of ' |
|||
e.Season ' in the YOLD ' <Symb <+ 1166 s.GY>>: e.Desc, |
|||
s.DD: { |
|||
5, <Item s.DS <Holy5>>: (e.H) = True e.Desc ': celebrate ' e.H; |
|||
50, <Item s.DS <Holy50>>: (e.H) = True e.Desc ': celebrate ' e.H; |
|||
s.X = True e.Desc; |
|||
}; |
|||
}; |
|||
Item { |
|||
1 t.I e.X = t.I; |
|||
s.N t.I e.X = <Item <- s.N 1> e.X>; |
|||
}; |
|||
IsLeapYear { |
|||
s.GY, <Mod s.GY 4>: 0 = True; |
|||
s.GY, <Mod s.GY 100>: 0 = False; |
|||
s.GY, <Mod s.GY 400>: 0 = True; |
|||
s.GY = False; |
|||
}; |
|||
MonthOffset { = 0 31 59 90 120 151 181 212 243 273 304 334; }; |
|||
MonthLength { = 31 28 31 30 31 30 31 31 30 31 30 31; }; |
|||
Weekday { = ('Sweetmorn') ('Boomtime') ('Pungenday') |
|||
('Prickle-Prickle') ('Setting Orange'); }; |
|||
Seasons { = ('Chaos') ('Discord') ('Confusion') ('Bureaucracy') |
|||
('The Aftermath'); }; |
|||
Holy5 { = ('Mungday') ('Mojoday') ('Syaday') ('Zaraday') ('Maladay'); }; |
|||
Holy50 { = ('Chaoflux') ('Discoflux') ('Confuflux') |
|||
('Bureflux') ('Afflux'); };</syntaxhighlight> |
|||
{{out}} |
|||
<pre>$ refgo ddate 2010 7 22 |
|||
Pungenday, day 57 of Confusion in the YOLD 3176 |
|||
$ refgo ddate 2012 2 28 |
|||
Prickle-Prickle, day 59 of Chaos in the YOLD 3178 |
|||
$ refgo ddate 2012 2 29 |
|||
St. Tib's day in the YOLD 3178 |
|||
$ refgo ddate 2012 3 1 |
|||
Setting Orange, day 60 of Chaos in the YOLD 3178 |
|||
$ refgo ddate 2010 1 5 |
|||
Setting Orange, day 5 of Chaos in the YOLD 3176: celebrate Mungday |
|||
$ refgo ddate 2011 5 3 |
|||
Pungenday, day 50 of Discord in the YOLD 3177: celebrate Discoflux</pre> |
|||
=={{header|REXX}}== |
=={{header|REXX}}== |