Repeat loop hanging
Posted: Fri Jan 03, 2014 2:54 am
I am working on a simple stack to create a sudoku. I have a button to populate the grid with random numbers (which follows the requirements of no duplication in single row, column or block of 9) and it hangs somewhere in the middle. The main work is done inside a double repeat loop, one to work across, and the other to go down. if the upper limit on the "repeat with x = 1 to 9" is reduced to 5 or 6 for testing, it works fine, but if it is 7 or higher it hangs. When I press ESC, it fills the grid as far as it's gone, but the numbers don't show as it goes, which they do if I use the debugger. There is no lock screen in the script.
I'm sure my script is amateurish and inefficient, but it's plenty fast enough when it completes. The debugger would indicate that it's not stuck trying to find an acceptable number, ie too many times around inside looking for one which hasn't been used. Could it be a memory buffer issue? I have 4 GB of RAM on a 2008 MacBook. Running it after a restart didn't make any difference.
Thanks,
Dave
I'm sure my script is amateurish and inefficient, but it's plenty fast enough when it completes. The debugger would indicate that it's not stuck trying to find an acceptable number, ie too many times around inside looking for one which hasn't been used. Could it be a memory buffer issue? I have 4 GB of RAM on a 2008 MacBook. Running it after a restart didn't make any difference.
Thanks,
Dave