@aart Maybe you would like to try this one ? #include <GDIPlus.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <FontConstants.au3> #include <WinAPISysWin.au3> #include <Array.au3> Const $SIZE = 9, $REGION = Sqrt($SIZE) Const $LENGTH = $SIZE * $SIZE Global $aGrid[$SIZE][$SIZE] Global $aFinalGrid, $SolutionFound = False ShowG