Lesson 32. Capstone: Life on Mars
Make a grid that the rover can drive around on by implementing a MarsGrid type. You’ll need to use a mutex to make it safe for use by multiple goroutines at once. It should look something like the following:
Now change the rover example from lesson 31 so that instead of only updating its coordinates locally, the rover uses a MarsGrid object passed into the NewRoverDriver function. If it hits the edge of the grid or an obstacle, it should turn and go in another random direction.