
###############################################
# Interactive Fiction
###############################################

def jackAndJill():
    print('Jack and Jill went up the hill to fetch a pail of water!')
    response = input('Did they get the water? [y]es or [n]o ')
    if (response == 'y'):
        comeDownTheHill()
    else:
        searchForWater()

def comeDownTheHill():
    print('Jack came down and broke his crown!')
    response = input('Is Jill as clumsy as Jack? [y]es or [n]o ')
    if (response == 'y'):
        print('And (sadly) Jill came tumbling after!')
    else:
        print('And Jill stood there, no tumbling, just fine, ho hum, end of story.')

def searchForWater():
    print('Tired and thirsty, Jack and Jill sat on the hill for minutes, hours,...')
    print('Near exhaustion, they searched once more for water...')
    response = input('Did they get the water? [y]es or [n]o ')
    if (response == 'y'):
        print('Whew!!!')
        comeDownTheHill()
    else:
        print('Suddenly, out of the sky, a bottle of Coca Cola falls!  They are saved!')
        comeDownTheHill()

jackAndJill()
