procedure WriteCheckLine(Len: Integer; Offset: Byte);
var i: Integer;
begin
for i := Offset to Len - 1 + Offset do
begin
if i and 1 > 0 then Write('*')
else Write('-');
end;
WriteLn;
end;
procedure WriteCheckBoard(N: Integer);
var i: Integer;
begin
for i := 0 to N - 1 do WriteCheckLine(N, i and 1);
end;
procedure WriteCheckBoard(N: Integer);
var i, j, Offset: Integer;
begin
for i := 0 to N - 1 do
begin
Offset := i and 1;
for j := Offset to N - 1 + Offset do
begin
if j and 1 > 0 then Write('*')
else Write('-');
end;
WriteLn;
end;
end;
procedure WriteHex;
var
m, Val, Len, i: Word;
HexA: array [0 .. 3] of AnsiChar;
begin
Val := ch;
Len := 0;
while Val > 0 do
begin
m := Val and $F;
Val := Val shr 4;
case m of
0 .. 9: HexA[Len] := AnsiChar(m + 48);
10 .. 15: HexA[Len] := AnsiChar(m + 55);
end;
Inc(Len);
end;
BuffOut.WriteBinaryString('\u');
if Len = 2 then BuffOut.WriteBinaryString('00');
if Len = 3 then BuffOut.WriteBinaryChar('0');
for i := Len - 1 downto 0 do
begin
BuffOut.WriteBinaryChar(HexA[i]);
end;
end;