From c76872a13ecb1fc53ea0d972332f1c2381fdf0f8 Mon Sep 17 00:00:00 2001 From: bradybodily Date: Mon, 9 Apr 2018 22:49:33 -0600 Subject: [PATCH] fixed offset bug --- .idea/cs2610hw6.iml | 11 ++ .../inspectionProfiles/profiles_settings.xml | 7 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 177 ++++++++++++++++++ .../.idea/workspace.xml | 163 ++++++++++++++++ fib.js | 17 +- style.css | 9 + 9 files changed, 397 insertions(+), 5 deletions(-) create mode 100644 .idea/cs2610hw6.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 cs2610-fibonacci-javascript-dom/.idea/workspace.xml diff --git a/.idea/cs2610hw6.iml b/.idea/cs2610hw6.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ b/.idea/cs2610hw6.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..c23ecac --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..0ed3b43 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..be9c67e --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..efae28c --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1523334173410 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cs2610-fibonacci-javascript-dom/.idea/workspace.xml b/cs2610-fibonacci-javascript-dom/.idea/workspace.xml new file mode 100644 index 0000000..6354859 --- /dev/null +++ b/cs2610-fibonacci-javascript-dom/.idea/workspace.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1523324314126 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/fib.js b/fib.js index 142771a..989e5b4 100644 --- a/fib.js +++ b/fib.js @@ -17,12 +17,19 @@ div.appendChild(para); var computefib = function(sliderPos){ var now = 0; var last = 0; - if(sliderPos === 0) { - return 0; - } - for(var i = 0; i < sliderPos; i++){ - if(last === 1 && i === 2){ + + for(var i = 0; i <= sliderPos ; i++){ + if(i === 0){ + now = 0; + last = 0; + } + if(i === 1){ + now = 1; + last = 0; + } + if(i === 2){ + now = 1; last = 0; } if(i !== 0 && last === 0 ){ diff --git a/style.css b/style.css index 4869567..e48e170 100644 --- a/style.css +++ b/style.css @@ -8,6 +8,8 @@ body { background-color: rgba(112,128,144,0.1); } + + .fib-left { float: left; display: inline-block; @@ -45,6 +47,13 @@ body { justify-content: space-around; } +.flex-horizontal { + display: flex; + flex-direction: column; + flex-wrap: wrap; + justify-content: space-around; +} + .red { border-color: rgb(255,0,0); background: rgb(180,60,60);