chickadee » aima » simple-agent-program

simple-agent-program location clean?procedure

Example of a simple two-square vacuum-agent that merely responds to its percept.

location
The location of the agent
clean?
Whether or not this square is clean
(define (simple-agent-program location clean?)
  (if clean? (if (left? location) 'right 'left) 'suck))