#Riddle 2
from eventAPI import *
from APIUtils import *
from SDLKeys import *

def fireEvent(e):
    if (getTag(e, "DKR") >= 2):
        return 1
    else:
        return next(e)

def next(e):
    showPicture(e, "bw_magicmouthred2")  
    answer = stringInput(e, ["A magic mouth on the wall speaks to you, saying this:", "", "\"What can run but never walks, has a mouth but never talks, has a head but never weeps, has a bed but never sleeps?\""])
    if(answer.lower() == "river"):
        showMessage(e, ["You are now one step closer to the exit."])
        setTag(e, "DKR", 2)
        return 1
    else:
        showMessage(e, ["Wrong. You are not ready to pass."])
        return 0
