Exercise: Parser Puzzle

Objective

Understand a simple state machine expressed as a Pd graph.

This is a purely computational exercise, but paves the way for attaching external inputs to a finite-state machine.

Steps and observations

  1. Open the parser-puzzle.pd Pure Data patch in the same folder as this file.
  2. Click the green input buttons in the right order until the yellow win indicator is activated. It shouldn't be too hard to figure out. :) The game is trivial, but if the inputs were coming from a sensor the graph could directly model a sequential process.
  3. The finite-state machine is implemented using the state_node.pd abstraction, which is instantiated six times across the bottom of the puzzle patch with different creation arguments.
  4. Look inside the state_node.pd abstraction. Note the messaging buses used to broadcast messages to all states to signal when to store new input values, evaluate the inputs, and signal the state transitions.
  5. An alternate version is implemented below using six instances of the graphical_state abstraction. This uses visible transition edges, although some of the logic is still implemented using buses.

Comments

Other Files

  1. 2.b.ii.1_parser-puzzle.pd
  2. graphical_state.pd
  3. state_node.pd