praktika-cpp-2PO07/3/Unit1.cpp

94 lines
5.5 KiB
C++
Raw Permalink Normal View History

2024-03-02 18:17:55 +02:00
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
TPoint p[149],vodor[233];
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
/*
192,84,233,124,244,112,262,106,285,105,309,108,325,118,329,124,358,78,352,142,349,176,
338,210,316,223,282,231,255,227,233,212,225,188,221,162,191,82,220,160,225,188,231,209,
208,238,197,288,195,335,190,365,222,366,225,315,237,267,232,346,233,376,245,383,278,384,
318,381,340,381,355,370,356,340,352,288,347,262,360,291,365,334,366,361,400,360,399,344,
391,291,380,246,351,205,340,200,352,206,362,221,389,185,643,107,486,185,672,133,492,213,
665,164,489,246,667,201,469,293,434,278,394,306,399,359,390,362,395,364,391,369,390,370,
393,382,385,369,385,379,381,369,378,377,375,368,371,377,374,361,367,360,365,323,359,289,
346,262,353,296,356,366,355,371,341,381,246,384,232,375,236,267,224,312,222,362,217,365,
216,372,213,375,212,386,208,377,208,388,204,376,202,388,200,377,196,388,196,372,198,366,
191,364,196,329,194,325,137,282,110,306,1,236,77,254,1,198,77,232,2,131,84,204,9,81,
183,198,207,236
*/
void __fastcall TForm1::FormPaint(TObject *Sender)
{
int t1[] = {107,272,120,282,126,292,126,297,120,302,110,309,137,304,140,297,139,283,133,272,128,269,105,273,117,279,134,275,140,281,124,287,125,297,140,291,139,303,158,307,201,302,229,288,219,277,209,265,218,251,192,247,157,257,128,268,148,260,141,248,188,228,195,228,197,244,198,247,190,247,188,248,183,231,174,233,180,250,170,253,166,238,159,239,164,255,156,258,151,246,156,259,160,255,197,247,220,250,238,251,252,255,260,263,262,266,241,270,263,271,263,274,259,278,230,288,215,294,217,305,212,310,210,317,205,321,205,300,209,298,213,310,216,295,231,287,213,266,221,250,234,251,226,256,234,258,238,254,234,251,234,251,234,251,234,251};
TRect aRect = Rect(0,0,ClientWidth,ClientHeight);
Canvas->Brush->Color=13748736;
Canvas->FillRect(aRect);
int vod[] = {
497,443,498,396,498,371,502,350,511,333,527,321,540,312,563,300,578,290,589,276,597,266,605,255,607,245,614,219,618,198,624,179,632,169,634,164,636,158,618,201,616,199,616,189,611,161,605,148,599,139,594,134,590,
129,590,129,612,159,617,206,605,252,588,210,533,165,557,185,557,158,560,145,570,136,573,133,559,148,567,150,576,149,580,147,563,147,558,151,557,153,556,160,556,168,549,151,541,145,538,142,550,153,557,167,556,186,
550,179,531,183,522,188,509,202,525,187,493,185,496,185,512,184,512,187,524,186,533,184,551,181,538,168,509,171,
537,169,526,150,536,172,586,209,599,236,605,255,613,228,654,206,632,218,644,188,681,162,660,175,657,113,658,145,627,121,644,137,647,122,645,133,659,145,674,116,675,92,675,113,658,147,661,178,641,192,663,192,643,
193,635,213,671,224,638,216,613,228,652,240,612,229,589,282,651,266,576,289,546,
244,567,273,569,224,569,243,533,216,567,241,568,275,510,255,536,263,514,238,535,264,511,282,524,271,477,266,502,270,479,250,494,264,487,232,492,246,502,231,493,245,496,269,527,273,521,290,534,260,544,266,533,236,
542,263,529,258,519,226,528,259,566,274,578,288,615,275,629,246,616,275,556,305,625,316,665,291,621,314,554,305,588,311,617,335,649,328,615,334,590,311,574,310,590,346,602,334,590,343,608,366,615,347,609,366,598,
355,587,382,613,394,588,381,594,367,569,367,570,375,577,367,581,387,583,368,593,367,596,351,586,333,572,343,582,334,574,307,548,306,509,338,503,359,480,310,377,243,431,277,402,179,414,221,454,150,430,193,413,145,
361,116,414,146,381,145,399,144,383,166,396,143,412,142,430,192,417,219,366,195,399,212,382,186,388,176,383,187,398,211,414,217,411,168,415,221,425,256,393,234,426,262,429,275,360,282,427,276,381,280,362,253,382,
279,416,278,388,313,417,277,442,284,460,294,429,305,457,295,456,263,459,294,458,263,471,230,458,265,446,230,456,279,465,298,482,313,499,356,494,373,496,440,493,439,491,372,496,354,494,435
};
Canvas->Pen->Width=1;
Canvas->Pen->Color=8954880;
Canvas->MoveTo(vodor[0].x=vod[0],vodor[0].y=vod[1]);
for(int j=0; j<15; j++) {
for(int i=0; i<=466; i+=2) {
vodor[i/2].x = 80*j-vod[i]/2;
vodor[i/2].y = (j%2==20?260:260)+vod[i+1]/(j%2==0?2:1.6);
}
Canvas->Polyline(vodor,232);
}
Canvas->Pen->Color=0;
Canvas->MoveTo(p[0].x=t1[0],p[0].y=t1[1]);
for(int i=0; i<=150; i+=2) {
p[i/2].x = t1[i];
p[i/2].y = t1[i+1];
}
Canvas->Polyline(p,75);
Canvas->Pen->Width=3;
Canvas->Pen->Color=8954880;
Canvas->MoveTo(vodor[0].x=vod[0],vodor[0].y=vod[1]);
for(int i=0; i<=466; i+=2) {
vodor[i/2].x = vod[i];
vodor[i/2].y = vod[i+1];
}
Canvas->Polyline(vodor,232);
Canvas->Pen->Width=1;
Canvas->Pen->Color=0;
Canvas->MoveTo(p[0].x=t1[0]/3.2,p[0].y=t1[1]/3.2);
for(int i=0; i<=150; i+=2) {
p[i/2].x = 370+(-t1[i])/3.2;
p[i/2].y = 200+(t1[i+1])/4.2;
}
Canvas->Polyline(p,75);
randomize();
/*or(int j=0; j<3; j++) {
for(int i=0; i<=150; i+=2) {
p[i/2].x = random(600)-100+(-t1[i])/3.2;
p[i/2].y = random(600)+(t1[i+1])/4.2;
}
Canvas->Polyline(p,75);
} */
}
//---------------------------------------------------------------------------