What I would really like to be able to do in a few places is to have
it be random whether A or B is the first printed string. In other
words, something like - now the marmot text "[one of]A[or]B[or]C[at
random then nothing], where after A and B and C are selected in some
random order, it's just "" after that. I can't figure out a way to do
this that isn't enormously kludgy.
Any thoughts?
--Jeremy
> What I would really like to be able to do in a few places is to have
> it be random whether A or B is the first printed string. In other
> words, something like - now the marmot text "[one of]A[or]B[or]C[at
> random then nothing], where after A and B and C are selected in some
> random order, it's just "" after that. I can't figure out a way to do
> this that isn't enormously kludgy.
Does this do what you want?
... say "[one of][bla][or][bla][or][bla][or][stopping]".
To say bla:
say "[one of]neus[or]oor[or]voet[in random order]".
You'd have to create a say-phrase for every such substitution, but that
shouldn't be _too_ much work.
Kind regards,
Victor
"[one of]" tags (unlike "[if]" tags) can be nested. So there's nothing
wrong with this:
say "[one of][one of]A[or]B[at random][or][stopping]."
But I assume that's the kludgy way Jeremy was thinking of.
--Z
--
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
But that doesn't do what Jeremy wants, since it will say only A or B,
and not both of them, before stopping.
Regards,
Victor
If you use this a lot you could make a new ending to the "one of"
phrase (this example is just the "in random order" token modified to
stop after the first permutation - there's probably a better way to do
it!)
The Place is a room.
Instead of waiting, say "You wait[one of] patiently[or] for a while
[or]. Boring[at random then nothing]."
To say at random then nothing -- ending say_one_of with marker
I7_SOO_SHU2: (- {-close-brace} -).
Include (-
[ I7_SOO_SHU2 oldval count sd ct v i j s ssd scope cc base;
base = count+1;
v = oldval%base; oldval = oldval/base; ct = oldval%base; sd = oldval/
base;
if (count > 32) return I7_SOO_PAR(oldval, count);
if (v && ct==0) return -1;
if (count <= 1) v = count;
else {
cc = base*base;
scope = MAX_POSITIVE_NUMBER/cc - cc - base;
if (scope%2==0) scope--;
if (scope<0) scope = -scope;
if (sd == 0) { sd = random(scope); ct=0; }
for (i=0:i<count:i++) I7_SOO_SHUF->i = i;
ssd = sd;
for (i=0:i<count-1:i++) {
j = (sd)%(count-i)+i; sd = (sd*31973)+17; if (sd<0) sd=-sd;
s = I7_SOO_SHUF->j; I7_SOO_SHUF->j = I7_SOO_SHUF->i; I7_SOO_SHUF->i
= s;
}
v = (I7_SOO_SHUF->ct)+1;
ct++; if (ct >= count) { ct = 0; ssd = 0; }
}
return v + ct*base + ssd*base*base;
];
-).
Test me with "z/z/z/z".