I would love to get any feedback anyone can offer on this stack. In particular, I want to resolve/improve two things:
1) Iterative actions take a non-trivial amount of time with a large board
2) With a large board and a small number of mines, it's easy to reach the recursionLimit. This is applicable to the "checkTheTarget" handler.
I am especially looking for feedback on those two issues, but any feedback at all is appreciated. Thanks!
EDIT: It occurs to me that some of you might not want to go to the trouble of downloading and playing with the stack. If you don't have time to do that, take a look at this flood-fill script and tell me what you think, and if I might be able to accomplish the same thing a different way:
Code: Select all
repeat with x = targetx - 1 to targetx + 1
If x > 0 and x <= rowCount then
repeat with y = targety - 1 to targety + 1
if y > 0 and y <= colCount then
checkTheTarget boardArray[x][y],originalTargetID -- this is the name of the handler where this script excerpt is found
end if
end repeat
end if
end repeat