Putting it all together

There you have it, Grunt's completed program! Looking at the program as a whole shows how all of the nested switches interact with each other. It also gives us a clearer idea of the scale of this program:

While this program is very complex for an EV3 robot, it is a very rewarding program to make because it offers a rich interactive experience and is a great example of how real-world smart robots use nested switches to make complex decisions. The program itself is an example of a very simple AI! The sophisticated decision-making and pre-programmed reactions come together to create a cohesive, lifelike robot with a quirky ...

Get Building Smart LEGO MINDSTORMS EV3 Robots now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.