X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=make_dungeon.py;h=724b941d9652c10b824e1c9ec42486cd7a075a76;hb=90d9ffd85d6a621d4a52bd214369fec4d7b9fa7e;hp=106714a9267bd519d20a8b44cb1a5e8952c591f5;hpb=782c5c3f290555fa9368208efdb3b428f45468eb;p=open-adventure.git diff --git a/make_dungeon.py b/make_dungeon.py index 106714a..724b941 100755 --- a/make_dungeon.py +++ b/make_dungeon.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # This is the open-adventure dungeon generator. It consumes a YAML description of # the dungeon and outputs a dungeon.h and dungeon.c pair of C code files. @@ -155,8 +155,8 @@ def get_objects(obj): if labels: global statedefines statedefines += "/* States for %s */\n" % item[0] - for (j, label) in enumerate(labels): - statedefines += "#define %s\t%d\n" % (label, j) + for (n, label) in enumerate(labels): + statedefines += "#define %s\t%d\n" % (label, n) statedefines += "\n" sounds_str = "" if attr.get("sounds") == None: @@ -440,7 +440,7 @@ def buildtravel(locs, objs): # At this point the ltravel data is in the Section 3 # representation from the FORTRAN version. Next we perform the - # same mapping into wgat used to be the runtime format. + # same mapping into what used to be the runtime format. travel = [[0, "LOC_NOWHERE", 0, 0, 0, 0, 0, 0, "false", "false"]] tkey = [0] @@ -523,7 +523,7 @@ def get_travel(travel): if __name__ == "__main__": with open(YAML_NAME, "r") as f: - db = yaml.load(f) + db = yaml.safe_load(f) locnames = [x[0] for x in db["locations"]] msgnames = [el[0] for el in db["arbitrary_messages"]]