uses
  NumToStr,
  Gray;

const
  FlErr : Boolean = false;
var
  I : Word;

Begin
  WriteLn('Test jednotky Gray');
  for i:=0 to 46 do
    WriteLn('B='+WordStrBin(i)+' - G='+WordStrBin(BinGray(i))+' - GB='+WordStrBin(GrayBin(BinGray(i))));

  Write('Test jednotky 0..$ffff');
  for i:=$0 to $ffff do
  begin
    FlErr:=FlErr or (i<>GrayBin(BinGray(i)));
    if i<>GrayBin(BinGray(i)) then
      WriteLn('B='+WordStrBin(i)+' - G='+WordStrBin(BinGray(i))+' - GB='+WordStrBin(GrayBin(BinGray(i))));
  end;
  if FlErr then
    WriteLn(' Error.')
  else
    WriteLn(' O.k.')
End.
