exercism/xgo — pull request #83 by soniakeys (2014-06-22 07:36:47+00:00)
Title: add exercise robot-simulator

I have reservations about this one. There's a lot to it and I'm afraid people will find it hard. And I worry I might have added too many requirements to the readme. I just didn't like cutting anything out.

There's nothing much unusual in step 1. Step 2 in the readme mentions room dimensions and I didn't see the point of that unless collisions with walls are detected. Coordinate space plus collision avoidance is enough physics that I'm not really comfortable unless the model and calculations are encapsulated somehow. Channels and goroutines work for this and have the advantage that the program architecture is set up for concurrency. So maybe it's a big step from step 1, but channels and goroutines have been used in a couple other exercises before this one, so it's mostly just some refactoring to take code from step 1 and move it to the right goroutines for step 2.

Step 3 turned out quite a bit more complex. Now step 3 in the readme really only adds scripts, but the existing test programs in other languages put multiple robots in the same room. I just couldn't bear doing that without letting the robots run concurrently -- and adding robot-robot collision detection -- and doing error reporting.