I don’t know if there’s an accepted protocol, but I’d make a table and fill the first two columns with the array indices (if I’ve got that term right). As far as I know, there’s no built-in short phrase to look up a table row by two entries at once, but we can write one.
[spoiler][code]Enigma Project is a room.
The unused letter list is a list of texts that varies. The unused letter list is {“a”, “b”, “c”, “d”, “e”, “f”, “g”, “h”, “i”, “k”, “l”, “m”, “n”, “o”, “p”, “q”, “r”, “s”, “t”, “u”, “v”, “w”, “x”, “y”, “z”}.
Table 1 - Cryptographic Array
row (number) column (number) letter (text)
with 25 blank rows
[we could type out the table with the row and column entries prefabricated but that would be tedious, so we’ll start the table out blank and use loops to fill in the row and column columns]
When play begins:
repeat with row index running from 1 to 5:
repeat with column index running from 1 to 5:
choose a blank row in the Table of Cryptographic Array;
now the row entry is the row index; [once you’ve “chosen a row” all these entries refer to the entry of the row]
now the column entry is the column index;
let N be a random number from 1 to the number of entries in the unused letter list;[we pick a random letter from the list]
now the letter entry is entry N of the unused letter list;
remove entry N from the unused letter list. [and delete it so we don’t get repeats]
To decide which text is the (row index - a number) by (column index - a number) entry of the cryptographic array: [you can easily choose a row that has a certain entry in a certain column; it may not be so straightforward to match two columns, but we can do it by repeating through the table, which looks at each row in order]
repeat through the Table of Cryptographic Array: [this goes through the lines one by one]
if the row entry is row index and the column entry is column index:
decide on the letter entry; [this should also terminate the repeat loop, I think]
decide on “”. [if we haven’t found anything, the parameters are out of bounds and we return a null string]
Tabling is an action applying to nothing. Understand “table” as tabling.
Report tabling:
repeat through the Table of Cryptographic Array:
say “Row [row entry], Column [column entry]: [letter entry].”
Every turn:
let x be a random number from 1 to 5;
let y be a random number from 1 to 5;
say “Row [x], Column [y]: [x by y entry of the cryptographic array].”
Test me with “table/z/z/z/z/z”.[/code][/spoiler]