Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
We rehearsed all year! solution in Creative category for Ghosts Age by Leonix
def checkio(fear_level):
""" Okay guys, prepare for the performance of your life.
This is halloween. Make them regret coming to the wrong neighborhood! """
for frightening in we_rehearsed_all_year():
if fear_level < OVER_NINE_THOUSAND:
# scare the hell out of them!
fear_level += frightening + 1
else:
# enough for them poor souls, let's have mercy after all
return frightening + fear_level - LAUGH_AND_GIVE_THEM_CANDY
def we_rehearsed_all_year():
scary_boo, swing_arms = PREPARE_THE_STAGE
yield PRETEND_WE_ARE_HARMLESS
while "they don't suspect anything":
yield scary_boo
swing_arms, scary_boo = scary_boo + swing_arms, swing_arms
# Keep our stage props ready at all times!
PRETEND_WE_ARE_HARMLESS = 0
PREPARE_THE_STAGE = 1, 2
OVER_NINE_THOUSAND = 10000
LAUGH_AND_GIVE_THEM_CANDY = 10000
Aug. 5, 2015
Comments: