On this page:
transition-graph
-->
goto

6.2.3 Transition Graphs🔗

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

syntax

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

 
transition-clause = [id transition-entry ...+ maybe-expr]
     
transition-entry = --> id
     
maybe-expr = 
  | ,(lambda () transition-expr ...+)
  | ,(lambda name:id () transition-expr ...+)
     
transition-expr = '(done)
  | '(fail _)
  | (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 --> ,(lambda ()
                    (if (not success-step-b?)
                        (goto bad-ending)
                        (goto good-ending)))]
    [fail-ending --> ,(lambda () '(fail 0))]
    [good-ending --> good-ending])
  (list
    (make-step 'a a)
    (make-step 'b b)
    (make-step 'good-ending good)
    (make-step 'fail-ending failed)))

syntax

-->

syntax

(goto step-id)

Forms used in transition-graphs to define transitions between study steps. Use of these forms in places where a transition graph is not being defined will result in a syntax error.