{***************************************************
** 水平方向 チェック
** []空集合は False で返す。
**
****************************************************}
function TForm1.horizon_Check(lct : TPoint):boolean;
var
i,x,y : integer;
begin
x := lct.X;
y := lct.Y;
result := True;
for i := low(KnAry[x]) to high(KnAry[x]) do
if i = y then
continue
else
if DArray[x][y] in KnAry[x][i] then
begin
KnAry[x][i] := KnAry[x][i] - [DArray[x][y]];
//[] 空集合
if KnAry[x][i] = [] then
begin
memo1.Lines.Add('horizon 空 False');
result := False;
exit;
end
end;
end;
|
引数 lct は実際に数値が入っている
マス目の座標
集合配列の水平方向
マス目の数値が集合要素に含まれていたら
集合要素からマス目の数値を減算する。
結果 [ ] 空集合になったら
中止。
矛盾あり
|