Universe::get_index() is almost certainly doing the wrong thing if you give it a row or column that is out of bounds.
You may argue that this little example never does that. But this little example is meant to be expanded upon. One little change will make it more resilient for future code additions.
Alternatively, you could (perhaps should) return a Result instead of edge-wrapping.
Universe::get_index() is almost certainly doing the wrong thing if you give it a row or column that is out of bounds.
You may argue that this little example never does that. But this little example is meant to be expanded upon. One little change will make it more resilient for future code additions.
Alternatively, you could (perhaps should) return a Result instead of edge-wrapping.