# I am a 56 year old programmer.

*label*Programming

*timer*Asked: Oct 31st, 2015

**Question description**

I am a 56 year old programmer. I am working on a program that needs me to convert a linear position into its respective 9x9 (0 based [8,8]) array position. For example: position 8 might be defined like this: [ n = linear position, x = first array position, y = second array position ]

x = (n / 8) -1 : row = (8 / 8) -1 = 0 correct

y = n - (8 * x) : col = 8 - (8 * 0) = 8 correct

x = (22 /8) - 1 : row = (3) rounded up -1 = 2 correct

y = 22 - (8 *2) col = 22 - 16 = 6 correct

These formulas work until the number n gets larger and x and y are forced to be larger than the array

Can you help me determine what I am doing wrong. Your help would be appreciated.