Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Secret Magic Number solution in Uncategorized category for The Best Number Ever by Juge_Ti
def checkio():
# It is said that, a long long time ago, a powerful Enchanter discovered a
# Magic Number that no woman could resist : when whispered in a girl's
# ear, it would inevitably make her fall deeply in love with you.
# It is also said that Tim (that's the Enchanter's name) had hidden the
# secret of the Holy Number inside an ancient poem carved on the walls of
# a cave guarded by a cruel pointy-toothed creature.
# Armed only with my courage and a bunch of carrots, I have been able to
# penetrate the cave and decipher the poem :
poem = '''One Number to rule them all, One Number to find them,
One Number to bring them all and in the darkness bind them.'''
# Many have tried to solve the mystery of the Secret Magic Number, but in
# vain... till now. I will now reveal to you, CheckIO fellows, the secret
# of the most powerful Number ever.
# First we add the Unicode codepoints of the letters of the poem (being an
# enchanter, Tim knew about Unicode and all that sort of things).
n = sum(map(ord, poem))
# This is (nearly) the year of the Norman conquest of England, so we divide
# it by the length of Bayeux Tapestry, and multiply by 10 to compensate for
# the additional zero.
n /= 68.38
n *= 10
n = round(n)
# Actually Tim created the Secret Magic Holy Number because he had foreseen
# that when he gets older, losing his hair, his wife would not like him
# anymore. He even wrote a song about it, which was later covered by some
# other guys.
# Hence we have to divide by 64.
n //= 64
# Now, as mentioned in the Ancient Books, we shalt count the number three
# times. No more. No less. The number of the counting shall be three.
n *= 5
# (sorry, this is a well-known Python bug)
n //= 5
n *= 3
# And we're done!
return n
# Now just whisper the Holy Secret Magic Number in the ear of the lady
# you wish to conquer, bind her in the darkness, and enjoy!
# Warning : overuse of the Magic Holy Secret Number may lead you to
# uncomfortable situations : www.youtube.com/watch?v=24DWK42u5gE
Oct. 8, 2013
Comments: