I am preparing to write a command that will test 1000 possibilities to search for a false result. Consequently, I want the command to cease execution when either the 1000 iterations have completed or the result is false. I try the following command, just to see if it works, but instead of exiting the loop, the kernel gets stuck in an infinite loop that cannot even be aborted. Why?
The output of the following should be 1 then 2 then 3 and that is it, but instead, it continues to print 3. It seems that I have the loop exiting when either 10 iterations or 'match' becomes False. I have set it to set 'match' to False on the third iteration, simply to test this exiting portion, but this is failing.
While[n < 10 && match == True, Print[n]; n = n + 1; If[n = 3, match = False]]