diff --git a/data/baseballReferenceArrayPitching.js b/data/baseballReferenceArrayPitching.js new file mode 100644 index 0000000..af60517 --- /dev/null +++ b/data/baseballReferenceArrayPitching.js @@ -0,0 +1,32 @@ +const staffPitchingSummary = [['Tm', '#P', 'PAge', 'RA/G', 'W', 'L', 'W-L%', 'ERA', 'G', 'GS', 'GF', 'CG', 'tSho', 'cSho', 'SV', 'IP', 'H', 'R', 'ER', 'HR', 'BB', 'IBB', 'SO', 'HBP', 'BK', 'WP', 'BF', 'ERA+', 'FIP', 'WHIP', 'H9', 'HR9', 'BB9', 'SO9', 'SO/W', 'LOB'], +['Arizona Diamondbacks' , 39, 28.6, 5.59, 45, 93,.326,5.16,138,138,135,3,4,3,19,1207.2,1268,771,692,194,478,40,1060,66,7,39,5358,81,4.85,1.446,9.4,1.4,3.6,7.9,2.22,964], +['Atlanta Braves' ,28,29.5,4.18,72,64,.529,3.99,136,136,135,1,15,1,32,1185.0,1065,569,526,156,435,17,1205,58,8,64,5022,110,4.09,1.266,8.1,1.2,3.3,9.2,2.77,898], +['Baltimore Orioles' ,36,28.3,5.85,43,92,.319,5.79,135,135,134,1,3,1,20,1168.1,1244,790,751,208,479,7,1075,59,7,75,5207,81,5.02,1.475,9.6,1.6,3.7,8.3,2.24,912], +['Boston Red Sox',34,29.8,4.61,79,60,.568,4.32,139,139,139,0,6,0,43,1213.1,1210,641,583,150,470,24,1295,72,5,55,5268,109,3.98,1.385,9.0,1.1,3.5,9.6,2.76,987], +['Chicago Cubs' ,38,29.7,5.02,63,75,.457,4.68,138,138,137,1,7,0,35,1206.1,1161,693,627,198,504,19,1182,84,4,51,5280,92,4.80,1.380,8.7,1.5,3.8,8.8,2.35,968], +['Chicago White Sox' ,25,28.3,4.01,79,58,.577,3.79,137,137,133,4,11,3,37,1188.1,1011,550,501,165,413,16,1358,42,6,70,4968,113,3.83,1.198,7.7,1.2,3.1,10.3,3.29,853], +['Cincinnati Reds' ,32,29.0,4.72,73,65,.529,4.40,138,138,137,1,7,1,37,1224.2,1132,651,599,176,540,26,1298,59,7,48,5304,107,4.38,1.365,8.3,1.3,4.0,9.5,2.40,979], +['Cleveland Indians' ,23,26.2,4.54,68,66,.507,4.36,134,134,134,0,7,0,36,1173.0,1056,608,568,175,457,12,1190,54,8,44,4995,103,4.38,1.290,8.1,1.3,3.5,9.1,2.60,868], +['Colorado Rockies' ,25,28.3,4.85,63,74,.460,4.72,137,137,134,3,5,1,26,1181.1,1156,664,620,167,455,15,1081,52,3,57,5089,101,4.46,1.364,8.8,1.3,3.5,8.2,2.38,881], +['Detroit Tigers' ,29,27.4,4.80,65,73,.471,4.43,138,138,136,2,5,1,34,1206.2,1176,662,594,180,477,9,1084,72,2,71,5250,96,4.67,1.370,8.8,1.3,3.6,8.1,2.27,968], +['Houston Astros' ,30,28.8,4.00,79,57,.581,3.71,136,136,134,2,7,0,30,1209.1,1025,544,499,160,446,7,1235,61,3,62,5066,116,4.10,1.216,7.6,1.2,3.3,9.2,2.77,894], +['Kansas City Royals',25,28.2,4.85,61,75,.449,4.67,136,136,136,0,6,0,30,1191.1,1156,659,618,162,514,15,1169,49,9,75,5168,98,4.39,1.402,8.7,1.2,3.9,8.8,2.27,935], +['Los Angeles Angels',37,28.9,5.00,68,69,.496,4.71,137,137,136,1,3,0,35,1199.2,1155,685,628,166,497,13,1260,61,8,51,5225,96,4.26,1.377,8.7,1.2,3.7,9.5,2.54,941], +['Los Angeles Dodgers',39,28.7,3.48,86,51,.628,3.00,137,137,136,1,14,0,44,1230.0,937,477,410,141,426,42,1364,53,5,41,5048,133,3.61,1.108,6.9,1.0,3.1,10.0,3.20,881], +['Miami Marlins' ,33,27.4,4.21,57,80,.416,3.90,137,137,136,1,7,0,26,1197.2,1070,577,519,138,439,34,1153,74,2,45,5071,107,4.02,1.260,8.0,1.0,3.3,8.7,2.63,901], +['Milwaukee Brewers' ,36,28.1,3.75,84,54,.609,3.42,138,138,136,2,16,1,38,1225.0,984,517,466,136,470,18,1380,67,9,53,5122,124,3.67,1.187,7.2,1.0,3.5,10.1,2.94,930], +['Minnesota Twins' ,34,30.1,5.34,59,77,.434,5.00,136,136,135,1,6,0,33,1191.0,1177,726,662,209,406,12,1099,49,2,44,5113,85,4.75,1.329,8.9,1.6,3.1,8.3,2.71,814], +['New York Mets',41,29.3,3.99,69,68,.504,3.79,137,137,135,2,8,1,37,1162.1,1007,546,489,156,395,19,1229,61,1,50,4848,105,3.96,1.206,7.8,1.2,3.1,9.5,3.11,815], +['New York Yankees',28,29.4,3.99,78,58,.574,3.65,136,136,133,3,11,2,42,1203.0,1012,543,488,154,404,9,1299,45,7,67,4987,117,3.79,1.177,7.6,1.2,3.0,9.7,3.22,835], +['Oakland Athletics' ,26,30.2,4.12,74,63,.540,3.90,137,137,134,3,11,3,34,1212.2,1125,564,526,160,371,10,1126,51,2,58,5094,106,4.07,1.234,8.3,1.2,2.8,8.4,3.04,892], +['Philadelphia Phillies' ,31,28.9,4.67,70,66,.515,4.43,136,136,132,4,9,3,32,1191.2,1119,635,586,173,427,33,1233,60,3,42,5101,92,4.21,1.297,8.5,1.3,3.2,9.3,2.89,891], +['Pittsburgh Pirates' ,34,27.6,5.17,48,89,.350,5.13,137,137,137,0,5,0,18,1176.1,1171,708,670,180,507,19,1109,68,3,49,5168,82,4.74,1.426,9.0,1.4,3.9,8.5,2.19,931], +['San Diego Padres',30,29.6,4.08,73,64,.533,3.77,137,137,135,2,11,2,40,1217.0,1071,559,510,162,426,28,1300,74,1,43,5121,103,3.99,1.230,7.9,1.2,3.2,9.6,3.05,911], +['Seattle Mariners' ,37,27.9,4.58,75,62,.547,4.27,137,137,136,1,10,0,41,1217.1,1150,628,578,162,402,16,1110,62,3,49,5149,97,4.21,1.275,8.5,1.2,3.0,8.2,2.76,869], +['San Francisco Giants',33,29.8,3.70,87,50,.635,3.26,137,137,135,2,15,2,48,1226.2,1026,507,445,131,366,15,1200,55,6,42,5050,129,3.63,1.135,7.5,1.0,2.7,8.8,3.28,863], +['St.Louis Cardinals',31,29.8,4.29,69,66,.511,4.11,135,135,132,3,13,1,37,1178.0,1038,579,538,123,529,28,1032,82,4,60,5078,95,4.32,1.330,7.9,0.9,4.0,7.9,1.95,965], +['Tampa Bay Rays',37,28.9,4.08,86,51,.628,3.69,137,137,136,1,10,0,38,1233.1,1080,559,505,153,378,22,1280,49,5,55,5094,108,3.74,1.182,7.9,1.1,2.8,9.3,3.39,835], +['Texas Rangers' ,32,28.0,4.96,48,88,.353,4.67,136,136,136,0,2,0,23,1196.1,1179,674,621,198,428,11,1046,47,0,55,5125,93,4.76,1.343,8.9,1.5,3.2,7.9,2.44,862], +['Toronto Blue Jays',38,29.2,4.13,73,62,.541,3.89,135,135,134,1,13,1,26,1171.1,1054,557,506,166,398,9,1217,57,3,42,4942,116,4.09,1.240,8.1,1.3,3.1,9.4,3.06,871], +['Washington Nationals' ,31,30.5,5.02,56,80,.412,4.74,136,136,135,1,7,0,30,1164.2,1130,683,614,202,434,40,1123,60,1,33,5048,86,4.76,1.343,8.7,1.6,3.4,8.7,2.59,871], +]; // end of two d array diff --git a/data/quiltData.mjs b/data/quiltContent.mjs similarity index 69% rename from data/quiltData.mjs rename to data/quiltContent.mjs index 18cc486..e897531 100644 --- a/data/quiltData.mjs +++ b/data/quiltContent.mjs @@ -10,18 +10,23 @@ For example, if the title is maxEnd3, the file is maxEnd3.mjs and the div will b ******/ let articles = [ { - backgroundColor: '#493', - textColor: '#ddf', - title: 'Hotdogging', - question: 'How do you grab a div?', - strategy: 'GetElementById()!', + backgroundColor: '#930', + textColor: '#ffa', + title: 'Team Pitching', + question: 'Statistics from Baseball Reference', + strategy: 'null', form: '

Placeholder

', linkToCodeRepo: 'https://github.com/atom-box/codingBatJS/blob/master/textSimilarity.html', testElement: '

dogfish - dogfish - dogfish - dogfish

', inputs: [], predictedOutputs: [], answerHtml: - ``, + ` + + `, + + //

${teamPitching()} all day, every day

+ }, { backgroundColor: '#256', @@ -47,6 +52,20 @@ let articles = [ ` }, +{ + backgroundColor: '#493', + textColor: '#ddf', + title: 'Unused', + question: 'Statistics from Baseball Reference', + strategy: 'null', + form: '

Placeholder

', + linkToCodeRepo: 'https://github.com/atom-box/codingBatJS/blob/master/textSimilarity.html', + testElement: '

dogfish - dogfish - dogfish - dogfish

', + inputs: [], + predictedOutputs: [], + answerHtml: + ``, +}, ] diff --git a/helpers/quilt/teamPitching.mjs b/helpers/quilt/teamPitching.mjs new file mode 100644 index 0000000..387f804 --- /dev/null +++ b/helpers/quilt/teamPitching.mjs @@ -0,0 +1,25 @@ +console.log('loaded TEAMPITCHING FUNCTIONFILE'); +let teamPitching = function(){ + console.log(staffPitchingSummary[1][1]); + return staffPitchingSummary[1][1]; +} + + +/* +PSEUDOCODE +Make aTWINNED 2-d array for the third category: age = [[twowordteamname, pitcherage], ] + read a flat file, line by line +Take the entered team name and return their age + regex pattern is... + reduce the array to the matching pattern or return 'not found' string +display that +*/ + +/* +TODO +add args to the function above +*/ + + +/* Reflection +*/ \ No newline at end of file diff --git a/helpers/quiltMain.js b/helpers/quiltMain.js index d875703..9d60f91 100644 --- a/helpers/quiltMain.js +++ b/helpers/quiltMain.js @@ -19,8 +19,8 @@ articles.forEach(element => {

Challenge:

${element.question}

`; singleDiv += `

Solution:

`; - singleDiv += `
`; - singleDiv += `
`; + // singleDiv += `
`; + // singleDiv += `
`; singleDiv += element.answerHtml; singleDiv += `
`; diff --git a/helpers/staging.html b/helpers/staging.html index 4fbf442..02d2020 100644 --- a/helpers/staging.html +++ b/helpers/staging.html @@ -13,41 +13,40 @@ /* CSS POSITIONING INCLUDING FONT*/ /* CSS POSITIONING INCLUDING FONT*/ - header { - text-align: center; + + @media only screen and (min-width: 600px) { + + /* For tablets: */ + .gutters { + padding-left: 9rem; + padding-right: 9rem; + } } -/* todo: these were imported for the form, may need finessing */ - .square-small { - border-radius: 3rem; - border: solid var(--dark1) 0.8rem; - margin: auto 5rem; - height: 15rem; - min-width: 12rem; - display: flex; - /*(1)VERT*/ - flex-direction: row; - /*(1)VERT*/ - align-items: center; - /*(1)VERT*/ - justify-content: center; - /*(2)HORIZ*/ - text-align: center; + @media only screen and (min-width: 1000px) { + .gutters { + padding-left: 19rem; + padding-right: 19rem; + } } - .core { + header { text-align: center; - margin: 1rem auto; - overflow-wrap: break-word; + margin-bottom: 1rem; } .stripe { - height: 8rem; - width: 15rem; - background-color: var(--dark1); - overflow: scroll; + text-align: center; + } + + .top-bottom-space { + padding-top: 3.4rem; + padding-bottom: 3.4rem; } + .white-box { + padding: 3rem; + } /* CSS FONT-DIRECTED no COLOR no POSITIONING */ /* CSS FONT-DIRECTED no COLOR no POSITIONING */ @@ -76,14 +75,6 @@ --main-color: #F45B69; } - #articlesAnchor { - background-color: yellow; - } - - article.card.text-center { - xxxmargin-bottom: 1rem; - } - header { width: 100%; padding: 8px; @@ -91,6 +82,10 @@ background-color: #999; } + #articlesAnchor { + background-color: yellow; + } + .overlay { position: absolute; bottom: 0; @@ -123,13 +118,19 @@ color: white; } - .blueBackground { - background-color: blue; - color: white; + .white-box { + border: #ccc solid 0.08rem; + } + + S.stripe { + color: #ccf; + background-color: #000; + border: grey solid 0.2rem; + border-radius: 0.2rem; } - + diff --git a/index.html b/index.html index 9d34b88..e3752bc 100755 --- a/index.html +++ b/index.html @@ -50,6 +50,7 @@

Coding Bat

  • Grab Bag I coding challenges.
  • Grab Bag II coding challenges.
  • Recursive implementation of SelectionSort.js: code and screenshot
  • +
  • Gray Arrays
  • First Word, Last Word
  • Maya Calendar with image mapping
  • How Similar Are Two Word Lists? (for ShareRewards.com 10/9/2019)
  • diff --git a/quilt.html b/quilt.html index 4f3e6f2..0910eb8 100644 --- a/quilt.html +++ b/quilt.html @@ -167,7 +167,9 @@

    Making things work in Madison, Wisconsin: - + + +