Нашли или выдавили из себя код, который нельзя назвать нормальным,
на который без улыбки не взглянешь?
Не торопитесь его удалять или рефакторить, — запостите его на
говнокод.ру, посмеёмся вместе!
function TForm1.beta(i:integer) : integer;
var bt:integer;
begin
bt:=0;
curI:=i;
if (alf=1) and (cad=0) then
begin
if i<=26 then bt:=2;
if (i<=36) and (i>=27) then bt:=3;
if (i<=48) and (i>=37) then begin bt:=1; addortolexlist(cT); end;
if i=49 then bt:=4;
if i=50 then bt:=5;
if i=51 then bt:=6;
if i=52 then bt:=7;
end;
if (alf=2) and (cad=0) then
begin
if i<=26 then bt:=2;
if (i<=36) and (i>=27) then bt:=2;
end;
if (alf=3) and (cad=0) then
begin
if (i<=36) and (i>=27) then bt:=3;
end;
if (alf=4) and (cad=0) then
begin
if i=50 then
begin
Tl[lexnow].n:=jj;
Tl[lexnow].subst:='<>';
Tl[lexnow].lexcod:=21;
Tl[lexnow].index:=0;
bt:=1;
inc(lexnow);
ii:=ii+1;
end;
if i=51 then
begin
Tl[lexnow].n:=jj;
Tl[lexnow].subst:='<=';
Tl[lexnow].lexcod:=24;
Tl[lexnow].index:=0;
bt:=1;
ii:=ii+1;
inc(lexnow);
end;
Кусок кода из лабораторной работы по трансляторам. Как сказал парень - "Я не умею пользоваться функциями, поэтому я все пишу на массивах" О_о
Дальше в коде заполнение массивов размерностью в сотню элементов вручную!
Главное, что всё работает...
Комментарии (1) RSS