Skip to content

Instantly share code, notes, and snippets.

@zhammer
Created April 11, 2018 18:29
Show Gist options
  • Save zhammer/8c1a5737333f215ac3338ae8fbe4fa06 to your computer and use it in GitHub Desktop.
Save zhammer/8c1a5737333f215ac3338ae8fbe4fa06 to your computer and use it in GitHub Desktop.
>>> n
THERE IS A THREATENING LITTLE DWARF IN THE ROOM WITH YOU!
ONE SHARP NASTY KNIFE IS THROWN AT YOU!
IT MISSES!
YOU ARE IN A LARGE ROOM, WITH A PASSAGE TO THE SOUTH, A PASSAGE TO THE
WEST, AND A WALL OF BROKEN ROCK TO THE EAST. THERE IS A LARGE "Y2" ON
A ROCK IN THE ROOM'S CENTER.
>>> form pprint import pprint as pp
File "<stdin>", line 1
form pprint import pprint as pp
^
SyntaxError: invalid syntax
>>> frm pprint import pprint as pp
File "<stdin>", line 1
frm pprint import pprint as pp
^
SyntaxError: invalid syntax
>>> from pprint import pprint as pp
>>> pp(w.game.object_list[16])
<Object 17 dwarf/dwarves 7fc29a4d0550>
>>> pp(w.game.object_list[16].__dict__)
{'contents': None,
'inventory_message': '',
'is_fixed': False,
'is_toting': False,
'is_treasure': False,
'messages': {},
'n': 17,
'names': ['dwarf', 'dwarves'],
'prop': 0,
'rooms': [],
'starting_rooms': []}
>>> pp([dwarf for dwarf in w.game.dwarves if dwarf.room == w.game.loc])
[<adventure.model.Dwarf object at 0x7fc29a49f8d0>]
>>> pp([dwarf for dwarf in w.game.dwarves if dwarf.room == w.game.loc][0].__dict__)
{'has_seen_adventurer': True,
'old_room': <room 33 at 0x7fc29a518be0>,
'room': <room 33 at 0x7fc29a518be0>}
>>> pp(w.game.inventory)
[<Object 2 lamp/headlamp/lantern 7fc29a4cba58>, <Object 4 cage 7fc29a4cbc88>]
>>> pp(w.game.objects_here)
[]
>>> carry(dwarf)
OK
>>> pp(w.game.object_list[16].__dict__)
{'contents': None,
'inventory_message': '',
'is_fixed': False,
'is_toting': True,
'is_treasure': False,
'messages': {},
'n': 17,
'names': ['dwarf', 'dwarves'],
'prop': 0,
'rooms': [],
'starting_rooms': []}
>>> pp([dwarf for dwarf in w.game.dwarves if dwarf.room == w.game.loc])
[<adventure.model.Dwarf object at 0x7fc29a49f8d0>]
>>> pp([dwarf for dwarf in w.game.dwarves if dwarf.room == w.game.loc][0].__dict__)
{'has_seen_adventurer': True,
'old_room': <room 33 at 0x7fc29a518be0>,
'room': <room 33 at 0x7fc29a518be0>}
>>> pp(w.game.inventory)
[<Object 2 lamp/headlamp/lantern 7fc29a4cba58>,
<Object 4 cage 7fc29a4cbc88>,
<Object 17 dwarf/dwarves 7fc29a4d0550>]
>>> pp(w.game.objects_here)
[]
>>> drop(dwarf)
OK
>>> pp(w.game.object_list[16].__dict__)
{'contents': None,
'inventory_message': '',
'is_fixed': False,
'is_toting': False,
'is_treasure': False,
'messages': {},
'n': 17,
'names': ['dwarf', 'dwarves'],
'prop': 0,
'rooms': [<room 33 at 0x7fc29a518be0>],
'starting_rooms': []}
>>> pp([dwarf for dwarf in w.game.dwarves if dwarf.room == w.game.loc])
[<adventure.model.Dwarf object at 0x7fc29a49f8d0>]
>>> pp([dwarf for dwarf in w.game.dwarves if dwarf.room == w.game.loc][0].__dict__)
{'has_seen_adventurer': True,
'old_room': <room 33 at 0x7fc29a518be0>,
'room': <room 33 at 0x7fc29a518be0>}
>>> pp(w.game.objects_here)
[<Object 17 dwarf/dwarves 7fc29a4d0550>]
>>> pp(w.game.inventory)
[<Object 2 lamp/headlamp/lantern 7fc29a4cba58>, <Object 4 cage 7fc29a4cbc88>]
@zhammer
Copy link
Author

zhammer commented Apr 11, 2018

from: http://www.amc.com/shows/halt-and-catch-fire/exclusives/colossal-cave-adventure

There is no way to go that direction.
There is a threatening little dwarf in the room with you!

> take(dwarf)

I don't understand that!

@zhammer
Copy link
Author

zhammer commented Apr 11, 2018

def i_attack(self, verb):  #9120
        enemies = [ self.snake, self.dragon, self.troll, self.bear ]
        if self.dwarf_stage >= 2:
            enemies.extend(self.dwarves)
        dangers = list(filter(self.is_here, enemies))
        ...
# in t_attack
elif obj is self.dwarf:
            if self.is_closed:
                self.wake_repository_dwarves()
                return
            self.write_message(49)

@zhammer
Copy link
Author

zhammer commented Apr 11, 2018

elif obj is self.dwarf:
            if self.is_closed:
                self.wake_repository_dwarves()
                return
            self.write_message(49) # WITH WHAT? YOUR BARE HANDS?
if obj:
            method_name = 't_' + verb_name
            args = (verb, obj)

@zhammer
Copy link
Author

zhammer commented Apr 11, 2018

>>> attack(dwarf)
dispatch command: ('attack', 'dwarf')
WITH WHAT?  YOUR BARE HANDS?

>>> attack
dispatch command: ('attack',)
dangers: [<adventure.model.Dwarf object at 0x7ff70e7a3ac8>]
THERE IS NOTHING HERE TO ATTACK.

@zhammer
Copy link
Author

zhammer commented Apr 11, 2018

also from amc

> w

There is a threatening little dwarf in the room with you!
One sharp, nasty knife is thrown at you!
It misses!
You are in a large room full of dusty rocks.  There is a
big hole in the floor.  There are cracks everywhere, and
a passage leading east.

> attack

With what? Your bare hands?
There is a threatening little dwarf in the room with you!
One sharp, nasty knife is thrown at you!
It misses!

> attack dwarf

With what? Your bare hands?
There is a threatening little dwarf in the room with you!
One sharp, nasty knife is thrown at you!
It misses!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment