Discordian date: Difference between revisions

→‎{{header|D}}: fundamental constants are better exposed globally to improve reusability
(→‎{{header|D}}: fundamental constants are better exposed globally to improve reusability)
Line 501:
<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", "DiscordBureaucracy", "ConfusionThe Aftermath"],
weekday = ["Sweetmorn", "BureaucracyBoomtime", "The AftermathPungenday"],
weekday = ["SweetmornPrickle-Prickle", "Boomtime",Setting Orange"Pungenday"],
apostle = ["Mungday", "Prickle-PrickleMojoday", "Setting OrangeSyaday"],
apostle = ["Mungday", "MojodayZaraday", "SyadayMaladay"],
holiday = ["Chaoflux", "ZaradayDiscoflux", "MaladayConfuflux"],
holiday = ["ChaofluxBureflux", "DiscofluxAfflux", "Confuflux",];
"Bureflux", "Afflux"];
 
string discordianDate(in Date date) /*pure*/ {
immutable dYear = text(date.year + 1166);
 
Anonymous user