I'll make a note to do that in the next update. On that note, if the algorithm is known, I'd quite like to implement the actual DOS passwords too.
The algorithm is known, and a reasonably accurate documentation of it is in the source file of a program called "Lemmings Code Generator," which you can get from Lemmings Universe
here. There are some inaccuracies in there, so here are my corrections:
Below is my revised version of the bit table that's in the documentation:
nibble 0 | nibble 1 | nibble 2 | nibble 3 | nibble 4 | nibble 5 | nibble 6
-----------|----------|-----------|-----------|-----------|-----------|----------
3 2 1 0| 3 2 1 0| 3 2 1 0| 3 2 1 0| 3 2 1 0| 3 2 1 0| 3 2 1 0
8 4 2 1| 8 4 2 1| 8 4 2 1| 8 4 2 1| 8 4 2 1| 8 4 2 1| 8 4 2 1
| | | | | |
L0 %0 F0 S0|S1 L1 0 %1|S2 L2 %2 F1|S4 S3 %3 L3|%4 S5 L4 F2|S6 %5 F3 L5|L7 L6 0 %6
There are two major things to notice here:
- There are actually eight bits for the level number, not seven, allowing 256 levels to have unique passwords.
- Some of these bits are labeled with F--these represent the number of times the level was failed. If this number is greater than 15, only the last four bits are used (although Lemmix can alternatively cap that value at 15). Most official versions of Lemmings that use this password system use this feature, but DOS Lemmings does not, although it does accept codes with these bits set. (For some reason, this value is set to 8 upon game startup. It's most likely a bug, so Lemmix doesn't need to replicate this behavior.)
The documentation doesn't mention two-player levels. The codes for these levels are the same as those for the one-player levels, except the level numbers start at 160, and the %, F, and S bits are not set (barring the bug mentioned above regarding F bits).
The seed for the Amiga version of Holiday Lemmings 1993 is actually the same as the one for the original Lemmings: AJHLDHBBCJ.
This isn't part of the original algorithm, but you might want the letters to wrap around in case characters beyond Z are generated, so the first character after Z is A instead of [. (SuperLemmini uses this behavior.)
I think that's it! I might write my own documentation on this in the future, though I make no guarantees.