How many ways are there to break up the regular 9-gon into triangles by diagonals?
UPD
Guaranteed to be convex - yes.
Intersecting "diagonals" be allowed - yes.
2nd UPD
It is task for programming course, so there is no need deep math.
It is more about combinatorics.
The number of ways of subdividing a regular polygon into triangles is a well-known property of Catalan numbers. For a $(n+2)$-sided polygon, there are $C_n$ possible subdivisions.