chap2-anim.py 2.72 KB
from t2g import *

#######################

load("chap2-gates.tex")

state = {"low": 0, "high": 1}
active = {"down": "", "up": ""}

frame(.8)
active["down"] = "active"
frame(.8)
active["down"] = ""
state = {"low": 1, "high": 0}
frame(.8)
active["up"] = "active"
frame(.8)

gif("chap2-gates.gif")

#######################

load("chap2-track.tex")

state = {"far": 1, "before": 0, "inside": 0}
active = {"enter": "", "exit": "", "approach": ""}

frame(.8)
active["approach"] = "active"
frame(.8)
active["approach"] = ""
state = {"far": 0, "before": 1, "inside": 0}
frame(.8)
active["enter"] = "active"
frame(.8)
active["enter"] = ""
state = {"far": 0, "before": 0, "inside": 1}
frame(.8)
active["exit"] = "active"
frame(.8)

gif("chap2-track.gif")

#######################

load("chap2-draft.tex")

state = {"far": 1, "before": 0, "inside": 0, "low": 0, "high": 1, "godown": 0, "goup": 0}
active = {"enter": "", "exit": "", "approach": "", "down": "", "up": ""}

frame(.8)
active["approach"] = "active"
frame(.8)
active["approach"] = ""
state = {"far": 0, "before": 1, "inside": 0, "low": 0, "high": 1, "godown": 1, "goup": 0}
frame(.8)
active["down"] = "active"
frame(.8)
active["down"] = ""
state = {"far": 0, "before": 1, "inside": 0, "low": 1, "high": 0, "godown": 0, "goup": 0}
frame(.8)
active["enter"] = "active"
frame(.8)
active["enter"] = ""
state = {"far": 0, "before": 0, "inside": 1, "low": 1, "high": 0, "godown": 0, "goup": 0}
frame(.8)
active["exit"] = "active"
frame(.8)
active["exit"] = ""
state = {"far": 1, "before": 0, "inside": 0, "low": 1, "high": 0, "godown": 0, "goup": 1}
frame(.8)
active["up"] = "active"
frame(.8)

gif("chap2-draft.gif")

#######################

load("chap2-test.tex")

state = {"far": 1, "before": 0, "inside": 0, "low": 0, "high": 1, "godown": 0, "goup": 0}
active = {"enter": "", "exit": "", "approach": "", "down": "", "up": "",
          0: "active"}
active.update((s, "") for s in range(1,5))

frame(.8)
active["approach"] = "active"
frame(.8)
active["approach"] = active[0] = ""
active[1] = "active"
state = {"far": 0, "before": 1, "inside": 0, "low": 0, "high": 1, "godown": 1, "goup": 0}
frame(.8)
active["down"] = "active"
frame(.8)
active["down"] = active[1] = ""
active[2] = "active"
state = {"far": 0, "before": 1, "inside": 0, "low": 1, "high": 0, "godown": 0, "goup": 0}
frame(.8)
active["enter"] = "active"
frame(.8)
active["enter"] = active[2] = ""
active[3] = "active"
state = {"far": 0, "before": 0, "inside": 1, "low": 1, "high": 0, "godown": 0, "goup": 0}
frame(.8)
active["exit"] = "active"
frame(.8)
active["exit"] = active[3] = ""
active[4] = "active"
state = {"far": 1, "before": 0, "inside": 0, "low": 1, "high": 0, "godown": 0, "goup": 1}
frame(.8)
active["up"] = "active"
frame(.8)

gif("chap2-test.gif", dpi=450)