GRAPHLIB.INC ist in Pascal geschrieben und benötigt ein zuvor inkludiertes KERNEL.INC. Folgende Prozeduren sind implementiert:
- line(x1,y1,x2,y2,modus) - Zeichnet eine Linie von (x1,y1) nach (x2,y2); der Modus entspricht dem von plot aus KERNEL.INC
- box(x_links, y_oben, x_rechts, y_unten, modus) - Zeichnet ein Rechteck
- square(x, y, breite) - Zeichnet ein Quadrat; die Koordinaten markieren die linke obere Ecke
- ellipse(x_center, y_center, radius_x, radius_y, modus) - Zeichnet eine Ellipse
- circle(x_center, y_center, radius, modus) - Zeichnet einen Kreis
- plot_marker(x, y, marker, modus) - Zeichnet ein Marker-Symbol
- poly_plot(number_of_points, koord, modus) - Zeichnet viele Punkte auf einmal
- poly_marker(number_of_points, koord, marker, modus) - Zeichnet viele Marker-Symbole auf einmal
- poly_line(number_of_points, koord, modus) - Zeichnet viele Linien auf einmal
- poly_fill(number_of_points, koord, modus) - Zeichnet gefüllte Flächen
Code: Alles auswählen
program Haus(input,output);
(*$I KERNEL.INC*)
(*$I GRAPHLIB.INC*)
VAR ch : CHAR;
BEGIN
GraphInit;
ClrScr; HideCursor;
line( 80,224, 80,128,0);
line( 80,128,240, 64,0);
line(240, 64,400,128,0);
line(400,128,400,224,0);
line(400,224, 80,224,0);
line(400,224,640,192,0);
line(640,192,640, 96,0);
line(640, 96,400,128,0);
line(640, 96,480, 32,0);
line(480, 32,240, 64,0);
circle(240,128,40,0);
READ(kbd,ch);
ShowCursor; ClrScr;
END.
Hier sind die drei notwendigen Dateien als ZIP-Datei: