Easy solution: just define the array with a big enough size (15x15) and ignore the unused elements if the user asks for a smaller one.