vogliamo i panzerotti Signed-off-by: Francesco Mancuso <hello@francescomancuso.it>
This commit is contained in:
@@ -6,6 +6,7 @@ public class Caesar {
|
||||
char encoded[] = plaintext.toCharArray();
|
||||
|
||||
for(int i = 0; i < plaintext.length(); i++){
|
||||
if (encoded[i] == ' ') continue;
|
||||
encoded[i] = alphabet.charAt(alphabet.indexOf(encoded[i]) + key % 26);
|
||||
}
|
||||
return String.valueOf(encoded);
|
||||
@@ -21,6 +22,7 @@ public class Caesar {
|
||||
for(int key = 0; key < alphabet.length(); key++){
|
||||
|
||||
for(int i = 0; i < ciphertext.length(); i++){
|
||||
if (encoded[i] == ' ') continue;
|
||||
char current = encoded[i];
|
||||
int pos = alphabet.indexOf(current);
|
||||
if(pos != -1) {
|
||||
|
||||
Reference in New Issue
Block a user