Your new letters function is better, but still not ideal IMO. There is a way to do this with a string/array of all the possible digits for bases up to 36. It would reduce lines 73-81 to a single...