Discordian date: Difference between revisions

m
→‎{{header|Ruby}}: different output method that does not require the explicit to_s call
(→‎{{header|C}}: added link)
m (→‎{{header|Ruby}}: different output method that does not require the explicit to_s call)
Line 1,121:
<lang ruby>[[2012, 2, 28], [2012, 2, 29], [2012, 3, 1], [2011, 10, 5]].each do |date|
dd = DiscordianDate.new(*date)
pputs ["#{"%4d-%02d-%02d" % date,} => #{dd.to_s]}"
end</lang>
Outputs:
<pre>["2012-02-28", "=> Prickle-Prickle, Chaos 59, 3178 YOLD"]
["2012-02-29", "=> St. Tib's Day, 3178 YOLD"]
["2012-03-01", "=> Setting Orange, Chaos 60, 3178 YOLD"]
["2011-10-05", "=> Pungenday, Bureaucracy 59, 3177 YOLD"]</pre>
 
=={{header|Scala}}==
Anonymous user