summaryrefslogtreecommitdiff
path: root/monsterdb.py
blob: 5235b5fca6df6c7d30d944312e7d16beb015c8eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
monster_db = {}


def read_monster_db(file='monsterdb.txt'):
    with open(file) as f:
        for l in f.readlines():
            try:
                index = l.index(' ')
                monster_id = int(l[:index])
                monster_name = l[index + 1:-1]
                monster_db[monster_id] = monster_name
            except ValueError:
                pass

    return monster_db