Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Awful story solution in Scary category for Clock Angle by hanpari
from math import degrees as chopped
from math import pi as pieces
of_huge, brutally = int, abs
is_not_rotten = 180
get_rid_of_smelly = 360
completely = 12
into = 60
bloody = 30
#READING FOR GOOD NIGHT
def clock_angle(two_wanderers):
murdered, by_rusty_axe = (of_huge(giant) for giant
in two_wanderers.split(":"))
dead_body = chopped(brutally((by_rusty_axe
-((murdered%completely)+by_rusty_axe/into)*5)/bloody*pieces))
return (dead_body if dead_body <= is_not_rotten
else get_rid_of_smelly-dead_body)
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert clock_angle("02:30") == 105, "02:30"
assert clock_angle("13:42") == 159, "13:42"
assert clock_angle("01:42") == 159, "01:42"
assert clock_angle("01:43") == 153.5, "01:43"
assert clock_angle("00:00") == 0, "Zero"
assert clock_angle("12:01") == 5.5, "Little later"
assert clock_angle("18:00") == 180, "Opposite"
Nov. 8, 2014
Comments: