home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / AUTOGR.ZIP / PENGUIN.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-09-26  |  2.5 KB  |  66 lines

  1. Uses Crt, Graph;
  2.  
  3. {-------------------------------------------------------------------------}
  4. Procedure StartGraphics;
  5. Var
  6. GraphDetect,GraphMode,ErrorCode : Integer;
  7. Begin;
  8.   GraphDetect := Detect; {Detect is a constant with the value 0,
  9.          this means that InitGraph will autodetect the hardware}
  10.   InitGraph(GraphDetect, GraphMode, '');   {GraphMode is ignored, since
  11.                         InitGraph is autodetecting}
  12.   ErrorCode := GraphResult;
  13.   if GraphResult <> grOk then
  14.   Begin;
  15.     ClrScr;
  16.     Writeln(GraphErrorMsg(ErrorCode));
  17.     Writeln('An error has occured whilst attempting to use the graphics.');
  18.     Writeln('The program has been halted.');
  19.     Halt;
  20.   End;
  21.  End;{Of Procedure StartGraphics}
  22. {----------------------------------------------------------------------}
  23. Function XX(Percent : Real) :Integer;
  24. Begin;
  25.  XX:= Round((GetMaxX /100) * Percent);
  26. End;{Of Function XX}
  27. {----------------------------------------------------------------------}
  28. Function YY(Percent : Real) :Integer;
  29. Begin;
  30.  YY:= Round((GetMaxY /100) * Percent);
  31. End;{Of Function YY}
  32. {----------------------------------------------------------}
  33. Procedure Picture  ;
  34. Begin;
  35.     StartGraphics;
  36.     SetColor(Yellow);
  37.     SetFillStyle(SolidFill,Yellow);
  38.     Rectangle(XX( 27.54),YY( 49.28),XX( 33.02),YY( 77.65));
  39.     Rectangle(XX( 33.02),YY( 49.00),XX( 33.80),YY( 74.50));
  40.     Rectangle(XX( 27.39),YY( 49.28),XX( 26.76),YY( 74.50));
  41.     Circle(XX( 30.05),YY( 43.84),XX(  3.76));
  42.     Rectangle(XX( 26.45),YY( 77.65),XX( 29.73),YY( 79.08));
  43.     Rectangle(XX( 30.99),YY( 77.65),XX( 34.59),YY( 79.08));
  44.     Line(XX( 28.79),YY( 45.27),XX( 30.05),YY( 44.70));
  45.     Line(XX( 30.05),YY( 44.70),XX( 31.30),YY( 45.27));
  46.     Line(XX( 31.30),YY( 45.27),XX( 29.89),YY( 45.85));
  47.     Line(XX( 29.89),YY( 45.85),XX( 29.42),YY( 45.56));
  48.     Circle(XX( 28.33),YY( 41.83),XX(  0.16));
  49.     Circle(XX( 31.61),YY( 41.55),XX(  0.00));
  50.     Line(XX( 11.58),YY( 79.37),XX( 84.04),YY( 79.37));
  51.     Rectangle(XX( 43.19),YY( 49.57),XX( 50.55),YY( 77.36));
  52.     Rectangle(XX( 46.17),YY( 77.36),XX( 52.90),YY( 79.08));
  53.     Rectangle(XX( 45.70),YY( 49.57),XX( 48.20),YY( 74.50));
  54.     Circle(XX( 46.64),YY( 44.13),XX(  3.91));
  55.     Line(XX( 50.55),YY( 44.13),XX( 55.56),YY( 44.99));
  56.     Line(XX( 55.56),YY( 44.99),XX( 50.39),YY( 46.13));
  57.     Circle(XX( 48.51),YY( 41.55),XX(  0.16));
  58.     OutText('Please press any key to continue.');
  59.     Repeat Until KeyPressed;
  60.     CloseGraph;
  61. End;
  62. {----------------------------------------------------------}
  63. Begin;
  64.  Picture;
  65. End.
  66.