From 4dab6501241ada136f77d5e3e1f30e77ab24d238 Mon Sep 17 00:00:00 2001 From: Matt Kraatz Date: Mon, 18 Jul 2016 09:03:54 -0500 Subject: [PATCH 1/3] Delete index.html --- index.html | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 index.html diff --git a/index.html b/index.html deleted file mode 100644 index da64d95..0000000 --- a/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - JS Quiz - - - - -
- - - -
- - - - From 01c365705c3723a47c99c991538171c2df2deab4 Mon Sep 17 00:00:00 2001 From: Matt Kraatz Date: Mon, 18 Jul 2016 09:04:01 -0500 Subject: [PATCH 2/3] Delete main.css --- main.css | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 main.css diff --git a/main.css b/main.css deleted file mode 100644 index 8adf9fc..0000000 --- a/main.css +++ /dev/null @@ -1,3 +0,0 @@ -label { - display: block; -} From db2d72164968f8d130314d5d15856d097ca876f5 Mon Sep 17 00:00:00 2001 From: Matt Kraatz Date: Mon, 18 Jul 2016 09:04:07 -0500 Subject: [PATCH 3/3] Delete scripts.js --- scripts.js | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 scripts.js diff --git a/scripts.js b/scripts.js deleted file mode 100644 index 922ffcb..0000000 --- a/scripts.js +++ /dev/null @@ -1,41 +0,0 @@ -// Adding event listeners to the submit button and on the return key - -submit.addEventListener("click", validateForm) -treeHeight.addEventListener("keydown", returnCheck) -treeChar.addEventListener("keydown", returnCheck) - -// Assigning input values to an object after event validation and passing to the buildTree function - -function treeCapture() { - var tree = { - height: treeHeight.value, - char: treeChar.value - }; - buildTree(tree); -} - -// Function to check whether both input fields are completed - -function validateForm() { - if (treeHeight.value == "" || treeChar.value === "") { - alert("Please fill out both fields to continue.") - } else { - treeCapture(); - } -} - -// Function to check whether the enter key was pressed - -function returnCheck() { - if (event.keyCode === 13) { - validateForm(); - } -} - -// Function to build the tree - -function buildTree(tree) { - for (i = 1; i <= tree.height; i++) { - console.log(" ".repeat(tree.height - i) + tree.char.repeat((i * 2) - 1) + " ".repeat(tree.height - i)) - } -}