- Menu
- Procedury
- Snadná modifikovatelnost
program grafika;
uses CRT,Graph;
var vyber, ovladac, klavesa, rezim: integer;
procedure menu;
begin;
writeln ('1 protinajici se kruznice');
writeln ('2 kruznice s dotykem v jednom bode');
writeln ('3 soustredne kruznice');
writeln ('4 kruznice bez spolecnych bodu');
readln (vyber);
end;
procedure kruhy1;
begin;
circle (100, 100, 100);
circle (100, 150, 100);
end;
procedure kruhy2;
begin;
circle (100, 100, 100);
circle (100, 50, 50);
end;
procedure kruhy3;
begin
circle (100, 100, 100);
circle (100, 100, 50);
end;
procedure kruhy4;
begin
circle (100, 100, 66);
circle (300, 300, 50);
end;
procedure volba;
begin;
if vyber = 1 then
kruhy1;
if vyber = 2 then
kruhy2;
if vyber = 3 then
kruhy3;
if vyber = 4 then
kruhy4;
end;
procedure SpustGrafiku;
begin;
Ovladac:=0;
InitGraph(Ovladac,Rezim,'G:\Software\Jazyky\TURBO7\BGI');
cleardevice;
if GraphResult <> grOk then
Halt(1);
end;
procedure VypniGrafiku;
begin;
closegraph;
end;
begin;
repeat;
menu;
SpustGrafiku;
volba;
delay(5000);
VypniGrafiku;
writeln('Prejete si pokracovat?');
writeln(' ano.....1');
writeln(' ne......0');
read(klavesa);
until klavesa<>1;
if klavesa = 0 then
delay(5000);
end.
Žádné komentáře:
Okomentovat