A loop like the one used in the aforementioned example is an ideal task to run in an independent thread. That way, we could keep control over the UI and have the possibility of cancelling the job, displaying its progress, hiding the Codebreaker controls, and displaying our fishes game. Hence, we can avoid being shot by the guard (death or jail).
Now, we are going to make some changes to the application, and we will process that loop using a BackgroundWorker in order to run the code in an independent thread:
DoWorkevent in the BackgroundWorker bakCodeBreaker, and paste the same ...