Created
December 18, 2017 19:20
-
-
Save classmember/2b89ae539efdc0094160176da25c0849 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
Inspired by https://xkcd.com/1930/ | |
''' | |
from random import randint | |
class CalendarFact: | |
def __init__(self): | |
self.date = ['The Fall Equinox', | |
'The Spring Equinox', | |
'The Winter Solstice', | |
'The Winter Olympics', | |
'The Summer Solstice', | |
'The Summer Olympics', | |
'Daylight Saving Time', | |
'Daylight Savings Time', | |
'Leap Day', | |
'Leap Year', | |
'Easter', | |
'The Harvest Moon', | |
'The Super Moon', | |
'The Blood Moon', | |
'Toyota Truck Month', | |
'Shark Week'] | |
self.issue = ['happens earlier every year', | |
'happens later every year', | |
'happens at the wrong time every year', | |
'drifts out of sync with the Sun', | |
'drifts out of sync with the Moon', | |
'drifts out of sync with the Zodiac', | |
'drifts out of sync with the Gregorian Calendar', | |
'drifts out of sync with the Mayan Calendar', | |
'drifts out of sync with the Lunar Calendar', | |
'drifts out of sync with the iPhone Calendar', | |
'drifts out of sync with Atomic Clock in Colorado', | |
'might not happen this year', | |
'might happen twice this year'] | |
self.because = ['the time zone legislation in India', | |
'the time zone legislation in Arizone', | |
'the time zone legislation in Russia', | |
'a decree by the pope in the 1500s', | |
'precession of the moon', | |
'precession of the sun', | |
'precession of the Earth\'s axis', | |
'precession of the Equator', | |
'precession of the Prime Meridian', | |
'precession of the International Date Line', | |
'precession of the Mason-Dixon Line', | |
'libration of the moon', | |
'libration of the sun', | |
'libration of the Earth\'s axis', | |
'libration of the Equator', | |
'libration of the Prime Meridian', | |
'libration of the International Date Line', | |
'libration of the Mason-Dixon Line', | |
'nutation of the moon', | |
'nutation of the sun', | |
'nutation of the Earth\'s axis', | |
'nutation of the Equator', | |
'nutation of the Prime Meridian', | |
'nutation of the International Date Line', | |
'nutation of the Mason-Dixon Line', | |
'libation of the moon', | |
'libation of the sun', | |
'libation of the Earth\'s axis', | |
'libation of the Equator', | |
'libation of the Prime Meridian', | |
'libation of the International Date Line', | |
'libation of the Mason-Dixon Line', | |
'eccentricity of the moon', | |
'eccentricity of the sun', | |
'eccentricity of the Earth\'s axis', | |
'eccentricity of the Equator', | |
'eccentricity of the Prime Meridian', | |
'eccentricity of the International Date Line', | |
'eccentricity of the Mason-Dixon Line', | |
'obliquity of the moon', | |
'obliquity of the sun', | |
'obliquity of the Earth\'s axis', | |
'obliquity of the Equator', | |
'obliquity of the Prime Meridian', | |
'obliquity of the International Date Line', | |
'obliquity of the Mason-Dixon Line', | |
'magnetic field reversal', | |
'an arbitrary decision by Benjamin Franklin', | |
'an arbitrary decision by Isaac Newton', | |
'an arbitrary decision by FDR'] | |
self.apparently = ['it causes a predictable increase in car accidents', | |
'that\'s why we have leap seconds', | |
'scientists are really worried', | |
'it was even worse during the Bronze Age', | |
'it was even worse during the Ice Age', | |
'it was even worse during the Cretaceous', | |
'it was even worse during the 1990s', | |
'there\'s a proposal to fix it but it will never happen', | |
'there\'s a proposal to fix it but it actuall makes things worse', | |
'there\'s a proposal to fix it but it is stalled in congress', | |
'there\'s a proposal to fix it but it might be unconstitutional', | |
'it\'s getting worse and noone knows why'] | |
def __str__(self): | |
return ('Did you know that ' + | |
self.date[randint(0,len(self.date)-1)] + ' ' + | |
self.issue[randint(0,len(self.issue)-1)] + | |
' because of ' + | |
self.because[randint(0,len(self.because)-1)] + | |
'? Apparently ' + | |
self.apparently[randint(0,len(self.apparently)-1)] + '.') | |
if __name__ == '__main__': | |
print(str(CalendarFact())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment