func (nds NDShape) ToIth(nd ND) int {
	var i int
	for j := range nd {
		i = i*nds[j] + nd[j]
	}
	return i
}
ToIth converts the given multi dimentional index to a one dimentional index.
package ranger
type ND []int
type NDShape ND