List Commands Library for 50g
|
05-13-2019, 03:43 PM
(This post was last modified: 05-17-2019 02:57 PM by DavidM.)
Post: #408
|
|||
|
|||
RE: List Commands Library for 50g
I ended up spending a lot of time on those, starting down several different algorithmic paths and abandoning ideas at various stages for one reason or another. DOCOMB can be summarized as follows:
Code: create a "mask" that represents the first group of list elements DOPERM is similar, but has an inner loop that steps through each permutation of each combination that is found above. The mask is implemented as a string, with each "character" actually representing a zero-based index of a list element (0-255) for permutations and 0 or 1 for combinations. In order for this approach to perform reasonably, the routines dealing with the mask are all coded in Saturn assembly. There are some RPLish quirks that also had to be dealt with, especially for the user-supplied executable. It has to be "prepped" to convert any references to the special variables (XPRM, XCMB, CRMNT) into locals, since they will default to being globals when the user creates the program. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)