Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Not too long ver. speedy? solution in Speedy category for Ghosts Age by nakanohito_piyo
def checkio(opacity):
x = \
[[9999, 9999, 1],
[9997, 9997, 2],
[9994, 9995, 3],
[9990, 9992, 5],
[9984, 9988, 8],
[9975, 9982, 13],
[9961, 9973, 21],
[9939, 9959, 34],
[9904, 9937, 55],
[9848, 9902, 89],
[9758, 9846, 144],
[9613, 9756, 233],
[9379, 9611, 377],
[9001, 9377, 610],
[8390, 8999, 987],
[7402, 8388, 1597],
[5804, 7400, 2584],
[3219, 5802, 4181]
]
for i in x:
if i[0] <= opacity <= i[1]:
return i[2] + opacity -i[0]
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio(10000) == 0, "Newborn"
assert checkio(9999) == 1, "1 year"
assert checkio(9997) == 2, "2 years"
assert checkio(9994) == 3, "3 years"
assert checkio(9995) == 4, "4 years"
assert checkio(9990) == 5, "5 years"
Feb. 27, 2014
Comments: