Hello everyone,
This is my first time at Kirupa’s forum (been to the website, never visited the forum before), so I’m sorry if this question has been asked (I ran a search and didn’t come up with anything).
Basically I’m building a Sudoku application right now, it’s pretty lengthy running at around 1600 lines of code. This is because there are of course several techniques that are useful for finding out what the possible values are for a cell: simply run through all the cells in the column, the row, and the minigrid and delete duplicates from the possible values property of each cell, check each row, column, and minigrids for twins and triplets, look for numbers that are alone, etc. As a result of this I have one solver function which is called after the new puzzle is generated, this function calls all of these methods. Some of these methods are more efficient on memory than others, so I have them all nested in do while loops where the most efficient methods are on the top, these methods will keep getting checked as long as new values are found, if no new values are found it skips down to the next most efficient methods, etc.
I have this solver function in a try block, with the catch set to catch (e:ScriptTimeoutError). Unfortunately, it doesn’t seem to be working. I’m wondering if anyone can help me out, all flash does is end up “Not Responding” and I have to end cmd-option-esc the program.
I decided instead of wrapping the try catch inside the solver function, which is what I initially had, I would create a new function to call the solver function and instead just try catch that:
try
{
Solve();
}
catch (e:ScriptTimeoutError)
{
solved = true;
changed = false;
forceQuit = true;
}
and inside the Solve function I nested everything in an if (!forceQuit) {}.
So I’ve never really had to use ScriptTimeoutError before, what am I doing wrong? Is my solve function just way too complicated? I decided to make this new function which has the try…catch call the Solve function just because that’s what the Adobe help file similarly had.
Anyways any help you guys can give me would definitely be appreciated. Thanks.