Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 26 August 2013 - 07:18 AM
Aluthreney -- the King of sheep.
Posted 26 August 2013 - 07:28 AM
You want the modulus operator %, a % b which returns the remainder when a / b (using integer division).
You do need to know the number of rows and columns though (which you do, 8x6), knowing the last element on its own is not sufficient since it could be 6x8, 8x6, 12x4, 3x16, etc.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.