diff --git a/css/style.css b/css/style.css index d17d83a..10628e1 100644 --- a/css/style.css +++ b/css/style.css @@ -1,7 +1,11 @@ body { - background-color: navy; + background-color: lightslategray; + color: white; } +a { + color: white; +} object { height: 100vh; diff --git a/index.html b/index.html index ef9a207..76b333f 100644 --- a/index.html +++ b/index.html @@ -36,8 +36,6 @@ - The quickest of brown foxes. - @@ -45,7 +43,6 @@ diff --git a/js/slide22.js b/js/slide22.js index e69de29..74a6b3a 100644 --- a/js/slide22.js +++ b/js/slide22.js @@ -0,0 +1,7 @@ +var num = 0; +do{ + num = prompt("Enter an integer between 1 and 100"); +} while(!(num > 0 && num < 100)); + +console.log("Number squared is: " + num*num); +document.write("

Number squared is: " + num*num + "

"); diff --git a/js/slide23.js b/js/slide23.js index e69de29..f658980 100644 --- a/js/slide23.js +++ b/js/slide23.js @@ -0,0 +1,9 @@ +var u = 0; +var l = 0; + +l = prompt("Enter a 'lower limit' number"); +u = prompt("Enter an 'upper limit' number"); + +for(l; l < u; l++) { + console.log(l + " "); +} \ No newline at end of file diff --git a/js/slide24.js b/js/slide24.js index e69de29..ff160eb 100644 --- a/js/slide24.js +++ b/js/slide24.js @@ -0,0 +1,15 @@ +var myData=[]; +for(let x = 0; x < 10; x++) { + myData.push(1); +} +console.log(myData); + +do { + var cellIndex = prompt("Enter a cell index to change"); + if(cellIndex < 0 || cellIndex >= 10) { break; } + var newValue = prompt("Enter new value for cell index " + cellIndex); + myData[cellIndex] = newValue; + console.log("New array:" + myData) +} while(cellIndex >= 0 && cellIndex < 10); + + diff --git a/js/slide25.js b/js/slide25.js index e69de29..af1afb4 100644 --- a/js/slide25.js +++ b/js/slide25.js @@ -0,0 +1,15 @@ +var myData=[]; +for(let x = 0; x < 10; x++) { + myData.push(1); +} +console.log(myData); + +console.log("Simulating user input for slide 25...."); +var y = 0; +for(let x = 0; x < 10; x++) { + y += 5; + console.log("Changing value in index " + x + " to " + y); + myData[x] = y; +} + +console.log(myData) \ No newline at end of file diff --git a/js/slide26.js b/js/slide26.js index e69de29..911e262 100644 --- a/js/slide26.js +++ b/js/slide26.js @@ -0,0 +1,22 @@ +var fibonacci = [0, 1]; +for(let x = 0; x < 58; x++) { + fibonacci.push(fibonacci[x] + fibonacci[x+1]); +} +console.log("f(0) to f(59)"); +console.log(fibonacci); + +// function fibonacci(n) { +// if(n == 0) { +// return 0; +// } +// if(n == 1) { +// return 1; +// } +// else { +// fibonacci(n) = fibonacci(n-1) + fibonacci(n-2); +// } +// } + +// for(let x = 0; x < 59; x++) { +// console.log(fibonacci(x)); +// } \ No newline at end of file