for (int i = 0; i < 8; i++)

{

float v1 = ((2 * pi) / n) * i;

float v2 = ((2 * pi) / n) * (i+1);

draw_line(cos(v1)*radius, sin(v1)*radius, cos(v2)*radius, sin(v2)*radius);

}

It's not that your method is wrong, it's just that this saves a couple of lines of code and can easily be adapted to suit different kinds of n-gons.

]]>