Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
angelabauer authored Jul 23, 2024
1 parent 54d4929 commit 192b81f
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,32 @@ const alphabet = [
"x",
"y",
"z",
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
];

//Click Run
Expand Down Expand Up @@ -174,7 +200,7 @@ function NewLine(text, isPrompt) {
function caesar(cipher_direction, start_text, shift_amount) {
let end_text = "";
if (cipher_direction == "decode") {
shift_amount *= -1;
shift_amount = shift_amount * -1 + 26;
}
for (char in start_text) {
if (alphabet.includes(start_text[char])) {
Expand Down

0 comments on commit 192b81f

Please sign in to comment.