program wizytowka;
uses crt;
var
zn:char;
procedure plansza;
begin
clrscr;
begin
textcolor(15);
gotoxy(35,9); write('F1 - Ania');
gotoxy(35,11); write('F2 - Ola');
gotoxy(35,13); write('F3 - Ula');
gotoxy(35,15); write('Esc- Koniec');
end;
end;
procedure ania;
var
zn:char;
x,y,n:byte;
begin
x:=31; y:=10;
repeat
clrscr;
for n:=x to x+22 do
begin
textcolor(10);
gotoxy(n,y); write(char(205));
gotoxy(n,y+6); write(char(205));
end;
for n:=y to y+6 do
begin
gotoxy(x,n); write(char(186));
gotoxy(x+22,n); write(char(186));
end;
gotoxy(x,y); write(char(201));
gotoxy(x+22,y); write(char(187));
gotoxy(x+22,y+6); write(char(188));
gotoxy(x,y+6); write(char(200));
gotoxy(x+3,y+1);
write('Ania Fig');
gotoxy(x+3,y+3);
write('ul. Ziemniakowa 2');
gotoxy(x+3,y+5);
write('93-121 Kobieszewo');
zn:=readkey;
if ord(zn)=0 then
begin
zn:=readkey;
case ord(zn) of
72: if y>1 then y:=y-1 else y:=19;
80: if y+6<25 then y:=y+1 else y:=1;
75: if x>2 then x:=x-1 else x:=57;
77: if x+23<80 then x:=x+1 else x:=1;
end;
end;
until ord(zn)=27
end;
procedure ola;
var
zn:char;
x,y,n:byte;
begin
x:=31; y:=10;
repeat
clrscr;
for n:=x to x+20 do
begin
textcolor(11);
gotoxy(n,y); write(char(205));
gotoxy(n,y+6); write(char(205));
end;
for n:=y to y+6 do
begin
gotoxy(x,n); write(char(186));
gotoxy(x+20,n); write(char(186));
end;
gotoxy(x,y); write(char(201));
gotoxy(x+20,y); write(char(187));
gotoxy(x+20,y+6); write(char(188));
gotoxy(x,y+6); write(char(200));
gotoxy(x+3,y+1);
write(' Ola Nianka');
gotoxy(x+3,y+3);
write(' ul. Dluga 11');
gotoxy(x+3,y+5);
write('43-000 Warszawa');
zn:=readkey;
if ord(zn)=0 then
begin
zn:=readkey;
case ord(zn) of
72: if y>1 then y:=y-1 else y:=19;
80: if y+6<25 then y:=y+1 else y:=1;
75: if x>2 then x:=x-1 else x:=59;
77: if x+21<80 then x:=x+1 else x:=2;
end;
end
until ord(zn)=27
end;
procedure ula;
var
zn:char;
x,y,n:byte;
begin
x:=31; y:=10;
repeat
clrscr;
for n:=x to x+21 do
begin
textcolor(13);
gotoxy(n,y); write(char(205));
gotoxy(n,y+6); write(char(205));
end;
for n:=y to y+6 do
begin
gotoxy(x,n); write(char(186));
gotoxy(x+21,n); write(char(186));
end;
gotoxy(x,y); write(char(201));
gotoxy(x+21,y); write(char(187));
gotoxy(x+21,y+6); write(char(188));
gotoxy(x,y+6); write(char(200));
gotoxy(x+3,y+1);
write('Ula Bialoszewska');
gotoxy(x+3,y+3);
write('ul. Szeroka 10');
gotoxy(x+3,y+5);
write('21-123 Gdansk');
zn:=readkey;
if ord(zn)=0 then
begin
zn:=readkey;
case ord(zn) of
72: if y>1 then y:=y-1 else y:=19;
80: if y+6<25 then y:=y+1 else y:=1;
75: if x>2 then x:=x-1 else x:=58;
77: if x+22<80 then x:=x+1 else x:=2;
end;
end
until ord(zn)=27
end;
begin
repeat
plansza;
zn:=readkey;
if ord(zn)=0 then
begin
zn:=readkey;
case ord(zn) of
59:ania;
60:ola;
61:ula;
end;
end
until ord(zn)=27;
end.
Wsadziłem całość w CODE, żeby było czytelniej.
Marmot