
'''
something will happen after some time
'''

world = {}


def LieInTheNoodle(payload,put,get):
    put(['Eyes open, your back is curved by the cylinder shape of the room.', 
             'Dim light filter from the sepia celling whom is exactly like the floor.'])
    if not 'time' in payload:
        payload['time'] = 0
    elif payload['time'] > 5:
        put(['the floor become like memoryfoam',
             'it mold perfectly your body'])
    cmd = get('Should get up',['up','wait'])
    if 'up' in cmd:
        payload['next'] = 'InTheNoodle'
    else:
        payload['next'] = 'LieInTheNoodle'
    if payload['time'] > 9:
        payload['next'] = 'DieInTheNoodle'
    return payload
world['LieInTheNoodle'] = LieInTheNoodle

def InTheNoodle(payload,put,get):
    put(['Standing in a cyclinder shaped room.',
         'Floor, wall and ceilling are made of the same creme plastic composite.',
         'The tunnel go down both way as if we are on top of a curve.'])
    if payload['time'] > 7:
        put(['then floor and the wall start getting oozey'])
    cmd = get('Can go left or right',['left','right','lie','wait'])
    if 'left' in cmd:
        payload['next'] = 'LeftOfTheNoodle'
    elif 'right' in cmd:
        payload['next'] = 'RightOfTheNoodle'
    elif 'lie' in cmd:
        payload['next'] = 'LieInTheNoodle'
    else:
        payload['next'] = 'InTheNoodle' 
    if payload['time'] > 9:
        payload['next'] = 'DieInTheNoodle'
    return payload
world['InTheNoodle'] = InTheNoodle

def LeftOfTheNoodle(payload,put,get):
    put(['It\'s flooded'])
    if payload['time'] > 6:
        put(['And the water is boiling'])
    cmd = get('can only go back',['back','wait','dive'])
    if 'back' in cmd:
        payload['next'] = 'InTheNoodle'
    elif 'dive' in cmd:
        if payload['time'] > 6:
            put(['the water is to hot and it killed you',
                   'last thing you saw was a bunch of huge noodle boiling'])
            payload['next'] = 'dead'
        else:
            payload['next'] = 'exit'
    else:
        payload['next'] = 'LeftOfTheNoodle'
    if payload['time'] > 9:
        payload['next'] = 'DieInTheNoodle'
    return payload
world['LeftOfTheNoodle'] = LeftOfTheNoodle


def RightOfTheNoodle(payload,put,get):
    put(['The tunnel go down in the%s water'% ' boiling' if payload['time'] > 6 else ''])
    cmd = get('can go no where but back',['back','wait','dive'])
    if 'back' in cmd:
        payload['next'] = 'InTheNoodle'
    elif 'dive' in cmd:
        if payload['time'] > 6:
            put(['Because the water was boiling, you boiled with it',
                   'You had the time to withness that you were inside a gigantic noodle'])
            payload['next'] = 'dead'
        else:
            payload['next'] = 'exit'
    else:
        payload['next'] = 'RightOfTheNoodle'
    if payload['time'] > 9:
        payload['next'] = 'DieInTheNoodle'
    return payload
world['RightOfTheNoodle'] = RightOfTheNoodle

def DieInTheNoodle(payload,put,get):
    put(['wall sweated boilling water on you, boiling you to death',
         'The most horrifying part is that the skin will fall apart before you drown.'])
    payload['next'] = 'dead'
    return payload

world['DieInTheNoodle'] = DieInTheNoodle

begin = 'LieInTheNoodle'
end = 'exitNoodle'

if __name__ == '__main__':
    pass
