The rogue-scroll command¶
Rogue scroll title generator
Generates random scroll titles in the style of the game Rogue by Michael Toy, Ken Arnold and Glenn Wichman, originally developed in the early 1980s.
Scrolls in the game had titles like
”potrhovbek sunsnefa wunit vlysnebek”
The algorithm used to generate titles and choose a kind of scroll is designed to mimic the generation of scrolls and titles in the game except that this program uses a cryptographically secure random number generator instead of the linear (affine) congruential generator used in the game.
usage: rogue-scroll [-h] [-s MIN_SYLLABLES] [-S MAX_SYLLABLES] [-w MIN_WORDS]
[-W MAX_WORDS] [-n N] [-k] [-K] [--entropy]
[--syllable-divider SYLLABLE_DIVIDER] [--version]
[--copyright]
Named Arguments¶
- -s, --min-syllables
minimum syllables per word
Default:
1
- -S, --max-syllables
maximum syllables per word
Default:
3
- -w, --min-words
minimum words per title
Default:
2
- -W, --max-words
maximum words per title
Default:
4
- -n
number of scroll titles to generate
Default:
1
- -k
show kind of scroll
Default:
False
- -K
only show kind of scroll
Default:
False
- --entropy, -H
compute entropy
Default:
False
- --syllable-divider, -d
syllable separator within title words
Default:
''
- --version
print version information. Then exit
Default:
False
- --copyright
print version and copyright information. Then exit
Default:
False
Version 0.1.2. Copyright AgileBits, Inc. 2022; Jeffrey Goldberg 2024–2025
Examples¶
Syllables per word and words per title (-s
, -S
, -w
, -W
)¶
The default will generate a single random scroll title with the parameters for the minimum and maximum number of syllables per word and the minimum and maximum number of words per title.
$ rogue-scroll
e it niher rhovwahfri
If we want to at least two syllables per word
$ rogue-scroll -s 2
zebaks sunanash yotsne
If we wanted to ensure that a scroll title is exactly five words
$ rogue-scroll -w5 -W5
ipox ro saip mur erzok
Note that if the minimum is greater than the maximum, rogue-scroll
will use
the minimum as the fixed length
$ rogue-scroll -w4 -W1
itpotpay satfa nelgitesol dalfti
$ rogue-scroll -S2 -s4
fubumike klisuvivash ereyutiseh
Number of scroll titles to generate (-n
)¶
It is posssible to generate any non-negative number (including zero) of scrolls
using the -n
option.
$ rogue-scroll -n3
sanresun zebnihplu umnep
sef rososef
klis reaakssnik
$ rogue-scroll -n0
Entropy (-H
)¶
With the -H
flag, the entropy from the generator settings will be printed
after the scroll titles.
$ rogue-scroll -H
marzokevs ash
86.43545791624923
Because the entropy is a function of the settings for number of words and syllables it is only printed once.
$ rogue-scroll -n3 -H
wedkli ulkrog
erod zumklis tursganood wergdalf
eshengash wedpo
86.43545791624923
If you only want to entropy for some particular settings, you can combine this with -n0
to not generate any titles.
Here we see that calculation for five syllables per word and five words per title:
$ rogue-scroll -W5 -S5 -n0 -H
180.04104755060663
Warning
Entropy computation can be higher than true value. See Warning: Amgiguous titles and entropy for details.
Kinds of scrolls (-k
, -K
)¶
There are 18 kinds of scrolls in rogue, listed in
Constants.SCROLL_KINDS
, which turn up with distinct probabilities.
For example when one finds a scroll
there is a 10% chance that it will be a scroll of “identify potion”,
while only a 2% change that it will be a scroll of “protect armor”.
rogue-scroll
can assign scroll kinds according to those probabilities.
With the -k
command line flag, the kind of scroll will be listed
with the generated title:
$ rogue-scroll -n4 -k
klis ityot wun [enchant armor]
xobek ere [aggravate monsters]
nejturs eepwun [identify ring, wand or staff]
evs zimfidfri fu [identify ring, wand or staff]
With the -K
option, only the kinds will be listed.
Titles will not be generated.
$ rogue-scroll -n4 -K
identify potion
identify armor
enchant weapon
monster confusion
Syllable divider (-d
, –syllable-divider)¶
By default there is no separator between syllables in title words. That is fine except that it can result in incorrect entropy computation, as there may be multiple ways a particular title workd could be generated. See Warning: Amgiguous titles and entropy for details.
So for some usages we may want to set a separator character,
such as “-
”.
$ rogue-scroll -d+
shu+re plu wun+it