Chapter 13. Games Robots Play

Introduction

All the robots in the Mindstorms kit can be adapted in some way or other to play a game against a human opponent, or to play games against themselves. We may need to adapt the rules and mechanics of the game to the robot as well. The programs in this chapter are written with one particular robot in mind, but it is not too difficult to adapt them to a different robot. Most of the programs are full-length games programs, and there are a few shorter programs that you may find useful when designing games of your own.

Maze Runner—Version 1

Taking the programming of Pathfinder a stage further, this program controls a robot as it runs a maze. The maze consists of a path that branches repeatedly into two, ...

Get Programming Lego Mindstorms NXT 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.