Fractal of polygons

The fractal we will now draw is formed of a polygon, with little polygons on each corner. The prototype of the method drawing it is the following:
[!java|c]void [/!]fractalDoPolĂ­gono ([!java|c]int [/!]nĂ­veis[!scala]:Int[/!], [!java|c]int [/!]lados[!scala]:Int[/!], [!java|c]double [/!]comprimento[!scala]:Double[/!], [!java|c]double [/!]shrink[!scala]:Double[/!])

Have a look at each world's objective view to understand how to write the function.