Skip to content

Commit 4c42dfd

Browse files
authored
Bug fixes in script.js
- Added .toUpperCase() method to accept lowercase initials - Added placeholder kill phrases - "Bad Initials" now only appears once after repeated failures
1 parent 8fe352b commit 4c42dfd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Assassin/script.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let initialList = [
2-
"SS"/*Sam*/, "SB"/*Sophia*/, "LL"/*Luca*/, "Ja"/*Jad*/,
3-
"MK"/*Mads*/, "EF"/*Eli*/, "DZ"/*Dan*/, "Jz"/*Joaquin*/
2+
"SS"/*Sam*/, "SB"/*Sophia*/, "LL"/*Luca*/, "JA"/*Jad*/,
3+
"MK"/*Mads*/, "EF"/*Eli*/, "DZ"/*Dan*/, "JZ"/*Joaquin*/
44
];
55

66
let killAction = [
@@ -54,22 +54,22 @@ inputBox.addEventListener("keydown", function (e) { //also from StackO
5454
});
5555

5656
function submit() {
57-
myInitials = inputBox.value;
57+
myInitials = inputBox.value.toUpperCase();
5858
let initialList = [
5959
"SS"/*Sam*/, "SB"/*Sophia*/, "LL"/*Luca*/, "Ja"/*Jad*/,
60-
"MK"/*Mads*/, "EF"/*Eli*/, "DZ"/*Dan*/, "Jz"/*Joaquin*/
60+
"MK"/*Mads*/, "EF"/*Eli*/, "DZ"/*Dan*/, "Jz"/*Joaquin*/,
61+
"IG"/*Gaeta*/
6162
];
6263
let killAction = [
63-
"action1", "action2", "action3", (Math.floor(Math.random() * 79 + 20)).toString(),
64-
"action5", "action6", "action7", "action8"
64+
"Aghast", "Folly", "Stairwell", (Math.floor(Math.random() * 79 + 20)).toString(),
65+
"Descent", "Cacophony", "Archaic", "Moniker", "Keystroke"
6566
];
6667

6768
if (initialList.includes(myInitials)) {
6869
if (badText != undefined) {
6970
badText.remove();
7071
}
7172
document.getElementById("inputFull").remove();
72-
// inputBox.remove();
7373
document.getElementById("revealButton").remove();
7474

7575
let myIndex = initialList.indexOf(myInitials);
@@ -80,7 +80,7 @@ function submit() {
8080
createText(myTarget);
8181
// createText("Method:");
8282
createText(myMethod);
83-
} else {
83+
} else if (badText == undefined) {
8484
console.log("badText");
8585
badText = createText("Bad Initials");
8686
}

0 commit comments

Comments
 (0)