@@ -0,0 +1,2451 @@
+from random import choice, shuffle%0Aimport shlex%0Acaves = %5B%5D%0A%0Aclass room(object):%0A    def __init__(self, name, description):%0A        self.name = name%0A        self.description = description%0A        self.here = %5B%5D%0A        self.tunnels= %5B%5D%0A        caves.append(self)%0A    %0A    def tunnel_to(self, room):%0A        %22%22%22create a two-way tunnel%22%22%22%0A        self.tunnels.append(room)%0A        room.tunnels.append(self)%0A    %0A    def __repr__(self):%0A        return %22%3Croom %22+ self.name + %22%3E%22%0A    %0Adef create_caves():%0A    placeholder = None%0A%0Aclass Player(object):%0A    def __init__(self, location):%0A        self.location = location%0A        self.location.here.append(self)%0A        self.playing = True%0A        %0A    def get_input(self):%0A        return raw_input(%22%3E%22)%0A        %0A    def process_input(self, input):%0A        parts = shlex.split(input)%0A        if len(parts) == 0:%0A            return %5B%5D%0A        if len(parts) == 1:%0A            parts.append(%22%22)%0A        verb = parts%5B0%5D%0A        noun = %22 %22.join(parts%5B1:%5D)%0A        handler = self.find_handler(verb, noun)%0A        if handler is None:%0A            return %5Binput + %22? I don't know how to do that!%22%5D%0A        return handler(self, noun)%0A        %0A    def find_handler(self, verb, noun):%0A        if noun != %22%22:%0A            object = %5Bx for x in self.location.here if y is not self and x.name == noun and verb in x.actions%5D%0A            if len(object) %3E 0:%0A                return getattr(object%5B0%5D, verb)%0A        if verb.lower() in self.actions:%0A            return getattr(self, verb)%0A        elif verb.lower() in self.location.actions:%0A            return getattr(self.location, verb)%0A            %0A    def look(self, player, noun):%0A        return %5Bself.location.name,%0A        self.location.description%5D%0A    %0A    def logout(self, player, noun):%0A        self.playing = False%0A        return %5B%22Your body disappears in a flash of light...when you return, things are not as they once were.%22%5D%0A    %0A    actions = %5B'look', 'logout'%5D%0Adef test():%0A    newb1 = room(%22Welcome to ADVENTURE: World Trigger Edition%22, %22Welcome to ADVENTURE: World Trigger Edition!  In this game, you will become a border agent, using triggers and fighting neighbors.  Type 'north' or 'n' to enter the newbie academy.%22)%0A    player = Player(newb1)%0A    %0A    print player.location.name%0A    print player.location.description%0A    while player.playing:%0A        input = player.get_input()%0A        result = player.process_input(input)%0A        print %22%5Cn%22.join(result)%0Atest()%0A

Create Main.py