diff --git a/data/quiltData.mjs b/data/quiltData.mjs index d2f1fca..e29326d 100644 --- a/data/quiltData.mjs +++ b/data/quiltData.mjs @@ -38,9 +38,10 @@ let articles = [ answerHtml: `
-
-
-
void
+ + +
+
void
diff --git a/helpers/quilt/maxEnd3.mjs b/helpers/quilt/maxEnd3.mjs index a683051..470f051 100644 --- a/helpers/quilt/maxEnd3.mjs +++ b/helpers/quilt/maxEnd3.mjs @@ -1,18 +1,34 @@ -// window.addEventListener('DOMContentLoaded', (event) => { -// const btn = document.getElementById('maxEnd3Button'); -// btn.addEventListener('click', alert('whipping')); -let dice = {}; - dice.roll5 = function() { - return Math.ceil(5 * Math.random()); +let maxEnd3 = function(inString){ + let inNumbers = inString.split(','); + console.log(`type of inArray is [${typeof inNumbers}] value is [${inNumbers}`); + first = Number(inNumbers[0]); + last = Number(inNumbers[inNumbers.length-1]); + let roleModel = last; + if(first > last){ + roleModel = first; + } + let plateauedNums = inNumbers.map((x) => {return roleModel}); + let outString = plateauedNums.toString(); + return outString; } -dice.show5 = function() { - // dice.el = document.getElementById('diceout'); - console.log( dice.roll5()); -} - -console.log('end maxEnd3.mjs.'); -// }); +/* +PSEUDOCODE +Store input as a string +string to array, let inputNums = stringInput.split(','); +first = inputNums[0]; +last = inputNums[nums.length()-1] +let roleModel = null; +roleModel = last; +if (first > last){roleModel = first} +let plateauedNums = inputNums.map((x) => {return roleModel}); +array to string stringOutput = nums.toString()); +return stringOutput; +*/ -// THIS does not NEED ANY SPECIAL WRAPPER; Its scope will be fine that way. The wrapper blocks its scope otherwise. +/* +Dev reflection: Wasted time doing incorrect comparison because data was string, not number. +Unseen coercion! +e.g. was finding that "3" is greater than "6" +*/ \ No newline at end of file diff --git a/quilt.html b/quilt.html index a1f529f..1e558ee 100644 --- a/quilt.html +++ b/quilt.html @@ -35,6 +35,10 @@ margin-bottom: 1rem; } + .stripe { + text-align: center; + } + /* CSS FONT-DIRECTED no COLOR no POSITIONING */ /* CSS FONT-DIRECTED no COLOR no POSITIONING */ /* CSS FONT-DIRECTED no COLOR no POSITIONING */ @@ -109,6 +113,11 @@ background-color: blue; color: white; } + + .stripe { + color: #ccf; + background-color: #000; + }