On this page:
transition-graph
4.4.2 Transition Graphs🔗

 (require congame/components/transition-graph)
  package: congame-core

syntax

(transition-graph transition-clause ...+)

 
transition-clause = [id transition-entry ...+]
     
transition-entry = --> transition-target
     
transition-target = id
  | (unquote transition-lambda)
     
transition-lambda = (lambda () transition-expr ...+)
  | (lambda name:id () transition-expr ...+)
     
transition-expr = (done)
  | (fail expr)
  | (goto id:id)
  | expr
A transition-graph consists of one or more transition-entries. For example:

(make-study
  "some study"
  #:transitions
  (transition-graph
    [a --> b --> (unquote(lambda ()
                    (if succes-step-b?
                      (goto bad-ending)
                      (goto good-ending))))]
    [fail-ending --> fail-ending]
    [good-ending --> good-ending])
  (list
    (make-step 'a a)
    (make-step 'b b)
    (make-step 'c c)))