Calculates a legal position for a cell based on grid size and bounds wrapping logic.
grid
bounds
May return undefined if wrap is undefined (default) and cell is out of bounds.
wrap
undefined
cell
Calculates a legal position for a cell based on
gridsize andboundswrapping logic.May return undefined if
wrapisundefined(default) andcellis out of bounds.Param: grid
Param: cell
Param: wrap