August 2018
Intermediate to advanced
344 pages
9h 20m
English
I was not really happy with the performance of the first version of this program, so I looked around to make some improvements. The program took quite a while to run – over an hour for the first iteration. I was particularly annoyed by how I was storing the states. It would be quite a bit simpler to put the states into some list, and then refer to them by index or subscript. Remember that each state is represented by three numbers, showing the positions of each of our three arm motors – M1, M2, and M3. Let’s create an index to those states and replace that with a single number which we will refer to as stat (state minus the "e"). Then any variable that has stat rather than state uses the index and not ...
Read now
Unlock full access