Нарисовать рожицу — Pascal(Паскаль)

uses graph, crt;

var
  gd, gm: integer;
  c: char;

label 0, 2, 3;

begin
  initgraph(gd, gm, 'c:\bp\bgi');
  circle(320, 240, 100);
  ellipse(320, 280, 180, 360, 60, 50);
  ellipse(320, 240, 180, 360, 20, 50);
  ellipse(280, 200, 0, 360, 40, 5);
  ellipse(360, 200, 0, 360, 40, 5);
  outtextxy(1, 1, 'сон(с) утро(у)');
  outtextxy(1, 10, 'Press Esc to exit');
0:
  c := readkey;
  if c = chr(27) then
    halt;
  IF c = 'у' THEN
    GOTO 2;
  IF c = 'с' THEN
    GOTO 3;
  GOTO 0;
2:
  setcolor(0);
  ellipse(280, 200, 0, 360, 40, 5);
  ellipse(360, 200, 0, 360, 40, 5);
  setcolor(14);
  ellipse(280, 200, 360, 0, 30, 10);
  ellipse(360, 200, 360, 0, 30, 10);
  circle(280, 200, 10);
  circle(360, 200, 10);
  GOTO 0;
3:
  setcolor(0);
  ellipse(280, 200, 360, 0, 30, 10);
  ellipse(360, 200, 360, 0, 30, 10);
  circle(280, 200, 10);
  circle(360, 200, 10);
  setcolor(14);
  ellipse(280, 200, 0, 360, 40, 5);
  ellipse(360, 200, 0, 360, 40, 5);
  GOTO 0;
  repeat
    ;
  until keypressed;
  closegraph;

end.

Leave a Comment

+ 64 = 73