Global $dgr[10][10],$founddgr[10][10],$axt [10][10],$axtdone [10][10],$block[10],$somethingfound Global $pA=0,$pB=0,$pC=0,$pD=0,$pE=0,$pF=0,$pG=0,$pH=0,$pI=0,$pJ=0,$pK=0,$pL=0 Global $Nx=" .6.5.......7.8...9..2..718...1.3...5.3.9.1.7.7...2.6.1.741..2..3.8.5.9.......8.4." filldgr() $axt [0][0]=2 updt($axt [0][0]) seekblock() do $somethingfound=0 seekblock() seek() until $somethingfound=0 showdebug() func seek() for $pA= 1 to 9 for $pB= 1 to 9 $pD=0 for $pC= 1 to 9 if StringMid($dgr[$pA][$pB],$pC,1)=$pC then $pD=$pD+1 if $pD=1 then $pE=$pA $pF=$pB $pG=$pC EndIf EndIf next if $pD=1 then $somethingfound=1 $axt[$pE][$pF]=$pG updt(1) EndIf next next for $pA= 1 to 9 for $pB= 1 to 9 if $axt[$pB][$pA]<>"." then $dgr[$pB][$pA]="*********" next next EndFunc func seekblock() for $pA= 1 to 9 step 3 for $pB= 1 to 9 step 3 $pD=int(($pA-1)/3) $pG=int(($pB-1)/3) for $pF= 1 to 9 $pC=0 for $pE= 1 to 9 $pH=$pD*3+int(($pE-1)/3)+1 $pI=$pG*3+$pE-int(($pE-1)/3)*3 if StringMid($dgr[$pH][$pI],$pF,1)=$pF then $pC=$pC+1 if $pC=1 then $pJ=$pH $pK=$pI $pL=$pF EndIf EndIf next if $pC=1 then $somethingfound=1 $axt[$pJ][$pK]=$pL updt(1) EndIf next next next for $pA= 1 to 9 for $pB= 1 to 9 if $axt[$pB][$pA]<>"." then $dgr[$pB][$pA]="*********" next next EndFunc func filldgr() for $pA= 1 to 9 for $pB= 1 to 9 $dgr[$pA][$pB]="123456789" $axtdone[$pA][$pB]="-" next next EndFunc func updt($updtcmd) if $updtcmd=2 then $updtcmd=startlist() if $updtcmd=1 then $updtcmd=updtdgr() if $updtcmd=0 then for $pA= 1 to 9 for $pB= 1 to 9 if $axt [$pA][$pB]="" then $axt [$pA][$pB]="." Next $block[$pA]="" next for $pA= 1 to 9 for $pB= 1 to 9 $block[int(($pA-1)/3)*3+(int($pB-1)/3)+1]=$block[(int(($pA-1)/3)*3)+(int($pB-1)/3)+1]&$axt [$pA][$pB] Next Next EndIf EndFunc func startlist() local $N=StringSplit($Nx,"",2) for $pA= 1 to 9 for $pB= 1 to 9 if "."<>$N[($pA-1)*9+$pB] then $axt[$pB][$pA]=$N[($pA-1)*9+$pB] next next return 1 EndFunc func updtdgr() for $pA= 1 to 9 for $pB= 1 to 9 for $pC= 1 to 9 if $axtdone[$pA][$pB]<>"*" then $pF="*" Else $pF=$pC EndIf if StringMid($dgr[$pA][$pB],$pC,1)=$axt [$pA][$pB] then $pD=int(($pA-1)/3) $pG=int(($pB-1)/3) for $pE= 1 to 9 $pH=$pD*3+int(($pE-1)/3)+1 $pI=$pG*3+$pE-int(($pE-1)/3)*3 $dgr[$pH][$pI]=StringReplace($dgr[$pH][$pI],$pC,$pF) next for $pE= 1 to 9 $dgr[$pA][$pE]=StringReplace($dgr[$pA][$pE],$pC,$pF) $dgr[$pE][$pB]=StringReplace($dgr[$pE][$pB],$pC,$pF) next if $axtdone[$pA][$pB]<>"*" then $axtdone[$pA][$pB]="*" else $axtdone[$pA][$pB]="." EndIf EndIf next next next return 0 EndFunc func showdebug() for $pA= 1 to 9 for $pB= 1 to 9 ConsoleWrite($axt[$pB][$pA]&" ") next ConsoleWrite(@CRLF) next ConsoleWrite(@CRLF) EndFunc