Quote:excuse me? it has to be an eqalateral (sp?) triangle. =/
and i have no clue where to start.
Well, there's a number of different ways you could tackle the problem -- it really depends what the purpose is. Are the elements addressed by row and inset, or something else? Does each element need to 'know' what the adjacent 6 are? Details, details.
Basically, I'd say if you need a 9x9 triangular array, define a linear array with 9+8+7+6+5+4+3+2+1=45 elements, indexed 0..44. Then just have a second array that stores the values { 0, 1, 3, 6, 10, 15, 21, 28, 36 }. There's some formula for it, but it's faster to just do lookups... anyways, when you want to access a value in the 'triangular' array, use mytriangle(rowstarts(row) + inset).