|
Автор: Administrator
|
|
Начинаем заполнение нашей таблицы истинности единицами и нулями
else begin peremennye:=postroenie(workstr); stringgrid1.ColCount:=length(peremennye)+1; k:=2; for i:=2 to length(peremennye) do k:=k*2; stringgrid1.RowCount:=k+1; stringgrid1.Fixedrows:=1; for i:=0 to length(peremennye)-1 do stringgrid1.Cells[i,0]:=peremennye[i+1]; stringgrid1.Cells[length(peremennye),0]:='Значение'; //начинаем заполнение таблицы единицами и нулями t:=(stringgrid1.RowCount-1) div 2; for i:=0 to (stringgrid1.ColCount-2) do begin stringgrid1.Cells[i,1]:='0'; for k:=2 to stringgrid1.RowCount do if ((k-1) mod t = 0) then begin if stringgrid1.Cells[i,k-1]='1' then stringgrid1.Cells[i,k]:='0' else stringgrid1.Cells[i,k]:='1'; end else stringgrid1.Cells[i,k]:=stringgrid1.Cells[i,k-1]; t:=t div 2; end;
|