Now it's OK!

This commit is contained in:
Marcos 2019-05-02 11:43:01 +02:00 committed by GitHub
parent f8605b957a
commit ed99f58d9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,9 +24,9 @@ public class Caesar {
public static String encode(String message, int shift) {
String encoded = "";
if (shift >= 26) { // 26 = number of latin letters
shift %= 26;
}
shift %= 26;
final int length = message.length();
for (int i = 0; i < length; i++) {
@ -62,9 +62,9 @@ public class Caesar {
public static String decode(String encryptedMessage, int shift) {
String decoded = "";
if (shift >= 26) { // 26 = number of latin letters
shift %= 26;
}
shift %= 26;
final int length = encryptedMessage.length();
for (int i = 0; i < length; i++) {