panzerotti
All checks were successful
Deploy / trigger (push) Successful in 36s

vogliamo i panzerotti

Signed-off-by: Francesco Mancuso <hello@francescomancuso.it>
This commit is contained in:
2026-04-21 13:38:46 +02:00
parent 93ade8c460
commit d7cca0099b

View File

@@ -6,6 +6,7 @@ public class Caesar {
char encoded[] = plaintext.toCharArray(); char encoded[] = plaintext.toCharArray();
for(int i = 0; i < plaintext.length(); i++){ for(int i = 0; i < plaintext.length(); i++){
if (encoded[i] == ' ') continue;
encoded[i] = alphabet.charAt(alphabet.indexOf(encoded[i]) + key % 26); encoded[i] = alphabet.charAt(alphabet.indexOf(encoded[i]) + key % 26);
} }
return String.valueOf(encoded); return String.valueOf(encoded);
@@ -21,6 +22,7 @@ public class Caesar {
for(int key = 0; key < alphabet.length(); key++){ for(int key = 0; key < alphabet.length(); key++){
for(int i = 0; i < ciphertext.length(); i++){ for(int i = 0; i < ciphertext.length(); i++){
if (encoded[i] == ' ') continue;
char current = encoded[i]; char current = encoded[i];
int pos = alphabet.indexOf(current); int pos = alphabet.indexOf(current);
if(pos != -1) { if(pos != -1) {