I'm working on recreating the renowned Game of Life simulation and I'm currently having some problems with my math. To get to the point, I'm trying to calculate the column and row of a specific element within the array knowing only the size of the array as well as the last element of the array. Let me explain by listing the information:
e - element in the array
x - column where e is situated
y - row where e is situated
X - Size of the array (columns)
Y - Size of the array (rows)
e = (y*X)+x <--- equation for finding an element knowing the column and row.
x = e-(y*X) <--- equation for finding the column of an element knowing the element and the row.
y = (e*x)/X <--- equation for finding the row of an element knowing the element and the column.
The array I'm working with is 8x6.
So I'm trying to find an algebraic expression that will allow me to find the column of element 9 knowing only the dimetions of the array and that the last element is 47.
P.S. If you have an answer I'd prefer if you'd point me in the right direction instead of saying it directly because I want to figure this out in order to understand it better.