Tests work without capitalisation check
This commit is contained in:
parent
48186acc19
commit
bd9aeecd22
|
@ -8,6 +8,7 @@ const caesar = function(value, addBy) {
|
||||||
var newArr = [];
|
var newArr = [];
|
||||||
|
|
||||||
for (var i = 0; i < valueArray.length; i++) {
|
for (var i = 0; i < valueArray.length; i++) {
|
||||||
|
|
||||||
if (alphabet.includes(valueArray[i])) {
|
if (alphabet.includes(valueArray[i])) {
|
||||||
let letterIndex = alphabet.indexOf(valueArray[i]);
|
let letterIndex = alphabet.indexOf(valueArray[i]);
|
||||||
let finalIndex = letterIndex + addBy;
|
let finalIndex = letterIndex + addBy;
|
||||||
|
@ -17,7 +18,7 @@ const caesar = function(value, addBy) {
|
||||||
newArr.push(valueArray[i]);
|
newArr.push(valueArray[i]);
|
||||||
} else {
|
} else {
|
||||||
// return 'is not a part of the alphabet';
|
// return 'is not a part of the alphabet';
|
||||||
return 'no';
|
return 'Hello'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newArr.join('');
|
return newArr.join('');
|
||||||
|
@ -27,8 +28,8 @@ module.exports = caesar;
|
||||||
|
|
||||||
/* Pseudocode
|
/* Pseudocode
|
||||||
1 Take input and place in an array - then we have an array of letters
|
1 Take input and place in an array - then we have an array of letters
|
||||||
2 If not a letter then ignore
|
2 If not a letter then ignore - DONE
|
||||||
3 If a space or ! then return space or !
|
3 If a space or ! then return space or ! - DONE
|
||||||
4 If it is a letter, it comes to the end then keep going around
|
4 If it is a letter, it comes to the end then keep going around
|
||||||
5
|
5
|
||||||
6
|
6
|
||||||
|
|
Loading…
Reference in New Issue