
print "You are a mouse trying to escape this maze. Don't run into the walls or you will die. "
print " Try to go as fast as possible to get to the cheese!"
print " You will be timed."



mousex = 3
mousey = 0
move = ""
while move != "s" :
    screen = [  "---  ---------------",
                "---   --------------",
                "----   -------------",
                "-----   ------------",
                "----   -------------",
                "---      -----------",
                "--   --   ----------",
                "-   ----   ---------",
                "  --------    ------",
                "   --------  -  ----",
                "-    ------  --  ---",
                "---    ----  ---  --",
                "---  -   --- ---  --",
                "--  --   ---  -   --",
                "--   -  -----   ----",
                "----   -------------",
                "----  --------------",
                "----&---------------"]
    
    screenx = screen
    line = screenx[mousey]
    line = line[:mousex]+"^"+line[mousex+1:]
    screenx[mousey] = line
    for x in screenx:
        print x
    move = raw_input("Which way do you want your mouse to move? Type 'u' for up, 'd' for down, 'l' for left, 'r' for right, and 's' for stop.")
    if move == "u":
        mousey = mousey-1
    elif move == "d":
        mousey = mousey+1
    elif move == "r":
        mousex = mousex+1
    elif move == "l":
        mousex = mousex-1
    screenx = []
    line = screen[mousey]
    mouse = line[mousex]
    if mouse == "-":
        print "I told you not to run into the walls! Game over!"
        move = "s"
    elif mouse == "&":
        print "Congratulations! You made it to the cheese! You win!"
        move = "s"
