Yangi mavzuni mustaxkamlash.
3-misol. Uchta uchburchak uchlarining quyidagi koordinatalari berilgan: 1) (120,20), (80,170), (140,150); 2) (200,97), (500,156), (210,180); 3) (300,190), (200,390), (415,222).
Shu uchburchaklarni mos ravishda qizil, sariq va yashil ranglarda chizish dasturini tuzing.
Uses Graph;
var gd, gm: Integer; Procedure Uchburchak(xl,yl,x2,y2,x3,y3,col:Integer); begin
SetColor(col); Line(xl,yl,x2,y2); Line(x2,y2,x3,y3);
Line(x3,y3,xl,yl);
end;
Begin gd:=0; InitGraph(gd,gm, "); Uchburchak(120,20,80,170,140,150,4); Uchburchak(200,97,500,156,210,180,14); Uchburchak(300,190,200,390,415,222,2); ReadLn; CloseGraph; End.
Yuqorida keltirilgan dasturlarga e'tiborni qaratib, quyidagi xulosaga kelish mumkin: protsedura va funksiyalarga murojaat etish vaqtida funksiya nomi albatta biror operator tarkibida, protsedura nomi esa alohida (mustaqil) yozilar ekan.
Uyga vazifa: 4- mashqni dasturini tuzish.
Sana :______________
Sinf :_______________
|