Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Ghosts Age by sebastian.okseniuk
def checkio(opacity):
year = 0
score = 10000
print(fib(10))
i = 0
FibList = []
for i in range(21):
i = fib(i)
FibList.append(i)
print(FibList)
while score != opacity:
if year in FibList:
score = score - year
else:
score= score + 1
year+=1
print(year-1)
return year-1
def fib(n):
if n == 0:
return 0
elif n == 1:
return 1
else:
return fib(n-1) + fib(n-2)
checkio(9999)
'''checkio(9999) #== 1, "1 year"
checkio(9997) #== 2, "2 years"
checkio(9994) #== 3, "3 years"
checkio(9995) #== 4, "4 years"
checkio(9990) #== 5, "5 years"
'''
Dec. 3, 2015