A reflexicon is a self-descriptive word list that describes its own letter counts. Take for example the one found by Ed Miller in 1985 in English:
Sixteen e’s, six f’s, one g, three h’s, nine i’s, nine n’s, five o’s, five r’s, sixteen s’s, five t’s, three u’s, four v’s, one w, four x’s
This reflexicon contains exactly what it says it does as per the definition. These are pretty computationally intensive but your job is to find all the possible reflexicons using roman numerals; there are way fewer letters involved (I V X L C D M
) which is why the search space is reduced. Notice the English reflexicon containing "one g" - we can call it "dummy text" and it is allowed. Our reduced alphabet only contains letters used in numerals. A reflexicon using roman numerals would be of the form:
XII I, IV V, II X
The counts (12 I's, 4 V's, 2 X's) are not correct - this just illustrates the format (notice no plural 's
). A letter is completely omitted if its count is 0 (there is no L
in this case).
Here is a list of roman numerals [1..40] for convenience (doubtful you need any more than this):
I II III IV V VI VII VIII IX X
XI XII XIII XIV XV XVI XVII XVIII XIX XX
XXI XXII XXIII XXIV XXV XXVI XXVII XXVIII XXIX XXX
XXXI XXXII XXXIII XXXIV XXXV XXXVI XXXVII XXXVIII XXXIX XL
These are all valid reflexicons (but these are not all!):
IV I, II V
V I, I L, II V, I X
V I, II V, I X, I L
Standard code-golf
rules apply - find all reflexicons using roman numerals! One per line
[["IV", "I"], ["II", "V"]]
fine? \$\endgroup\$IV I, II V
in that case \$\endgroup\$