

program pic (input,output);

const

%include 'edwin:consts.pas'

type
%include 'edwin:types.pas'
 %INCLUDE 'Edwin:Specs.Pas'
 %INCLUDE 'Edwin:Shapes.Pas'
    

var
 i:integer;
 roof:array[1..10]of pointfm;
   chimney:array[1..10]of pointfm;



procedure Setupscreen;

begin
  Window(0,687,0,511);
  Viewport(0,687,0,511);
  SetShadeMode(0);
  Setcolour(1);
  Rectangle(22,3,322,253);
  Rectangle(366,3,666,253);
  Rectangle(22,259,322,509);
  Rectangle(366,259,666,509);
end;

procedure house;


begin
  Window(0,300,0,250);
  Viewport(22,322,259,509);
  SetShadeMode(1);
  SetColour(3);
  Rectangle(98,183,101,188);
  Rectangle(104,183,107,188);
  Setcolour(3);
  chimney[1].x := 95; chimney[1].y := 163; 
  chimney[2].x := 95; chimney[2].y := 183;
  chimney[3].x := 110;chimney[3].y := 183;
  chimney[4].x := 110;chimney[4].y := 173;
  Polygon(4,chimney);
  Setcolour(4);
  roof[1].x := 75; roof[1].y := 150;
  roof[2].x := 150;roof[2].y := 200;
  roof[3].x := 225;roof[3].y := 150;
  Polygon(3,roof);
  Setcolour(2);
  Rectangle(75,50,225,150);
  SetShadeMode(0);
  Setcolour(3);
  Rectangle(95,115,125,135);
  Rectangle(145,120,155,135);
  Rectangle(175,115,205,135);
  Rectangle(175,65,205,85);
  Rectangle(95,65,125,85);
  SetShadeMode(1);
  setcolour(7);
  Rectangle(143,50,157,80);
  Setcolour(6);
  MoveAbs(145,62);
  Circle(2);
end;

procedure tree;


begin
  Viewport(366,666,259,509);
  Window(-300,0,0,250);
  Setcolour(7);
  SetShadeMode(0);
  MoveAbs(-150,187);
  Circle(10);
  MoveRel(-3,-5);
  Character('+');
  MoveRel(-9,-5);
  Setcolour(6);
  LineAbs(-194,133);
  Setcolour(7);
  Moveabs(-200,125);
  Circle(10);
  MoveRel(-3,-5);
  Character('*');
  MoveRel(-9,-5);
  Setcolour(6);
  LineAbs(-234,70);
  Moveabs(-100,125);
  Setcolour(7);
  Circle(10);
  MoveRel(-3,-5);
  Character('/');
  MoveRel(-12,15);
  Setcolour(6);
  LineAbs(-150,177);
  Setcolour(7);
  Moveabs(-240,62);
  Circle(10);
  MoveRel(-3,-5);
  Character('a');
  MoveAbs(-180,62);
  Circle(10);
  MoveRel(-3,-5);
  Character('b');
  MoveRel(-12,15);
  Setcolour(6);
  Lineabs(-200,115);
  Setcolour(7);
  MoveAbs(-120,62);
  Circle(10);
  MoveRel(-3,-5);
  Character('c');
  MoveRel(-6,15);
  Setcolour(6);
  LineAbs(-100,115);
  MoveAbs(-60,62);
  Setcolour(7);
  Circle(10);
  MoveRel(-3,-5);
  Character('d');
  MoveRel(-12,15);
  Setcolour(6);
  LineAbs(-100,115);
  Setcolour(7);
end;

procedure flag;
var tri:array[1..10]of pointfm;

begin
  Viewport(22,322,3,253);
  Window(-300,0,-250,0);
  SetShadeMode(1);

  Setcolour(1);
  Rectangle(-299,-249,-1,-1);

  Setcolour(2);

  tri[1].x := -250; tri[1].y := -250;
  tri[2].x := -150; tri[2].y := -175;
  tri[3].x := -50 ; tri[3].y := -250;
  Polygon(3,tri);

  tri[1].x := -299; tri[1].y := -200;
  tri[2].x := -200; tri[2].y := -125;
  tri[3].x := -299; tri[3].y := -50 ;
  Polygon(3,tri);

  tri[1].x := -250; tri[1].y := -1  ;
  tri[2].x := -150; tri[2].y := -75 ;
  tri[3].x := -50 ; tri[3].y := -1  ;
  Polygon(3,tri);

  tri[1].x := -1  ; tri[1].y := -200;
  tri[2].x := -100; tri[2].y := -125;
  tri[3].x := -1  ; tri[3].y := -50 ;
  Polygon(3,tri);


end;

procedure xmas;

var tri:array[1..10]of pointfm;

begin
  Window(0,300,-250,0);
  Viewport(366,666,3,253);
  SetShadeMode(1);
  Setcolour(7);
  tri[1].x := 130; tri[1].y := -70 ;
  tri[2].x := 150; tri[2].y := -20 ;
  tri[3].x := 170; tri[3].y := -70 ;
  Polygon(3,tri);

  tri[1].x := 115; tri[1].y := -120;
  tri[2].x := 150; tri[2].y := -50 ;
  tri[3].x := 185; tri[3].y := -120;
  Polygon(3,tri);

  tri[1].x := 100; tri[1].y := -170;
  tri[2].x := 150; tri[2].y := -100;
  tri[3].x := 200; tri[3].y := -170;
  Polygon(3,tri);

  Setcolour(8);
  Rectangle(140,-190,160,-170);

  Setcolour(1);
  Rectangle(120,-240,180,-190);

  Setcolour(8);
  MoveAbs(130,-70);
  Circle(4);
  MoveAbs(115,-120);
  Circle(4);
  MoveAbs(100,-170);
  Circle(4);
  MoveAbs(200,-170);
  Circle(4);
  MoveAbs(185,-120);
  Circle(4);
  MoveAbs(170,-70);
  Circle(4);
  Setcolour(8);
  MoveAbs(150,-20);
  Circle(5);


end;



 begin
  InitialiseFor(DefaultDevice);
  NewFrame;

  Setupscreen;
  flag;
  tree;
  xmas;
  house;


  TerminateEdwin;
 end.

