From 64959e4bcea15ac3e561961f50291e1d2807f800 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 26 Jun 2017 22:41:57 -0400 Subject: [PATCH] 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. --- newdungeon.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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, -- 2.31.1