Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted by kenny ( 15 years ago )
program fff;
uses
crt;
type
mstrok=array[1..20] of string;
mcvetov=array[1..16] of integer;
var
x,i:byte;
a:mstrok;
b:mcvetov;
procedure inputdata(var x,i:byte); {vvod teksta}
var
c:char;
Begin
while true do
Begin
c:=Readkey;
if ord(c)=27 then
break;
if ord(c)=13 then
Begin
i:=i+1;
x:=x+2;
gotoxy(1,x);
end else
Begin
a[i]:=a[i]+c;
Write(c);
end;
end;
end;
procedure RandomColor(var b:n); {sluchayniy nachalniy fon dlya kazhdoi stroki}
var
q:byte;
Begin
For q:=1 to i do
b[q]:=random(16);
end;
procedure BColor(var b:n; i:byte);
var
c:char;
n,q,w:byte;
Begin
c:=readkey;
while ord(c)=13 do {po nazhatiyu ENTER menyuyutsa cveta}
Begin
textbackground(black);
clrscr;
n:=1; {nomer stroki}
for q:=1 to i do
Begin {obrabotka n-noi stroki}
gotoxy(1,n);
textbackground(b[q]);
Write(a[q]);
n:=n+2;
end;
w:=b[1]; {menyayem mestami cveta}
for q:=1 to i-1 do
b[q]:=b[q+1];
b[i]:=w;
c:=readkey;
end;
end;
Begin
clrscr;
x:=1;
i:=1;
inputdata(x,i);
clrscr;
delete(a[i],length(a[i]),1);
Randomcolor(b);
BColor(b,i);
end.
Revise this Paste