Subject: One thought
Author:
Posted on: 2020-05-04 04:49:32 UTC

Is to show the random seed and let people enter it directly.

Another one, and one that allows for more randomness in the named lizards, is to do something other than just sum up the codepoints for the names on the input, is to multiply each letter by the relevant power of a relevant constant.

For example,

const N_TYPEABLE_ASCII = 127 - 32; // 127 being backspace and everything 31 and below being control characters
const TYPEABLE_SHIFT = 32; // 32 (space) is the first typeable character, we want it at 1
function to_dragon_seed(name) {
  var ret = 0;
  for (var i = name.length - 1; i >= 0; i--) {
    ret = ret * UPPER_BOUND + (name.codePointAt(i) - 31);
  }
  return ret;
}

If you used a scheme where you uppercased the first letter, shifted name[0] down by 65 ('A') and the rest down by 97 ('a'), and used a scaling factor (N_TYPEABLE_ASCII above) of 26), you could represent every seed value up to 2^32 in seven letters (and if you're seeding with, say, current time, you can go modulo 2^32 without much trouble)

Reply Return to messages