calculating binomial coefficient by simulation of pascals triangle

This is a little problem i set myself, to create a program that dynamically generates Pascals triangle to resolve the binary co-efficient of an index. Unfortunantly ive fallen pretty early on. I cant figure a way to to add the values without creating massive arrays containg hundreds of variables or hard coding the data.

Anybody at all have a suggestion about how i could do it.

i get the value index form the user

the line id of the triangle will be the same as index

the number of variables in the line will be index +1

and this is where i got stuck...