20,741
edits
mNo edit summary |
mNo edit summary |
||
| Line 46: | Line 46: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Now, this is fairly repetitive and not overly scalable, because the variable names are hard coded and need to be changed in a lot of places in the source code. So, it would be better to use a vector of waypoints instead: | Now, this is fairly repetitive and not overly scalable, because the variable names are hard coded and need to be changed in a lot of places in the source code. So, it would be better to use a vector of waypoints instead. A vector is a list of things (variables) that can be easily accessed using an index into the vector. Consider the following example: | ||