Looking to create a randomly generated alphabet for a substitution cipher. My idea was something like this.
char randomChar = (char) (97 + r.nextInt(25));
However this will cause repetition of letters. Going through the char array and seeing if the letter is already present seems inefficient also.
Aucun commentaire:
Enregistrer un commentaire