Because Grunt makes decisions autonomously and mimics an intelligent creature, we can consider his programming to be an example of a simple AI. This means that Grunt is the smartest robot we have made so far!
Recall from the last chapter that the Timmyton's program consisted of one main switch that activated an operating mode based on the brick button that was pressed. Grunt's method is more sophisticated. In order to imitate autonomous decision making, Grunt's programming relies on a series of nested switches. Each switch monitors a different sensor. If the sensor detects that a pre-defined parameter is met, then the corresponding mode will activate; if not, then the program continues down the line and checks the next ...