From 1c0bd37e6fbad7566822eba90626a244a2a71607 Mon Sep 17 00:00:00 2001 From: ewwjackson Date: Thu, 2 Mar 2017 20:11:03 -0800 Subject: [PATCH 1/3] add arrayValuesGreaterThanY function --- dookieBreathe.test | 0 greaterthanY.js | 14 ++++++++++++++ odd.js | 13 ++++++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) delete mode 100644 dookieBreathe.test create mode 100644 greaterthanY.js diff --git a/dookieBreathe.test b/dookieBreathe.test deleted file mode 100644 index e69de29..0000000 diff --git a/greaterthanY.js b/greaterthanY.js new file mode 100644 index 0000000..bede4d1 --- /dev/null +++ b/greaterthanY.js @@ -0,0 +1,14 @@ +function arrayValuesGreaterThanY(inputArray, threshold) { + var count = 0; + for(i=0; i threshold){ + count++; + } + } + console.log("There were", count+"values greater than, ",threshold +" in the array.") +} + +var test = [21, 3, 5, 6, 9, 11, 44, 45]; +var threshold = 6; + +arrayValuesGreaterThatY(test,threshold); diff --git a/odd.js b/odd.js index bcb0dd4..d25afdb 100644 --- a/odd.js +++ b/odd.js @@ -1,7 +1,14 @@ -function printoddnum() { + +function createOddArray1to255() { + var y = []; for (var i = 1; i <= 255; i++) { - if (i % 2 === 1){ - console.log(i) + if(i%2 === 1) { + //I could push this + // y.push(i); + //y[i] = i; + y[y.length] = i; } } + return y; } +console.log("My function returned:",createOddArray1to255()); From a9f2eea5c89b9e9793f18bf7fb6f0db93f995d0f Mon Sep 17 00:00:00 2001 From: ewwjackson Date: Wed, 8 Mar 2017 19:45:31 -0800 Subject: [PATCH 2/3] new algorithms --- maxMinAvg.js | 0 noNegativeNumber.js | 11 +++++++++++ squarevaluesinanarray | 0 squarevaluesinanarray.js | 11 +++++++++++ 4 files changed, 22 insertions(+) create mode 100644 maxMinAvg.js create mode 100644 noNegativeNumber.js create mode 100644 squarevaluesinanarray create mode 100644 squarevaluesinanarray.js diff --git a/maxMinAvg.js b/maxMinAvg.js new file mode 100644 index 0000000..e69de29 diff --git a/noNegativeNumber.js b/noNegativeNumber.js new file mode 100644 index 0000000..3eb6f5c --- /dev/null +++ b/noNegativeNumber.js @@ -0,0 +1,11 @@ +function noNegativeNumber(x) { + for(i=0;i Date: Sun, 12 Mar 2017 11:15:51 -0700 Subject: [PATCH 3/3] negative to floodgate algorithms --- floodgate.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 floodgate.js diff --git a/floodgate.js b/floodgate.js new file mode 100644 index 0000000..fe89c03 --- /dev/null +++ b/floodgate.js @@ -0,0 +1,9 @@ +function negativeToFloodgate(x) { + for(i=0;i