X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=make_graph.py;h=cc92964dc157790d1f7bcadfe7c2592bfa8a2a41;hb=6dd37a6ec31285d8becb265f47bc49fda08276f5;hp=28af8f7d23c328cf76cf4f2bbd986ce3d83719ed;hpb=07f77a8ffd7e9f1dfdd09fe534323d3d1b206df7;p=open-adventure.git diff --git a/make_graph.py b/make_graph.py index 28af8f7..cc92964 100755 --- a/make_graph.py +++ b/make_graph.py @@ -9,7 +9,11 @@ import sys, yaml def allalike(loc): "Select out loci related to the Maze All Alike" - return (loc == "LOC_MISTWEST") or ("ALIKE" in loc) or ("DEADEND" in loc) or ("STALACTITE" in loc) + return (loc == "LOC_MISTWEST") or ("ALIKE" in loc) or ("MAZEEND" in loc) or ("STALACTITE" in loc) + +def abbreviate(d): + m = {"NORTH":"N", "EAST":"E", "SOUTH":"S", "WEST":"W", "UPWAR":"U", "DOWN":"D"} + return m.get(d, d) if __name__ == "__main__": with open("adventure.yaml", "r") as f: @@ -22,7 +26,7 @@ if __name__ == "__main__": travel = attrs["travel"] if len(travel) > 0: for dest in travel: - verbs = dest["verbs"] + verbs = [abbreviate(x) for x in dest["verbs"]] if len(verbs) == 0: continue action = dest["action"]