I would go with the N and below since you're just going after random letters. Unless a index value is defined like with A-M, then the index value will go from 1 to 2 to 3, etc.
How you can have the table spit out a random letter would be a table like below;
_G.alphabet = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}
And then with that, you can use the math.random() function to randomly select the letter in this table, unless the table has pre-defined index values (["Test"] = true).
To have it randomly select a value you can do;
print(_G.alphabet[math.random(1,#_G.alphabet)])
So I'll break this down a little bit more
print()
print(_G.alphabet)
print(_G.alphabet[])
print(_G.alphabet[math.random()])
print(_G.alphabet[math.random(1, #_G.alphabet)])
So it should print out A or C or G or T or M or Z etc...
1 comment
Thanks!