From b8548e6ad31c016ba867b40c8536832bca1751ed Mon Sep 17 00:00:00 2001 From: anniebaker Date: Sun, 14 Apr 2019 19:07:54 -0500 Subject: [PATCH 1/2] Pig Latin --- 02week/pigLatin.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/02week/pigLatin.js b/02week/pigLatin.js index 046434c94..b18112cda 100644 --- a/02week/pigLatin.js +++ b/02week/pigLatin.js @@ -1,4 +1,4 @@ -'use strict'; +// 'use strict'; const assert = require('assert'); const readline = require('readline'); @@ -7,20 +7,15 @@ const rl = readline.createInterface({ output: process.stdout }); - function pigLatin(word) { - - // Your code here - } - function getPrompt() { rl.question('word ', (answer) => { console.log( pigLatin(answer) ); getPrompt(); }); -} +}; // Tests From 6e757c3b7d68ea889385257c8e510729690b0435 Mon Sep 17 00:00:00 2001 From: anniebaker Date: Sun, 14 Apr 2019 19:08:47 -0500 Subject: [PATCH 2/2] pig latin commit --- 02week/pigLatin.js | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/02week/pigLatin.js b/02week/pigLatin.js index b18112cda..16b6c074c 100644 --- a/02week/pigLatin.js +++ b/02week/pigLatin.js @@ -7,7 +7,45 @@ const rl = readline.createInterface({ output: process.stdout }); -function pigLatin(word) { +// let arrayLength = (wordArray.length - 1) +// let firstToBack = wordArray.splice(arrayLength,0,wordArray[0]) +// function pigLatin(word) { +// let str = word.trim().toLowerCase(); +// result = str.split(''); +// const vowel = ['a', 'e', 'i', 'o', 'u']; +// if (vowel.includes(str.charAt(0))) { +// return result += 'way'; +// } else { +// for (let i=0; i