Skip to content

Commit d28d80c

Browse files
author
Michael Frank
committed
Clean up the oopsie. Rebuild the blank exercises.
1 parent b984cb4 commit d28d80c

File tree

1,565 files changed

+27268
-199085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,565 files changed

+27268
-199085
lines changed

caesar/caesar.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
1-
const caesar = function(string, shift) {
2-
return string
3-
.split("")
4-
.map(char => shiftChar(char, shift))
5-
.join("");
6-
};
7-
8-
const codeSet = code => (code < 97 ? 65 : 97);
9-
10-
// this function is just a fancy way of doing % so that it works with negative numbers
11-
// see this link for details:
12-
// https://stackoverflow.com/questions/4467539/javascript-modulo-gives-a-negative-result-for-negative-numbers
13-
const mod = (n, m) => (n % m + m) % m;
14-
15-
const shiftChar = (char, shift) => {
16-
const code = char.charCodeAt();
1+
const caesar = function() {
172

18-
if ((code >= 65 && code <= 90) || (code >= 97 && code <= 122)) {
19-
return String.fromCharCode(
20-
mod(code + shift - codeSet(code), 26) + codeSet(code)
21-
);
22-
}
23-
return char;
243
};
254

265
module.exports = caesar;

calculator/calculator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const sum = function() {
1010

1111
}
1212

13-
const mulitply = function() {
13+
const multiply = function() {
1414

1515
}
1616

getTheTitles/getTheTitles.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var getTheTitles = function(array) {
2-
return array.map(book => book.title)
1+
var getTheTitles = function() {
2+
33
}
44

55
module.exports = getTheTitles

helloWorld/helloWorld.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var helloWorld = function() {
2-
return 'Hello, World!'
2+
return ''
33
}
44

55
module.exports = helloWorld;

leapYears/leapYears.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var leapYears = function(year) {
2-
return year % 4 === 0 && ( year % 100 !== 0 || year % 400 == 0)
1+
var leapYears = function() {
2+
33
}
44

55
module.exports = leapYears

node_modules/.bin/eslint

Lines changed: 0 additions & 1 deletion
This file was deleted.

node_modules/.bin/mkdirp

Lines changed: 0 additions & 1 deletion
This file was deleted.

node_modules/.bin/semver

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/acorn-jsx/LICENSE

Lines changed: 0 additions & 19 deletions
This file was deleted.

node_modules/acorn-jsx/README.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

node_modules/acorn-jsx/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)