Discordian date: Difference between revisions

Content deleted Content added
→‎{{header|D}}: fundamental constants are better exposed globally to improve reusability
Line 501: Line 501:
<lang d>import std.stdio, std.datetime, std.conv, std.string;
<lang d>import std.stdio, std.datetime, std.conv, std.string;


immutable seasons = ["Chaos", "Discord", "Confusion",
string discordianDate(in Date date) /*pure*/ {
static immutable seasons = ["Chaos", "Discord", "Confusion",
"Bureaucracy", "The Aftermath"],
"Bureaucracy", "The Aftermath"],
weekday = ["Sweetmorn", "Boomtime", "Pungenday",
weekday = ["Sweetmorn", "Boomtime", "Pungenday",
"Prickle-Prickle", "Setting Orange"],
"Prickle-Prickle", "Setting Orange"],
apostle = ["Mungday", "Mojoday", "Syaday",
apostle = ["Mungday", "Mojoday", "Syaday",
"Zaraday", "Maladay"],
"Zaraday", "Maladay"],
holiday = ["Chaoflux", "Discoflux", "Confuflux",
holiday = ["Chaoflux", "Discoflux", "Confuflux",
"Bureflux", "Afflux"];
"Bureflux", "Afflux"];


string discordianDate(in Date date) /*pure*/ {
immutable dYear = text(date.year + 1166);
immutable dYear = text(date.year + 1166);