Problem I. 156. (March 2007)
I. 156. We obtain interesting patterns if regular polygons of different size are drawn on the sides of each other.
Prepare your program that draws an n-sided regular polygon (3n<10) onto each side in the interior of another n-sided regular polygon. Trisection points of the sides of the larger polygon define sides of the smaller polygons. Then apply this procedure iteratively k (1<k<10) times to each of the new polygons. The parameters n and k are read from the command line ( i156.exe 4 85 in the second example). The image should be placed in the middle of the screen, in the largest size for all details to be visible.
The source code of the program (i156.pas, i156.cpp, ...) should be submitted.
Deadline expired on April 16, 2007.
Sorry, the solution is available only in Hungarian. Google translation
A feladat mintamegoldása: i156.rar