From: Eric S. Raymond Date: Tue, 27 Jun 2017 02:41:57 +0000 (-0400) Subject: This version of newdungeon.py can exactly recover Section 3... X-Git-Tag: 1.1~91 X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=commitdiff_plain;h=64959e4bcea15ac3e561961f50291e1d2807f800 This version of newdungeon.py can exactly recover Section 3... ...from the YAML data. Next, to pack the recovered data the way dungeon.c does and wite it in. --- diff --git a/newdungeon.py b/newdungeon.py index 64592e5..8974a5a 100755 --- a/newdungeon.py +++ b/newdungeon.py @@ -465,8 +465,8 @@ def buildtravel(locs, objs, voc): tt += [verbmap[e] for e in rule["verbs"]] if not rule["verbs"]: tt.append(1) - #print(tuple(tt)) - return (ltravel, lkeys) + ltravel.append(tuple(tt)) + return (tuple(ltravel), lkeys) def get_motions(motions): template = """ {{ @@ -492,6 +492,7 @@ if __name__ == "__main__": msgnames = [el[0] for el in db["arbitrary_messages"]] objnames = [el[0] for el in db["objects"]] (travel, key) = buildtravel(db["locations"], db["objects"], db["vocabulary"]) + # FIXME: pack the Section 3 representation into the runtime format. c = c_template.format( h_name,