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