From e8d89dff2b4c109f92709ad63588b3a59920e206 Mon Sep 17 00:00:00 2001 From: ddsheard Date: Wed, 15 Mar 2017 09:33:20 -0400 Subject: [PATCH 01/19] put sections next to each other --- index.html | 5 +++++ main.css | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/index.html b/index.html index c178261..4e3432c 100644 --- a/index.html +++ b/index.html @@ -19,6 +19,7 @@

The Quiz Page

+

Problems

There are lots of them. We'll address four:

@@ -28,10 +29,14 @@

Problems

  • the image isn't showing up
  • the background color isn't either
  • +
    +
    +

    Solutions

    Partner up and each pair take one issue. (Communicate on Slack to make sure all the issues are covered.) One person in each pair will fork this repo and clone it. That person will then type what the other member of the pair says to fix the issue. Once your issue is fixed, commit the change and push back to your fork on GitHub.

    +
    + From 5a7b6f07169040f39535c2539d3bea5c8c007f68 Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 27 Mar 2017 10:16:28 -0400 Subject: [PATCH 05/19] quiz updated from class review --- fizzbuzz.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index 17629a6..50d6344 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -1,19 +1,15 @@ -var myArray = []; -for (var i = 0; i <= 100; i++) { + +for (var i = 1; i <= 100; i++) { if (i%3 === 0 && i%5 === 0) { - let answer = "fizzbuzz"; - console.log(answer); + console.log("fizzbuzz"); } else if (i%3 === 0 ) { - let answer = "fizz"; - console.log(answer); + console.log("fizz"); } else if (i%5 === 0) { - let answer = "buzz"; - console.log(answer); + console.log("buzz"); } else { - let answer = [i]; - console.log(answer); + console.log(i); } } From acbb5d4a6379656a391f6ed029180446a7b1964e Mon Sep 17 00:00:00 2001 From: ddsheard Date: Wed, 29 Mar 2017 10:40:56 -0400 Subject: [PATCH 06/19] quiz anser. TY Chris --- index.html | 2 +- index.js | 82 +++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 67 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 23bc84b..db5e2dd 100644 --- a/index.html +++ b/index.html @@ -37,7 +37,7 @@

    Pictures

    Prime Number Button

    - +
    diff --git a/index.js b/index.js index ef4b351..7a53363 100644 --- a/index.js +++ b/index.js @@ -4,21 +4,71 @@ let picElement= document.querySelector("p img"); picElement.src="http://fillmurray.com/100/100"; }*/ -function showPicSize (event){ - let button = event.target; - let whereThePictureGoes = document.querySelector("p img"); - let size = button.dataset.size; - whereThePictureGoes.src = "http://fillmurray.com/"+size+"/"+size; -/* console.log( "http://fillmurray.com/400/400"); -let picElement= document.querySelector("p img"); -picElement.src="http://fillmurray.com/400/400";*/ -} - -let sizeButtons= document.querySelectorAll("button"); -//smallPic.addEventListener("click", showSmallPic); -for (let i=0; i < sizeButtons.length; i++){ - let button = sizeButtons[i]; - button.addEventListener("click", showPicSize); -} +// function showPicSize (event){ +// let button = event.target; +// let whereThePictureGoes = document.querySelector("p img"); +// let size = button.dataset.size; +// whereThePictureGoes.src = "http://fillmurray.com/"+size+"/"+size; +// /* console.log( "http://fillmurray.com/400/400"); +// let picElement= document.querySelector("p img"); +// picElement.src="http://fillmurray.com/400/400";*/ +// } +// +// let sizeButtons= document.querySelectorAll("button"); +// //smallPic.addEventListener("click", showSmallPic); +// for (let i=0; i < sizeButtons.length; i++){ +// let button = sizeButtons[i]; +// button.addEventListener("click", showPicSize); +// } //let bigPic= document.querySelector(".larger"); //bigPic.addEventListener("click", showBigPic); + + +//1. Count clicks on button +//2. Choose if num of clicks is prime + +let clicks = 0; + function clickME() { + clicks += 1; + //document.getElementById("clicks").textContent = clicks; + mySpan.textContent = clicks; + let count = 0; + for (let i = 1; i <= clicks; i++) { + if (clicks % i === 0){ + count++ + } + } + if (count === 2){ + alert('prime number'); + } +} +let button = document.querySelector(".prime") +button.addEventListener('click', clickME) + +let mySpan = document.querySelector(".number") + + + + + + +// let clicks = 0; +// +// function onClick (){ +// pickles += 1; +// pickles = document.querySelector("button.prime"); +// // document.querySelector.span.number.textContent = pickles; +// console.log(pickles); +// } +// +// // +// button.prime.addEventListener("click", onClick); + + +// let buttons - document.querySelector('button.prime'); +// for (let i = 0; i < buttons.length; i++) { +// let button = buttons[i]; +// button.addEventListener('click', function (){ +// let whereTheNumberGoes +// }) +// } From 59eca3c1801e746f7a179266d25826aae6bea52e Mon Sep 17 00:00:00 2001 From: ddsheard Date: Tue, 4 Apr 2017 09:05:53 -0400 Subject: [PATCH 07/19] idk --- index.js | 55 ++++++++++++++----------------------------------------- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/index.js b/index.js index 7a53363..806cc18 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,8 @@ // code below this line /*function showSmallPic (){ - console.log("http://fillmurray.com/100/100"); +console.log("http://fillmurray.com/100/100"); let picElement= document.querySelector("p img"); - picElement.src="http://fillmurray.com/100/100"; +picElement.src="http://fillmurray.com/100/100"; }*/ // function showPicSize (event){ // let button = event.target; @@ -27,48 +27,21 @@ let picElement= document.querySelector("p img"); //1. Count clicks on button //2. Choose if num of clicks is prime -let clicks = 0; - function clickME() { - clicks += 1; - //document.getElementById("clicks").textContent = clicks; - mySpan.textContent = clicks; - let count = 0; - for (let i = 1; i <= clicks; i++) { - if (clicks % i === 0){ - count++ - } - } - if (count === 2){ - alert('prime number'); +let clicks = 0; //give clicks a value +function clickME() { + clicks += 1; //incriment value by 1 each time + mySpan.textContent = clicks; + let count = 0; + for (let i = 1; i <= clicks; i++) { + if (clicks % i === 0) { + count++ } + } + if (count === 2) { + alert('prime number'); + } } let button = document.querySelector(".prime") button.addEventListener('click', clickME) let mySpan = document.querySelector(".number") - - - - - - -// let clicks = 0; -// -// function onClick (){ -// pickles += 1; -// pickles = document.querySelector("button.prime"); -// // document.querySelector.span.number.textContent = pickles; -// console.log(pickles); -// } -// -// // -// button.prime.addEventListener("click", onClick); - - -// let buttons - document.querySelector('button.prime'); -// for (let i = 0; i < buttons.length; i++) { -// let button = buttons[i]; -// button.addEventListener('click', function (){ -// let whereTheNumberGoes -// }) -// } From fa52fb74c36582ed9cab1a449d21791c6c386354 Mon Sep 17 00:00:00 2001 From: ddsheard Date: Tue, 4 Apr 2017 10:41:45 -0400 Subject: [PATCH 08/19] quiz --- euler.js | 36 ++++++++++++++++++++++++++++++++++++ index.html | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 euler.js diff --git a/euler.js b/euler.js new file mode 100644 index 0000000..3006e60 --- /dev/null +++ b/euler.js @@ -0,0 +1,36 @@ +// var x = 1; +// +// function euler (){ +// +// for (i=999; i>=100; i--){ +// return x * i; +// } +// console.log(x); +// } + +function euler() { + let x; + let y; + let z; + let i = 999; + let palindrome = 0; + let factor2 = 0; + + for (x = 9; x > 0; x--){ + for (y = 9; y >= 0; y--){ + for (z = 9; z >= 0; z--){ + palindrome = 100001 * x + 10010 * y + 1100 * z; + for (i = 999; i >= 100; i--) { + if (palindrome % i === 0) { + factor2 = palindrome / i + if(factor2 > 999) break; + if(factor2 >= 100) { + return (palindrome); + } + } + } + } + } + } +} +console.log(euler()); diff --git a/index.html b/index.html index 356adcf..04abaf8 100644 --- a/index.html +++ b/index.html @@ -51,7 +51,7 @@

    Prime Number Button

    - + From 790d5287ddccf500903c010f06fe280adb0cc331 Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 09:13:05 -0400 Subject: [PATCH 09/19] changes --- englishify.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 englishify.js diff --git a/englishify.js b/englishify.js new file mode 100644 index 0000000..4d811df --- /dev/null +++ b/englishify.js @@ -0,0 +1,29 @@ +// function englishify (num) { +// console.log(num.toString('one')); +// } +// englishify(1); + +let a = [ '', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', +'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']; + +function englishify(number) { + return a[number]; +} +console.log(englishify(10)); +// +// let num (){ +// 0: "zero", +// 1: "one", +// 2: "two", +// 3: "three", +// 4: "four", +// 5: "five", +// 6: "six", +// +// } +// +// function englishify(num) { +// if (num >= 0 && nem <= 20) { +// retrun numbers[num]; +// } +// } From 6e6ee2c5d39fe33b490729f71221489d92383587 Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 09:52:53 -0400 Subject: [PATCH 10/19] update englishify --- englishify.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/englishify.js b/englishify.js index cc9a0a6..69cf076 100644 --- a/englishify.js +++ b/englishify.js @@ -20,14 +20,20 @@ let numbers = { 17: 'seventeen', 18: 'eighteen', 19: 'nineteen', - 20: 'twenty' + 20: 'twenty', + 30: 'thirty' } function englishify(num) { - if (num >= 0 && num <= 20) { - return numbers[num]; + if ((num.toString().length == 2) && (num.toString().split("")[1]!= 0)) { + if (num.toString().split("")[0] == 2){ + return "twenty-" + numbers[num.toString().split("")[1]] ; + } + if (num.toString().split("")[0] == 3){ + return "thirty-" + numbers[num.toString().split("")[1]] ; + } } - return 'Please enter a number between 0 and 20 inclusive.'; + return numbers[num]; } -console.log( englishify(1) ); +console.log( englishify(5) ); From cc9bed79fe6ca6f0e2ce82b6165a38407d9a3df1 Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 10:06:12 -0400 Subject: [PATCH 11/19] fixing issues --- euler.js | 3 +-- fizzbuzz.js | 15 --------------- index.html | 7 ++++--- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/euler.js b/euler.js index 209f45d..0b3971c 100644 --- a/euler.js +++ b/euler.js @@ -25,5 +25,4 @@ function multiply(){ } let results = multiply(); - -console.log(results[0] + ' is the answer.'); \ No newline at end of file +console.log(results[0] + ' is the answer.'); diff --git a/fizzbuzz.js b/fizzbuzz.js index ddb69eb..50d6344 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -1,17 +1,3 @@ -<<<<<<< HEAD -let printValue; -for (i=1; i<=100; i++){ - if (i%15 == 0){ - printValue = "fizzbuzz"; - }else if (i%3 == 0){ - printValue = "fizz"; - }else if (i%5 == 0){ - printValue = "buzz"; - }else { - printValue = i; - } - console.log(printValue); -======= for (var i = 1; i <= 100; i++) { if (i%3 === 0 && i%5 === 0) { @@ -26,5 +12,4 @@ for (var i = 1; i <= 100; i++) { else { console.log(i); } ->>>>>>> 5a7b6f07169040f39535c2539d3bea5c8c007f68 } diff --git a/index.html b/index.html index 4785aa1..b261831 100644 --- a/index.html +++ b/index.html @@ -47,13 +47,14 @@

    Prime Number Button

    © The Iron Yard 2017

    - + + + - + --> From 983875f50d4a278e8347322b189ae1c70426967a Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 10:09:31 -0400 Subject: [PATCH 12/19] changed euler.js --- euler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/euler.js b/euler.js index 0b3971c..b83dc9f 100644 --- a/euler.js +++ b/euler.js @@ -1,4 +1,3 @@ - function paldindromeTest(number) { let arr = (""+number).split(""); let numArr = (""+number).split(""); @@ -25,4 +24,5 @@ function multiply(){ } let results = multiply(); + console.log(results[0] + ' is the answer.'); From 48a93ccb73ea8bba8cff063d64ef1c078e7d5acb Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 10:12:46 -0400 Subject: [PATCH 13/19] update fizzbuzz.js --- fizzbuzz.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index 50d6344..c29d33e 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -1,15 +1,14 @@ +let printValue; +for (i=1; i<=100; i++){ + if (i%15 == 0){ + printValue = "fizzbuzz"; + }else if (i%3 == 0){ + printValue = "fizz"; + }else if (i%5 == 0){ + printValue = "buzz"; + }else { + printValue = i; + } + console.log(printValue); -for (var i = 1; i <= 100; i++) { - if (i%3 === 0 && i%5 === 0) { - console.log("fizzbuzz"); - } - else if (i%3 === 0 ) { - console.log("fizz"); - } - else if (i%5 === 0) { - console.log("buzz"); - } - else { - console.log(i); - } } From 386574233a6fbd8d9b8a3ce12861ff9d7abb6237 Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 10:13:56 -0400 Subject: [PATCH 14/19] updated fizzbuzz.js --- fizzbuzz.js | 1 - 1 file changed, 1 deletion(-) diff --git a/fizzbuzz.js b/fizzbuzz.js index c29d33e..f7411e9 100644 --- a/fizzbuzz.js +++ b/fizzbuzz.js @@ -10,5 +10,4 @@ for (i=1; i<=100; i++){ printValue = i; } console.log(printValue); - } From 4dfe3a024298f700a5f58636356d9930fcf47b2d Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 10:17:46 -0400 Subject: [PATCH 15/19] update index.js --- index.js | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/index.js b/index.js index 42874bb..1c6cb72 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,10 @@ // code below this line - /*function showSmallPic (){ console.log("http://fillmurray.com/100/100"); let picElement= document.querySelector("p img"); picElement.src="http://fillmurray.com/100/100"; }*/ - function showPicSize (event){ let button = event.target; let whereThePictureGoes = document.querySelector("p img"); @@ -25,26 +23,3 @@ for (let i=0; i < sizeButtons.length; i++){ } //let bigPic= document.querySelector(".larger"); //bigPic.addEventListener("click", showBigPic); - - -//1. Count clicks on button -//2. Choose if num of clicks is prime - -let clicks = 0; //give clicks a value -function clickME() { - clicks += 1; //incriment value by 1 each time - mySpan.textContent = clicks; - let count = 0; - for (let i = 1; i <= clicks; i++) { - if (clicks % i === 0) { - count++ - } - } - if (count === 2) { - alert('prime number'); - } -} -let button = document.querySelector(".prime") -button.addEventListener('click', clickME) - -let mySpan = document.querySelector(".number") From febdd3254c8e9f7ff70cc0ef08707b35e6fc9672 Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 10:18:30 -0400 Subject: [PATCH 16/19] index.html --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index b261831..b887874 100644 --- a/index.html +++ b/index.html @@ -31,14 +31,13 @@

    Buttons

  • -

    Pictures

    Prime Number Button

    - +
    From d425f8f55ab591fc2eadae9ba2990ab21af74eb0 Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 10:19:48 -0400 Subject: [PATCH 17/19] update main.css --- main.css | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/main.css b/main.css index d62b56a..e2659c3 100644 --- a/main.css +++ b/main.css @@ -52,18 +52,3 @@ nav ul { /* issue 13 goes under here */ -section{ - position: relative; -} -article { - position: relative; - width:250px; -} - -.a{ - left: 0px; -} - -.b{ -left: 450px; -} From 72b594b560314942c71c375833ef28fa096fa33e Mon Sep 17 00:00:00 2001 From: ddsheard Date: Mon, 10 Apr 2017 10:21:55 -0400 Subject: [PATCH 18/19] index.js updates --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1c6cb72..2a38b56 100644 --- a/index.js +++ b/index.js @@ -1,9 +1,9 @@ // code below this line /*function showSmallPic (){ -console.log("http://fillmurray.com/100/100"); + console.log("http://fillmurray.com/100/100"); let picElement= document.querySelector("p img"); -picElement.src="http://fillmurray.com/100/100"; + picElement.src="http://fillmurray.com/100/100"; }*/ function showPicSize (event){ let button = event.target; From e3a543458f7d23b20760c99c4d62dbbe0a856878 Mon Sep 17 00:00:00 2001 From: Brian Gates Date: Tue, 11 Apr 2017 08:59:57 -0400 Subject: [PATCH 19/19] refactor englishify --- englishify.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/englishify.js b/englishify.js index 69cf076..01732ff 100644 --- a/englishify.js +++ b/englishify.js @@ -25,12 +25,13 @@ let numbers = { } function englishify(num) { - if ((num.toString().length == 2) && (num.toString().split("")[1]!= 0)) { - if (num.toString().split("")[0] == 2){ - return "twenty-" + numbers[num.toString().split("")[1]] ; + let ones = num % 10; + if ((num >= 10) && (ones !== 0)) { + if (num < 30){ + return "twenty-" + numbers[ones] ; } - if (num.toString().split("")[0] == 3){ - return "thirty-" + numbers[num.toString().split("")[1]] ; + if (num < 40){ + return "thirty-" + numbers[ones] ; } } return numbers[num];