the_alator

HT1

Nov 28th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.27 KB | None | 0 0
  1. program graphics;
  2. uses GRAPH;
  3. var
  4.     w,h,for_a,for_b,for_c,for_d:integer;
  5.     x1,y1,x2,y2:integer;
  6.  
  7. procedure drawStar(x,y:integer);
  8.  
  9. begin
  10.     for for_a:=0 to  20 do
  11.         line(x,y+40,x+100-for_a*2,y+40+for_a*2);
  12.  
  13.     for for_a:=0 to 20 do
  14.         line(x+20,y+100,x+50+for_a,y+for_a*3);
  15.  
  16.     for for_a:=0 to 20 do
  17.         line(x,y+40,x+80-for_a,y+100-for_a*3);
  18. end;
  19.  
  20. begin
  21.     x1:=0;
  22.     x2:=160;
  23.     y1:=0;
  24.     y2:=160;
  25.     w:= VGA;
  26.     h:= VGAHI;
  27.     initGraph(w,h,'');
  28.     for for_a:=1 to 12 do
  29.     begin
  30.         SetFillStyle(for_a,for_a);
  31.         Bar(x1,y1,x2,y2);
  32.         if x2 = 640 then
  33.         begin
  34.             x1:= 0;
  35.             x2:= 160;
  36.             y1:= y1 + 160;
  37.             y2:= y2 + 160;
  38.         end
  39.         else
  40.         begin
  41.             x1:= x1 + 160;
  42.             x2:= x2 + 160;
  43.         end;
  44.     end;
  45.     readln;
  46.     SetFillStyle(0,0);
  47.     Bar(0,0,639,639);
  48.  
  49.     setColor(Green);
  50.     for for_a:=250 to 640 do
  51.         Line(0,for_a,640,for_a);
  52.  
  53.     setcolor(Blue);
  54.     for for_a:=0 to 250 do
  55.         Line(0,for_a,640,for_a);
  56.  
  57.     setcolor(LightRed);
  58.     for for_a:=50 downto 0 do
  59.         Circle(100,100,for_a);
  60.  
  61.     setcolor(yellow);
  62.     drawStar(300,100);
  63.     drawStar(500,40);
  64.     drawStar(200,120);
  65.  
  66.     readln;
  67. end.
Add Comment
Please, Sign In to add comment