Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Program.docx
Скачиваний:
3
Добавлен:
18.09.2019
Размер:
21.69 Кб
Скачать

Program YellowSubmarine;

Uses Graph, Crt;

Var

y,dy,time,delta,Gd,Gm: integer;

Begin

dy:=-1;

y:=183;

time:=2000;

WriteLn('Izobrazit dvijenie piliskopa');

WriteLn('podvodnoi lodki');

WriteLn('');

WriteLn('');

WriteLn('To initialize graphic mode press Enter.');

ReadLn;

Gd := Detect;

InitGraph(Gd,Gm,''); {Vklyuchenie graficheskogo rezhima}

if GraphResult <> 0 then Halt(1);

{Vklyuchenie zvukovogo signala}

Sound(5000);

Delay(20000);

NoSound;

{Otrisovka korpusa}

SetColor(14);

{ Korpus}

Ellipse(300, 240, 0, 360, 150,50);

Repeat

SetColor(14);

Line(296,y-20,296,190);

Line(312,y,312,190);

Line(296,y-20,336,y-20);

Line(336,y-20,336,y);

Line(336,y,312,y);

if (y>186) or (y<100) then

begin

Delay(50000);

Delay(50000);

dy:=-dy;

end;

Delay(time); { Zaderzhka programmy}

{Stiraem predydushiy kadr}

SetColor(0);

Line(296,y-20,296,190);

Line(312,y,312,190);

Line(296,y-20,336,y-20);

Line(336,y-20,336,y);

Line(336,y,312,y);

y:=y+dy;

Until KeyPressed;

CloseGraph; { Vyhod iz graficheskogo rezhima}

Sound(5000);

Delay(20000);

NoSound;

WriteLn('vipolnil student gruppi BM-81');

WriteLn('Tarasov Oleg');

WriteLn('Graphic mode closed. Press Enter for Exit');

ReadLn;

End.

Program Dots;

Uses Graph, Crt;

Var

x,dx,time,delta,Gd,Gm: integer;

key:char;

Begin

dx:=-1;

x:=600;

time:=2000;

WriteLn('titulnik');

WriteLn('');

WriteLn('');

WriteLn('');

WriteLn('To initialize graphic mode press Enter.');

ReadLn;

Gd := Detect;

InitGraph(Gd,Gm,''); {Vklyuchenie graficheskogo rezhima}

if GraphResult <> 0 then Halt(1);

cleardevice;

{Vklyuchenie zvukovogo signala}

Sound(5000);

Delay(20000);

NoSound;

Repeat

if KeyPressed then

begin

key:=readkey;

case key of

chr(75):begin

cleardevice;

dec(time,100);

end;

chr(77):begin

cleardevice;

inc(time,100);

end;

end;

end;

SetColor(10);

PutPixel(x,200,13);

if (x<0) then x:=640;

Delay(time); { Zaderzhka programmy}

SetColor(0);

PutPixel(x,200,0);

x:=x+3*dx;

Until key=chr(13);

CloseGraph; { Vyhod iz graficheskogo rezhima}

Sound(5000);

Delay(20000);

NoSound;

WriteLn('Graphic mode closed. Press Enter for Exit');

ReadLn;

End.

Program Okrujnost;

Uses Graph, Crt;

Var

x,y,i,R,time,delta,Gd,Gm: integer;

Begin

clrscr;

WriteLn('Zadanie: Izobrazit peremeshenie kruga iz levogo verhnego ugla v ptaviy nizhniy');

WriteLn('To initialize graphic mode and launch software press Enter.');

ReadLn;

{Zadaem radius i nachal'nye koordinaty centra}

R:=50;

x:=50;

y:=50;

Time:=2000;

Gd := Detect;

InitGraph(Gd,Gm,''); {Vklyuchenie graficheskogo rezhima}

if GraphResult <> 0 then Halt(1);

{Vklyuchenie zvukovogo signala}

Sound(5000);

Delay(2000);

NoSound;

OutTextXY(280,25,'Graphic mode');

Repeat

SetColor(15);

Circle(x,y,R);

Delay(time); { Zaderzhka programmy}

SetColor(0); { Zadanie chernogo cveta}

Circle(x,y,R);

SetFillStyle(1,0);

FillEllipse(x,y,R,R);

x:=x+1;

y:=trunc((5/7)*x+(60/7));

if x>=590 then

begin

x:=50; {Esli dobralis' do nizhnego pravogo ugla,}

y:=50; { vozvrashaemsya nazad }

end;

Until KeyPressed;

CloseGraph; { Vyhod iz graficheskogo rezhima}

Sound(5000);

Delay(20000);

NoSound;

WriteLn('Vypolnil student gruppy IM-81 Pavlenko Roman');

WriteLn('Graphic mode closed. Press Enter for Exit');

ReadLn;

End.

Program LineMove;

Uses Graph, Crt;

Var

x,y,dy,dx,time,delta,radius,Gd,Gm: integer;

Key : Char;

LineStyle : Word;

Style : String;

GrDriver, GrMode : Integer;

GrError : Integer;

Begin

GrDriver := Detect;

InitGraph(GrDriver, GrMode, 'C:\TP7\BGI');

GrError := GraphResult;

If GrError<>GrOk then begin Writeln('Обнаружена ошибка!'); Halt

end;

SetBkColor(LightGray); SetColor(Red);

Gd := Detect;

InitGraph(Gd,Gm,'');

if GraphResult <> 0 then Halt(1);

Rectangle(0,0,GetMaxX,GetMaxY);

x:=100; y:=100;

delta:=10;

dx:=delta;

time:=10000;

Repeat

SetColor(15);

Line(300,300,x,y);

if x>=GetMaxX then

begin dx:=-delta; Sound(5000); end;

if x<=0 then

begin dx:= delta; Sound(4000); end;

Delay(time);

NoSound;

SetColor(0);

Line(300,300,x,y);

x:=x+dx;

Until KeyPressed;

CloseGraph;

End.

Program LineMove;

Uses Graph, Crt;

Var

x,y,i,R,time,delta,Gd,Gm: integer;

Begin

clrscr;

WriteLn('Zadanie: Izobrazit peremeshenie kruga iz levogo verhnego ugla v ptaviy nizhniy');

WriteLn('To initialize graphic mode and launch software press Enter.');

ReadLn;

{Zadaem radius i nachal'nye koordinaty centra}

R:=50;

x:=50;

y:=50;

Time:=2000;

Gd := Detect;

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]