From e2cea858c9d8181aa4e6bd7a9a7683d5f2bf32c9 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Wed, 13 Nov 2019 14:04:22 -0800 Subject: [PATCH 01/15] initiate --- src/adagrams.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adagrams.js b/src/adagrams.js index 54043451..5865cc20 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -1,6 +1,6 @@ const Adagrams = { drawLetters() { - // Implement this method for wave 1 + }, }; From edca99a8dfab9af93818dc3ac0906436cc737242 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Wed, 13 Nov 2019 14:37:12 -0800 Subject: [PATCH 02/15] add code to put letters in hash then into array but not yet running --- src/adagrams.js | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/adagrams.js b/src/adagrams.js index 5865cc20..c835923b 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -1,8 +1,49 @@ const Adagrams = { + + const alphabetObject = {}; + alphabetObject: { + A: 9, + B: 2, + C: 2, + D: 4, + E: 12, + F: 2, + G: 3, + H: 2, + I: 9, + J: 1, + K: 1, + L: 4, + M: 2, + N: 6, + O: 8, + P: 2, + Q: 1, + R: 6, + S: 4, + T: 6, + U: 4, + V: 2, + W: 2, + X: 1, + Y: 2, + Z: 1, + }; + const makeLetters = () => { + const alphabetArray = []; + for (let key in alphabetObject) { + let i = alphabetObject[key]; + while (i > 0) { + alphabetArray << key; + i -= 1; + }; + console.log(alphabetArray) + }}}; drawLetters() { - }, }; +makeLetters() + // Do not remove this line or your tests will break! export default Adagrams; From 82f433e1e0951126cafec024c261a03daa4cf57f Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Wed, 13 Nov 2019 22:34:01 -0800 Subject: [PATCH 03/15] make progress --- src/adagrams.js | 125 +++++++++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 44 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index c835923b..a0a1b69c 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -1,49 +1,86 @@ -const Adagrams = { - - const alphabetObject = {}; - alphabetObject: { - A: 9, - B: 2, - C: 2, - D: 4, - E: 12, - F: 2, - G: 3, - H: 2, - I: 9, - J: 1, - K: 1, - L: 4, - M: 2, - N: 6, - O: 8, - P: 2, - Q: 1, - R: 6, - S: 4, - T: 6, - U: 4, - V: 2, - W: 2, - X: 1, - Y: 2, - Z: 1, - }; +// const Adagrams = { const makeLetters = () => { - const alphabetArray = []; - for (let key in alphabetObject) { - let i = alphabetObject[key]; - while (i > 0) { - alphabetArray << key; - i -= 1; + const alphabetObject = { + A: 9, + B: 2, + C: 2, + D: 4, + E: 12, + F: 2, + G: 3, + H: 2, + I: 9, + J: 1, + K: 1, + L: 4, + M: 2, + N: 6, + O: 8, + P: 2, + Q: 1, + R: 6, + S: 4, + T: 6, + U: 4, + V: 2, + W: 2, + X: 1, + Y: 2, + Z: 1, + }; + + const alphabetArray = []; + for (let key in alphabetObject) { + let i = alphabetObject[key]; + while (i > 0) { + alphabetArray.push(key); + i -= 1; + }; }; - console.log(alphabetArray) - }}}; - drawLetters() { - }, -}; + return alphabetArray; + }; +// adapted from Fisher-Yates Shuffle + const shuffle = (array) => { + let currentIndex = array.length, temporaryValue, randomIndex; + while (0 !== currentIndex) { + randomIndex = Math.floor(Math.random() * currentIndex); + currentIndex -= 1; + temporaryValue = array[currentIndex]; + array[currentIndex] = array[randomIndex]; + array[randomIndex] = temporaryValue; + } + return array; + } + + const drawLetters = () => { + let shuffled = shuffle(makeLetters()); + let lettersInHand = shuffled.slice(0, 10); + return lettersInHand; + } + + const usesAvailableLetters = function(input, lettersInHand) { + let handCollection = {} + lettersInHand.forEach((letter) => { + if (handCollection[letter] == null) { + handCollection[letter] = 1 + } + else { + handCollection[letter] += 1 + } + }) + input.text.toUpperCase().split('').forEach((letter) => { + if (handCollection.keys.includes(letter)) { + handCollection[letter] -= 1 + } +}) + } + //put all letters w count in a "hash", then check input against + -makeLetters() + // }, +// }; +// use THIS to call make letters once i put them both within Adagrams +usesAvailableLetters('test', drawLetters()) // Do not remove this line or your tests will break! -export default Adagrams; +// export default Adagrams; \ No newline at end of file From d89cd826404071c3e07f2b65450d7bd311ba7385 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Thu, 14 Nov 2019 08:10:14 -0800 Subject: [PATCH 04/15] finish usesAvailableLetters function --- src/adagrams.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index a0a1b69c..daaa4486 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -1,3 +1,5 @@ +import { objectExpression } from "@babel/types"; + // const Adagrams = { const makeLetters = () => { const alphabetObject = { @@ -66,14 +68,21 @@ } else { handCollection[letter] += 1 - } - }) - input.text.toUpperCase().split('').forEach((letter) => { - if (handCollection.keys.includes(letter)) { - handCollection[letter] -= 1 } -}) + }) + input.toUpperCase().split('').forEach((letter) => { + if (Object.keys(handCollection).includes(letter)) { + handCollection[letter] -= 1; + if (handCollection[letter] < 0) { + return false; + } + else { + return false; + } + } + }) } + //put all letters w count in a "hash", then check input against From e43ff303e7966e169ce2972d18c0259090c4aa05 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Thu, 14 Nov 2019 08:23:52 -0800 Subject: [PATCH 05/15] fix typos --- src/adagrams.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index daaa4486..30963a61 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -1,4 +1,4 @@ -import { objectExpression } from "@babel/types"; +// import { objectExpression } from "@babel/types"; // const Adagrams = { const makeLetters = () => { @@ -37,10 +37,10 @@ import { objectExpression } from "@babel/types"; while (i > 0) { alphabetArray.push(key); i -= 1; - }; - }; + } + } return alphabetArray; - }; + } // adapted from Fisher-Yates Shuffle const shuffle = (array) => { let currentIndex = array.length, temporaryValue, randomIndex; @@ -76,12 +76,15 @@ import { objectExpression } from "@babel/types"; if (handCollection[letter] < 0) { return false; } - else { - return false; } - } + else if (Object.keys(handCollection).includes(letter) === false) { + return false; + } + return true }) - } + } + + //put all letters w count in a "hash", then check input against @@ -90,6 +93,6 @@ import { objectExpression } from "@babel/types"; // }; // use THIS to call make letters once i put them both within Adagrams -usesAvailableLetters('test', drawLetters()) +console.log(usesAvailableLetters('test', drawLetters())) // Do not remove this line or your tests will break! // export default Adagrams; \ No newline at end of file From a9d067a161f73fb7c5c28bd88066e07a3b8df061 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Thu, 14 Nov 2019 20:18:02 -0800 Subject: [PATCH 06/15] fix functions in object --- src/adagrams.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index 30963a61..933af01e 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -1,7 +1,10 @@ // import { objectExpression } from "@babel/types"; -// const Adagrams = { - const makeLetters = () => { +const Adagrams = { + // because member of Adagrams, no const like increment in arrow function example + //don't use arrow functions as members of objects + //can be inside function inside object (okay as callback function) + makeLetters() { const alphabetObject = { A: 9, B: 2, @@ -30,7 +33,6 @@ Y: 2, Z: 1, }; - const alphabetArray = []; for (let key in alphabetObject) { let i = alphabetObject[key]; @@ -42,7 +44,7 @@ return alphabetArray; } // adapted from Fisher-Yates Shuffle - const shuffle = (array) => { + shuffle(array) { let currentIndex = array.length, temporaryValue, randomIndex; while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * currentIndex); @@ -53,14 +55,13 @@ } return array; } - - const drawLetters = () => { + drawLetters() { let shuffled = shuffle(makeLetters()); let lettersInHand = shuffled.slice(0, 10); return lettersInHand; } - const usesAvailableLetters = function(input, lettersInHand) { + usesAvailableLetters = function(input, lettersInHand) { let handCollection = {} lettersInHand.forEach((letter) => { if (handCollection[letter] == null) { @@ -70,14 +71,15 @@ handCollection[letter] += 1 } }) - input.toUpperCase().split('').forEach((letter) => { + // cannot break out of a foreach loop! use a different kind of loop + for(const letter in input.toUpperCase().split('')) { if (Object.keys(handCollection).includes(letter)) { handCollection[letter] -= 1; if (handCollection[letter] < 0) { return false; } } - else if (Object.keys(handCollection).includes(letter) === false) { + else if (!Object.keys(handCollection).includes(letter)) { return false; } return true From d172ace8c2048d85d36bfcc2e6a3e257b9a0a236 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Fri, 15 Nov 2019 13:17:18 -0800 Subject: [PATCH 07/15] try a complicated way to calulate score including hash-like object with arrays for values and finding keys (point values) by searching those array then finding corresponding keys --- src/adagrams.js | 158 ++++++++++++++++++++++++++++-------------------- 1 file changed, 91 insertions(+), 67 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index 933af01e..0ea8c156 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -1,50 +1,47 @@ -// import { objectExpression } from "@babel/types"; +import { objectExpression } from "@babel/types"; -const Adagrams = { - // because member of Adagrams, no const like increment in arrow function example - //don't use arrow functions as members of objects - //can be inside function inside object (okay as callback function) - makeLetters() { - const alphabetObject = { - A: 9, - B: 2, - C: 2, - D: 4, - E: 12, - F: 2, - G: 3, - H: 2, - I: 9, - J: 1, - K: 1, - L: 4, - M: 2, - N: 6, - O: 8, - P: 2, - Q: 1, - R: 6, - S: 4, - T: 6, - U: 4, - V: 2, - W: 2, - X: 1, - Y: 2, - Z: 1, - }; - const alphabetArray = []; - for (let key in alphabetObject) { - let i = alphabetObject[key]; - while (i > 0) { - alphabetArray.push(key); - i -= 1; - } +const makeLetters = function() { + const alphabetObject = { + A: 9, + B: 2, + C: 2, + D: 4, + E: 12, + F: 2, + G: 3, + H: 2, + I: 9, + J: 1, + K: 1, + L: 4, + M: 2, + N: 6, + O: 8, + P: 2, + Q: 1, + R: 6, + S: 4, + T: 6, + U: 4, + V: 2, + W: 2, + X: 1, + Y: 2, + Z: 1, + }; + const alphabetArray = []; + for (let key in alphabetObject) { + let i = alphabetObject[key]; + while (i > 0) { + alphabetArray.push(key); + i -= 1; } - return alphabetArray; } +return alphabetArray; +}; + // adapted from Fisher-Yates Shuffle - shuffle(array) { +const shuffle = function(array) { let currentIndex = array.length, temporaryValue, randomIndex; while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * currentIndex); @@ -54,47 +51,74 @@ const Adagrams = { array[randomIndex] = temporaryValue; } return array; - } + }; + +const Adagrams = { + makeLetters, + shuffle, + drawLetters() { - let shuffled = shuffle(makeLetters()); + let shuffled = this.shuffle(this.makeLetters()); let lettersInHand = shuffled.slice(0, 10); return lettersInHand; - } + }, - usesAvailableLetters = function(input, lettersInHand) { + usesAvailableLetters(input, lettersInHand) { + // put drawn letters into a hash-like object let handCollection = {} lettersInHand.forEach((letter) => { if (handCollection[letter] == null) { - handCollection[letter] = 1 + handCollection[letter] = 1; } else { - handCollection[letter] += 1 + handCollection[letter] += 1; } - }) - // cannot break out of a foreach loop! use a different kind of loop - for(const letter in input.toUpperCase().split('')) { - if (Object.keys(handCollection).includes(letter)) { - handCollection[letter] -= 1; - if (handCollection[letter] < 0) { + }) + // iterate through input word and check against hash-like object + let letterIndex = 0; + input = input.toUpperCase().split('') + while (letterIndex < input.length) { + if (Object.keys(handCollection).includes(input[letterIndex])) { + handCollection[input[letterIndex]] -= 1; + if (handCollection[input[letterIndex]] < 0) { return false; } } - else if (!Object.keys(handCollection).includes(letter)) { + else if (!Object.keys(handCollection).includes(input[letterIndex])) { return false; - } - return true - }) + } + letterIndex += 1; } + return true + }, + scoreWord(word) { + const scoreboard = { + 1: ['A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T'], + 2: ['D', 'G'], + 3: ['B', 'C', 'M', 'P'], + 4: ['F', 'H', 'V', 'W', 'Y'], + 5: ['K'], + 8: ['J', 'X'], + 10: ['Q', 'Z'] + } + let score = 0; + if (word.length >= 7) { + score += 8; + }; + word = word.toUpperCase().split(''); + word.forEach((letter) => { + Object.values(scoreboard).forEach((pointValue) => { + if (pointValue.includes(letter)) { + const key = Object.keys(scoreboard).find(key => scoreboard[key] === pointValue); + score += key; + } + }) + }) + } +} - //put all letters w count in a "hash", then check input against - - - // }, -// }; -// use THIS to call make letters once i put them both within Adagrams -console.log(usesAvailableLetters('test', drawLetters())) // Do not remove this line or your tests will break! -// export default Adagrams; \ No newline at end of file +export default Adagrams; From 6923a0a7456018bbaffeab176fc936ade5b768e4 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Fri, 15 Nov 2019 13:42:11 -0800 Subject: [PATCH 08/15] switch methods for calculating score, remember to return, tests passing --- src/adagrams.js | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index 0ea8c156..27e03914 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -94,27 +94,44 @@ const Adagrams = { scoreWord(word) { const scoreboard = { - 1: ['A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T'], - 2: ['D', 'G'], - 3: ['B', 'C', 'M', 'P'], - 4: ['F', 'H', 'V', 'W', 'Y'], - 5: ['K'], - 8: ['J', 'X'], - 10: ['Q', 'Z'] - } + A: 1, + B: 3, + C: 3, + D: 2, + E: 1, + F: 4, + G: 2, + H: 4, + I: 1, + J: 8, + K: 5, + L: 1, + M: 3, + N: 1, + O: 1, + P: 3, + Q: 10, + R: 1, + S: 1, + T: 1, + U: 1, + V: 4, + W: 4, + X: 8, + Y: 4, + Z: 10, + }; let score = 0; if (word.length >= 7) { score += 8; }; word = word.toUpperCase().split(''); word.forEach((letter) => { - Object.values(scoreboard).forEach((pointValue) => { - if (pointValue.includes(letter)) { - const key = Object.keys(scoreboard).find(key => scoreboard[key] === pointValue); - score += key; - } - }) + if (Object.keys(scoreboard).includes(letter)) { + score += scoreboard[letter]; + } }) + return score; } } From 2ce47278189b93dd38b3fdac148a5a2f2f9ca621 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Fri, 15 Nov 2019 13:59:17 -0800 Subject: [PATCH 09/15] all tests passing, through required waves --- src/adagrams.js | 84 +++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index 27e03914..0b6a004b 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -51,7 +51,49 @@ const shuffle = function(array) { array[randomIndex] = temporaryValue; } return array; +}; + +const scoreWord = function(word) { + const scoreboard = { + A: 1, + B: 3, + C: 3, + D: 2, + E: 1, + F: 4, + G: 2, + H: 4, + I: 1, + J: 8, + K: 5, + L: 1, + M: 3, + N: 1, + O: 1, + P: 3, + Q: 10, + R: 1, + S: 1, + T: 1, + U: 1, + V: 4, + W: 4, + X: 8, + Y: 4, + Z: 10, }; + let score = 0; + if (word.length >= 7) { + score += 8; + }; + word = word.toUpperCase().split(''); + word.forEach((letter) => { + if (Object.keys(scoreboard).includes(letter)) { + score += scoreboard[letter]; + } + }) +return score; +}; const Adagrams = { makeLetters, @@ -92,47 +134,7 @@ const Adagrams = { return true }, - scoreWord(word) { - const scoreboard = { - A: 1, - B: 3, - C: 3, - D: 2, - E: 1, - F: 4, - G: 2, - H: 4, - I: 1, - J: 8, - K: 5, - L: 1, - M: 3, - N: 1, - O: 1, - P: 3, - Q: 10, - R: 1, - S: 1, - T: 1, - U: 1, - V: 4, - W: 4, - X: 8, - Y: 4, - Z: 10, - }; - let score = 0; - if (word.length >= 7) { - score += 8; - }; - word = word.toUpperCase().split(''); - word.forEach((letter) => { - if (Object.keys(scoreboard).includes(letter)) { - score += scoreboard[letter]; - } - }) - return score; - } + scoreWord, } From 0a3ba9d05ee2934a2c5c7e3c01e3e8b0c4cd3061 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Sun, 17 Nov 2019 14:00:28 -0800 Subject: [PATCH 10/15] get halfway through optional wave 4 --- src/adagrams.js | 25 +++++++++++++++++++++++++ test/adagrams.test.js | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/adagrams.js b/src/adagrams.js index 0b6a004b..1c4ca581 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -135,9 +135,34 @@ const Adagrams = { }, scoreWord, + + winnerAmongWinners(wordsList) { + if (wordsList.length === 1) { + return wordsList; + }; + if (Object.entries(wordsList).filter(([key, value]) => key.length === 10).length === 1) { + return wordsList; + } + }, + + highestScoreFrom(words) { + let wordCollection = {}; + let maxPoints = 0; + words.forEach((word) => { + let score = this.scoreWord(word); + wordCollection[word] = score; + if (score > maxPoints) { + maxPoints = score; + }; + }) + const winningWords = Object.entries(wordCollection).filter(([key, value]) => value === maxPoints) + this.winnerAmongWinners(winningWords); + }, } + + // Do not remove this line or your tests will break! export default Adagrams; diff --git a/test/adagrams.test.js b/test/adagrams.test.js index 371027a0..f9817b33 100644 --- a/test/adagrams.test.js +++ b/test/adagrams.test.js @@ -84,7 +84,7 @@ describe('Adagrams', () => { }); }); - describe.skip('highestScoreFrom', () => { + describe('highestScoreFrom', () => { it('returns a hash that contains the word and score of best word in an array', () => { const words = ['X', 'XX', 'XXX', 'XXXX']; const correct = { word: 'XXXX', score: Adagrams.scoreWord('XXXX') }; From e0bc5fa946196ce2b7107f7ec866ce6faeed838f Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Sun, 17 Nov 2019 15:09:05 -0800 Subject: [PATCH 11/15] change storage of words from object to array --- src/adagrams.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index 1c4ca581..781da596 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -136,27 +136,16 @@ const Adagrams = { scoreWord, - winnerAmongWinners(wordsList) { - if (wordsList.length === 1) { - return wordsList; - }; - if (Object.entries(wordsList).filter(([key, value]) => key.length === 10).length === 1) { - return wordsList; - } - }, - highestScoreFrom(words) { - let wordCollection = {}; + let wordCollection = []; let maxPoints = 0; words.forEach((word) => { let score = this.scoreWord(word); - wordCollection[word] = score; + wordCollection.push({word: word, score: score}); if (score > maxPoints) { maxPoints = score; }; }) - const winningWords = Object.entries(wordCollection).filter(([key, value]) => value === maxPoints) - this.winnerAmongWinners(winningWords); }, } From 688f585fa3ca27d553f502d3a96bc713348bc45e Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Sun, 17 Nov 2019 15:21:50 -0800 Subject: [PATCH 12/15] refactor --- src/adagrams.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index 781da596..0c77d1a7 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -145,13 +145,19 @@ const Adagrams = { if (score > maxPoints) { maxPoints = score; }; + }); + let winners = [] + wordCollection.forEach((object) => { + if (Object.values(object).includes(maxPoints)) { + winners.push(object); + } }) + if (winners.length === 1) { + return winners.first; + } + }, } - - - - // Do not remove this line or your tests will break! export default Adagrams; From 4cb1d4bdee7c132dd9a5b10226ec95519f0b75d5 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Sun, 17 Nov 2019 18:03:24 -0800 Subject: [PATCH 13/15] all tests passing, hooray --- src/adagrams.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/adagrams.js b/src/adagrams.js index 0c77d1a7..c115f012 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -153,11 +153,26 @@ const Adagrams = { } }) if (winners.length === 1) { - return winners.first; + return winners[0]; } + let wordLength = 10; + let shortest = null; + let index = 0; + while (index < winners.length) { + console.log(winners[index].word) + if ((winners[index].word).length === 10) { + return winners[index]; + } + if ((winners[index].word).length < wordLength) { + wordLength = (winners[index].word).length; + shortest = (winners[index]); + } + index += 1; + } + return shortest; + } + } - }, -} // Do not remove this line or your tests will break! export default Adagrams; From 4e182dbf07f5159a5f81434bce9d54be1d93317e Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Sun, 17 Nov 2019 18:10:23 -0800 Subject: [PATCH 14/15] apply finishing touches --- src/adagrams.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/adagrams.js b/src/adagrams.js index c115f012..74554336 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -173,6 +173,5 @@ const Adagrams = { } } - // Do not remove this line or your tests will break! export default Adagrams; From 6c776e07b7e07d75196834d4a79c4d58307123b0 Mon Sep 17 00:00:00 2001 From: Janice Huang Date: Sun, 17 Nov 2019 18:13:10 -0800 Subject: [PATCH 15/15] take out console.log line --- src/adagrams.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/adagrams.js b/src/adagrams.js index 74554336..f81c58ef 100644 --- a/src/adagrams.js +++ b/src/adagrams.js @@ -159,7 +159,6 @@ const Adagrams = { let shortest = null; let index = 0; while (index < winners.length) { - console.log(winners[index].word) if ((winners[index].word).length === 10) { return winners[index]; }