List Commands Library for 50g
|
07-05-2017, 04:47 PM
(This post was last modified: 07-05-2017 04:50 PM by DavidM.)
Post: #30
|
|||
|
|||
RE: List Commands Library for 50g
(07-04-2017 08:41 PM)Gilles59 Wrote: An exemple of DOPERM to solve cryptarithms That's a very good example of how to make use of DOPERM, Gilles! Unfortunately, it's also a very good example of why I need to go ahead and do something I was already thinking about: creating some kind of mechanism for an early exit feature. It pains me to think that you had to resort to a KILL command. Ouch. While I am loathe to do anything that will slow down these commands, I think the potential benefit from building in the early exit checks will outweigh the (hopefully) slight delay. This becomes a bit more complicated because DOPERM, like the PERM command, is actually both a combination and permutation processor. That means that there's two distinctly different "early exit" concepts: one for the current combination being permuted, and the other for the entire process. My plan is to have two local flags available to the user -- ENDPERM and ENDCOMB. Those will only be available while the command is running, and will be initially set to 0/FALSE at the beginning of operation. If the user program changes either of them to 1/TRUE, DOPERM will respond as follows: ENDPERM TRUE: All processing will stop and the command will exit gracefully, placing the output of processing into a list as usual. ENDCOMB TRUE: Any further permutations of the current combination will be skipped, and the next combination will be started for permutation processing. Does this seem like a reasonable approach? I'm open to other suggestions for how to manage this. While it seems like this should be workable, I don't presume that it's the best way to handle it. All thoughts are welcome! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)