Esempio n. 1
0
    def setUp(self):

        names = set(["yip", "otto", "xenia"])
        verbs = set(["move", "attack"])
        obverbs = set(["drop"])
        objects = set(["health", "armor"])
        directs = set(["up", "left", "right", "down"])

        self.lexicon = rp.make_lexicon((names, verbs, obverbs, objects, directs), ("N", "V", "W", "O", "D"))
Esempio n. 2
0
dbg = debugit.Debugit(__name__, NO_DBG) #MONSTERS)

####

OBSTACLES    = ('#',)

#### Word Categories

names   = set(['yip', 'otto', 'xenia'])
verbs   = set(['move', 'attack', 'use', 'push'])
obverbs = set(['drop'])
objects = set(['health', 'armor', 'strength', 'mine', 'silver_key', 'gold_key'])
directs = set(['up', 'left', 'right', 'down'])

# Lookup table (word -> Category)
LEXICON = rp.make_lexicon((names, verbs, obverbs, objects, directs), 'NVWOD')

####

class Qurawl(object):
    """Main Game Class"""

    def __init__(self, conf, lexicon=LEXICON):

        seed = conf['seed']
        if seed > 0:
            rand.seed(seed)
        self.conf = conf
        self.lexicon = lexicon
        self.commenter = Commenter()