score: 0
From 15ba517e556281c1f8fe3e32c6f18c9794bb9f29 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 13:21:24 -0500
Subject: [PATCH 04/43] commit querySelector changes
Add, test querySelector to score and timer
---
src/index.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/index.js b/src/index.js
index dc08e7f6..7b04dbbd 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,8 +2,8 @@ const holes = document.querySelectorAll('.hole');
const moles = document.querySelectorAll('.mole');
const startButton = document.querySelector('#start');
// TODO: Add the missing query selectors:
-const score; // Use querySelector() to get the score element
-const timerDisplay; // use querySelector() to get the timer element.
+const score = document.querySelector('.score'); // Use querySelector() to get the score element
+const timerDisplay = document.querySelector('.timer'); // use querySelector() to get the timer element.
let time = 0;
let timer;
From f05e015fe250bdf1b5afdfa631ada118dcc888ed Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 13:30:02 -0500
Subject: [PATCH 05/43] commit random integer function
COMMIT RANDOM INTEGER
---
src/index.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index 7b04dbbd..16303dde 100644
--- a/src/index.js
+++ b/src/index.js
@@ -21,9 +21,16 @@ let difficulty = "hard";
*
*/
function randomInteger(min, max) {
- // return Math.floor(Math.random() * (max - min + 1)) + min;
+ return Math.floor(Math.random() * (max - min + 1)) + min;
}
+console.log("A random integer between 0 and 10");
+console.log(randomInteger(0, 10));
+console.log("Another random integer between 0 and 10");
+console.log(randomInteger(0, 10));
+console.log("A random number between 600 and 1200");
+console.log(randomInteger(600, 1200));
+
/**
* Sets the time delay given a difficulty parameter.
*
From baed15e7d5473cab2df5221481c49ed8c7ac69c7 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 15:24:51 -0500
Subject: [PATCH 06/43] Update index.js
commit changes for setDelay(difficulty)
---
src/index.js | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/index.js b/src/index.js
index 16303dde..5544c3b4 100644
--- a/src/index.js
+++ b/src/index.js
@@ -3,7 +3,9 @@ const moles = document.querySelectorAll('.mole');
const startButton = document.querySelector('#start');
// TODO: Add the missing query selectors:
const score = document.querySelector('.score'); // Use querySelector() to get the score element
+//Made changes to const score, added querySelector score.
const timerDisplay = document.querySelector('.timer'); // use querySelector() to get the timer element.
+//Made changes to const timerDisplay, added querySelector timer.
let time = 0;
let timer;
@@ -23,6 +25,7 @@ let difficulty = "hard";
function randomInteger(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
+//ADDED THE RANDOMINTEGER FUNCTION, ALREADY IMPLEMENTED FOR ME, SELECTS RANDOM TIME THE MOLES COME OUT OF THEIR HOLES DURING THE GAME.
console.log("A random integer between 0 and 10");
console.log(randomInteger(0, 10));
@@ -30,6 +33,7 @@ console.log("Another random integer between 0 and 10");
console.log(randomInteger(0, 10));
console.log("A random number between 600 and 1200");
console.log(randomInteger(600, 1200));
+//ADDED RANDON INTETGERS
/**
* Sets the time delay given a difficulty parameter.
@@ -48,6 +52,12 @@ console.log(randomInteger(600, 1200));
*/
function setDelay(difficulty) {
// TODO: Write your code here.
+ if (difficulty === "easy") {
+ return 1500;
+ } else if (difficulty === "normal") {
+ return 1000;
+ } else if (difficulty === "hard") {
+ return 856;
}
From 1c87175ba5e35b45a7a6f23863a694fa2a8af479 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 15:36:11 -0500
Subject: [PATCH 07/43] Update index.js
Commit random Hole
---
src/index.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/index.js b/src/index.js
index 5544c3b4..a4d09198 100644
--- a/src/index.js
+++ b/src/index.js
@@ -54,11 +54,13 @@ function setDelay(difficulty) {
// TODO: Write your code here.
if (difficulty === "easy") {
return 1500;
+ // SETTING DIFFICULTY FOR EASY
} else if (difficulty === "normal") {
return 1000;
+ // SETTING DIFFICULTY FOR NORMAL
} else if (difficulty === "hard") {
return 856;
-
+ //SETTING DIFFICULTY FOR HARD
}
/**
@@ -77,7 +79,13 @@ function setDelay(difficulty) {
*/
function chooseHole(holes) {
// TODO: Write your code here.
-
+ let randomIndex = Math.floor(Math.random() * holes.length);
+ //CHOOSE A RANDOM INDEX FOR THE HOLE ARRAY
+ if (randomIndex === lastHole) {
+randomIndex = (randomIndex + 1) % holes.length;
+ }
+ lastHole = randomIndex;
+ return holes[randomIndex];
}
/**
From b10d5f0ae22c1ff32b336fa58598c4b90cb405b2 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 15:41:34 -0500
Subject: [PATCH 08/43] Update index.js
commit changes to chooseHole function, pt.2
---
src/index.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/index.js b/src/index.js
index a4d09198..7afd1a9d 100644
--- a/src/index.js
+++ b/src/index.js
@@ -79,13 +79,13 @@ function setDelay(difficulty) {
*/
function chooseHole(holes) {
// TODO: Write your code here.
- let randomIndex = Math.floor(Math.random() * holes.length);
- //CHOOSE A RANDOM INDEX FOR THE HOLE ARRAY
- if (randomIndex === lastHole) {
-randomIndex = (randomIndex + 1) % holes.length;
+ const index = randomInteger(0,2);
+ const hole = holes[index];
+ if (hole === lastHole) {
+ return chooseHole(holes);
}
- lastHole = randomIndex;
- return holes[randomIndex];
+ lastHole = hole;
+ return hole;
}
/**
From 010b6e9d6eea194485a052926c794e55de6ef881 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 16:07:34 -0500
Subject: [PATCH 09/43] Update index.js
commit changes for US-03
---
src/index.js | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/index.js b/src/index.js
index 7afd1a9d..cce769aa 100644
--- a/src/index.js
+++ b/src/index.js
@@ -110,7 +110,13 @@ function chooseHole(holes) {
*/
function gameOver() {
// TODO: Write your code here
-
+ if (time > 0){
+ let timeoutId = showUp();
+ return timeoutId;
+ } else {
+ let gameStopped = stopGame();
+ return gameStopped;
+ }
}
/**
@@ -123,8 +129,8 @@ function gameOver() {
*
*/
function showUp() {
- let delay = 0; // TODO: Update so that it uses setDelay()
- const hole = 0; // TODO: Update so that it use chooseHole()
+ let delay = setDelay("normal"); // TODO: Update so that it uses setDelay()
+ const hole = chooseHole(holes); // TODO: Update so that it use chooseHole()
return showAndHide(hole, delay);
}
@@ -138,12 +144,12 @@ function showUp() {
*/
function showAndHide(hole, delay){
// TODO: call the toggleVisibility function so that it adds the 'show' class.
-
+ toggleVisibility(hole);
const timeoutID = setTimeout(() => {
// TODO: call the toggleVisibility function so that it removes the 'show' class when the timer times out.
-
+ toggleVisibility(hole)
gameOver();
- }, 0); // TODO: change the setTimeout delay to the one provided as a parameter
+ }, 1000); // TODO: change the setTimeout delay to the one provided as a parameter
return timeoutID;
}
@@ -155,7 +161,7 @@ function showAndHide(hole, delay){
*/
function toggleVisibility(hole){
// TODO: add hole.classList.toggle so that it adds or removes the 'show' class.
-
+ hole.classList.toggle('show');
return hole;
}
@@ -268,8 +274,8 @@ function stopGame(){
*
*/
function startGame(){
- //setDuration(10);
- //showUp();
+ setDuration(10);
+ showUp();
return "game started";
}
From be0f54df1185b30289deadcffe99292ddffc3c35 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 16:54:34 -0500
Subject: [PATCH 10/43] Update index.js
commit changes to index.js, pt.3
---
src/index.js | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/index.js b/src/index.js
index cce769aa..ab7e075b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -177,7 +177,7 @@ function toggleVisibility(hole){
*/
function updateScore() {
// TODO: Write your code here
-
+ points++;
return points;
}
@@ -190,8 +190,8 @@ function updateScore() {
*/
function clearScore() {
// TODO: Write your code here
- // points = 0;
- // score.textContent = points;
+ points = 0;
+ score.textContent = points;
return points;
}
@@ -203,7 +203,10 @@ function clearScore() {
function updateTimer() {
// TODO: Write your code here.
// hint: this code is provided to you in the instructions.
-
+ if (time > 0) {
+ time -= 1;
+ timerDisplay.textContent = time;
+ }
return time;
}
@@ -215,7 +218,7 @@ function updateTimer() {
*/
function startTimer() {
// TODO: Write your code here
- // timer = setInterval(updateTimer, 1000);
+ timer = setInterval(updateTimer, 1000);
return timer;
}
@@ -229,7 +232,8 @@ function startTimer() {
*/
function whack(event) {
// TODO: Write your code here.
- // call updateScore()
+ console.log("whack!")
+ updateScore()
return points;
}
@@ -240,7 +244,9 @@ function whack(event) {
*/
function setEventListeners(){
// TODO: Write your code here
-
+ moles.forEach(
+ mole => mole.addEventListener('click', whack)
+ );
return moles;
}
From 18b3647b7ecce9e04f1164bb11c2e5aabbee5944 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 16:56:56 -0500
Subject: [PATCH 11/43] Update styles.css
commit style.css changes
---
src/styles.css | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/styles.css b/src/styles.css
index 551996b1..2cd8c2f5 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -13,15 +13,15 @@ html {
h1 {
text-align: center;
font-size: 90px;
- font-family: "Comic Sans MS", "Comic Sans", cursive;
- color: white;
+ font-family: "arial", "Comic Sans MS", "Comic Sans", cursive;
+ color: black;
-webkit-text-stroke: 2px black;
}
h2 {
text-align: center;
font-size: 40px;
- color: white;
+ color: black;
-webkit-text-stroke: 1px black;
}
@@ -31,7 +31,7 @@ h2 {
}
#timer{
- color: white;
+ color: red;
}
.grid {
From 5d2416cb8598039d65ae9bf15d511a19297e5b52 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 17:15:36 -0500
Subject: [PATCH 12/43] Update index.js
make changes
---
src/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index ab7e075b..47d6bbbc 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,7 +2,7 @@ const holes = document.querySelectorAll('.hole');
const moles = document.querySelectorAll('.mole');
const startButton = document.querySelector('#start');
// TODO: Add the missing query selectors:
-const score = document.querySelector('.score'); // Use querySelector() to get the score element
+const score : document.querySelector('.score'); // Use querySelector() to get the score element
//Made changes to const score, added querySelector score.
const timerDisplay = document.querySelector('.timer'); // use querySelector() to get the timer element.
//Made changes to const timerDisplay, added querySelector timer.
From 86ea97b7023f4a7482473ea973dfd1f25a79919b Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 17:17:43 -0500
Subject: [PATCH 13/43] Update index.js
submit changes
---
src/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index 47d6bbbc..ab7e075b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,7 +2,7 @@ const holes = document.querySelectorAll('.hole');
const moles = document.querySelectorAll('.mole');
const startButton = document.querySelector('#start');
// TODO: Add the missing query selectors:
-const score : document.querySelector('.score'); // Use querySelector() to get the score element
+const score = document.querySelector('.score'); // Use querySelector() to get the score element
//Made changes to const score, added querySelector score.
const timerDisplay = document.querySelector('.timer'); // use querySelector() to get the timer element.
//Made changes to const timerDisplay, added querySelector timer.
From afe03c78adced94a80d43a76d452053078e59c57 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 17:21:05 -0500
Subject: [PATCH 14/43] Update index.html
Change Title
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index df65940f..5a9512e5 100644
--- a/index.html
+++ b/index.html
@@ -3,7 +3,7 @@
-
MY GAME!!!
+
WHACK-A-MOLE!
Click start to play!
From b513e8912dcaee47f23d2c16b1fddf8c51ee9163 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 7 May 2023 18:30:43 -0500
Subject: [PATCH 15/43] Update styles.css
commit more changes
---
src/styles.css | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/styles.css b/src/styles.css
index 2cd8c2f5..b50de983 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -12,7 +12,7 @@ html {
h1 {
text-align: center;
- font-size: 90px;
+ font-size: 100px;
font-family: "arial", "Comic Sans MS", "Comic Sans", cursive;
color: black;
-webkit-text-stroke: 2px black;
@@ -20,14 +20,14 @@ h1 {
h2 {
text-align: center;
- font-size: 40px;
+ font-size: 50px;
color: black;
-webkit-text-stroke: 1px black;
}
#start {
text-align: center;
- font-size: 30px;
+ font-size: 40px;
}
#timer{
From 412b7f6c40056acc950591b2c147407a8700b07b Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Tue, 9 May 2023 11:39:25 -0500
Subject: [PATCH 16/43] Update index.js
commit minor changes
---
src/index.js | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/index.js b/src/index.js
index ab7e075b..ad2f1cb2 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,16 +2,16 @@ const holes = document.querySelectorAll('.hole');
const moles = document.querySelectorAll('.mole');
const startButton = document.querySelector('#start');
// TODO: Add the missing query selectors:
-const score = document.querySelector('.score'); // Use querySelector() to get the score element
+const score = document.querySelector('#score'); // Use querySelector() to get the score element
//Made changes to const score, added querySelector score.
-const timerDisplay = document.querySelector('.timer'); // use querySelector() to get the timer element.
+const timerDisplay = document.querySelector('#timer'); // use querySelector() to get the timer element.
//Made changes to const timerDisplay, added querySelector timer.
-let time = 0;
+let time = 30;
let timer;
let lastHole = 0;
let points = 0;
-let difficulty = "hard";
+let difficulty = "normal";
/**
* Generates a random integer within a range.
@@ -55,12 +55,13 @@ function setDelay(difficulty) {
if (difficulty === "easy") {
return 1500;
// SETTING DIFFICULTY FOR EASY
- } else if (difficulty === "normal") {
+ }; else if (difficulty === "normal") {
return 1000;
// SETTING DIFFICULTY FOR NORMAL
- } else if (difficulty === "hard") {
- return 856;
+ }; else if (difficulty === "hard") {
+ return randomInteger(600, 1200);
//SETTING DIFFICULTY FOR HARD
+ };
}
/**
@@ -79,7 +80,7 @@ function setDelay(difficulty) {
*/
function chooseHole(holes) {
// TODO: Write your code here.
- const index = randomInteger(0,2);
+ const index = randomInteger(0,8);
const hole = holes[index];
if (hole === lastHole) {
return chooseHole(holes);
@@ -178,6 +179,7 @@ function toggleVisibility(hole){
function updateScore() {
// TODO: Write your code here
points++;
+ score.textContent = points;
return points;
}
From d35e2f55a309920239098429281d1e46fdd2ca2f Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Tue, 9 May 2023 12:18:30 -0500
Subject: [PATCH 17/43] Update index.js
commit changes
---
src/index.js | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/index.js b/src/index.js
index ad2f1cb2..a5763bee 100644
--- a/src/index.js
+++ b/src/index.js
@@ -55,10 +55,10 @@ function setDelay(difficulty) {
if (difficulty === "easy") {
return 1500;
// SETTING DIFFICULTY FOR EASY
- }; else if (difficulty === "normal") {
+ }; if (difficulty === "normal") {
return 1000;
// SETTING DIFFICULTY FOR NORMAL
- }; else if (difficulty === "hard") {
+ }; if (difficulty === "hard") {
return randomInteger(600, 1200);
//SETTING DIFFICULTY FOR HARD
};
@@ -130,7 +130,7 @@ function gameOver() {
*
*/
function showUp() {
- let delay = setDelay("normal"); // TODO: Update so that it uses setDelay()
+ let delay = setDelay(difficulty); // TODO: Update so that it uses setDelay()
const hole = chooseHole(holes); // TODO: Update so that it use chooseHole()
return showAndHide(hole, delay);
}
@@ -233,9 +233,8 @@ function startTimer() {
*
*/
function whack(event) {
- // TODO: Write your code here.
- console.log("whack!")
- updateScore()
+ // TODO: Write your code here
+ updateScore();
return points;
}
From 9548969dbf9f69feb20fd1040178f1e9c611406d Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Tue, 9 May 2023 13:29:07 -0500
Subject: [PATCH 18/43] Update styles.css
commit changes
---
src/styles.css | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/styles.css b/src/styles.css
index b50de983..210754e3 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -80,3 +80,7 @@ h2 {
top: 0;
/*transform: scale(1.1);*/
}
+
+.button {
+ align-items: center;
+}
\ No newline at end of file
From b5361118cd587679f2ed42f087ea09a55960811e Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 14 May 2023 12:18:00 -0500
Subject: [PATCH 19/43] Create Capstone Assignment
Create Capstone Assignment. Trying to figure out how to commit changes and get the git deployed.
---
Capstone Assignment | 1 +
1 file changed, 1 insertion(+)
create mode 100644 Capstone Assignment
diff --git a/Capstone Assignment b/Capstone Assignment
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/Capstone Assignment
@@ -0,0 +1 @@
+
From 63a9a8f11f1a0764e98f8d75eb3957b10b65c372 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Sun, 14 May 2023 12:20:16 -0500
Subject: [PATCH 20/43] Create .DS_Store
commit changes, trying to figure out how to deploy
---
.DS_Store | Bin 0 -> 6148 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 .DS_Store
diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..025149b73723be08024be0185d8f18e668f3a8bd
GIT binary patch
literal 6148
zcmeHKOHRWu5Pfbd)B-|XvO&rTB5{LIwF?$(=mnrD6iR4N3y5X*+<_}_K34E%Y*lqq
zwx~ig(fIi@&!3mbjsdvA%k&iJ1L)EPTRkRQOxnd8)(SP!=(LY#tj>!vpA_Y!5p5N_
zsDQk?JzQhO=LYfnlaJzzo_?$8^!IU(1*VLBLy9{x9#L$(bK!i}I7gT>e#O`nIZE
rQIiLp*VIIUbnK*o$(ck9bV?UgPy}i4kW%#04?sET=WbSB=r;4425`
zsMc(I)a!V;D9VMj^21u`lQU==b}7OtO+GU<&*z1zcx19uByqaJDuU
vCueO!zoLstT;*|1VMdQ)#>!EAOjl!lA{k;9u=2
Date: Mon, 15 May 2023 09:50:16 -0500
Subject: [PATCH 21/43] Delete .DS_Store
Don't need this file. Trying to figure out how to pass all errors and deploy the whack-a-mole game
---
.DS_Store | Bin 6148 -> 0 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 .DS_Store
diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 025149b73723be08024be0185d8f18e668f3a8bd..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 6148
zcmeHKOHRWu5Pfbd)B-|XvO&rTB5{LIwF?$(=mnrD6iR4N3y5X*+<_}_K34E%Y*lqq
zwx~ig(fIi@&!3mbjsdvA%k&iJ1L)EPTRkRQOxnd8)(SP!=(LY#tj>!vpA_Y!5p5N_
zsDQk?JzQhO=LYfnlaJzzo_?$8^!IU(1*VLBLy9{x9#L$(bK!i}I7gT>e#O`nIZErQIiLp*VIIUbnK*o$(ck9bV?UgPy}i4kW%#04?sET=WbSB=r;4425`
zsMc(I)a!V;D9VMj^21u`lQU==b}7OtO+GU<&*z1zcx19uByqaJDuU
vCueO!zoLstT;*|1VMdQ)#>!EAOjl!lA{k;9u=2
Date: Mon, 15 May 2023 09:51:35 -0500
Subject: [PATCH 22/43] Delete Capstone Assignment
do not needed this file. trying to deploy game and pass assignment
---
Capstone Assignment | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 Capstone Assignment
diff --git a/Capstone Assignment b/Capstone Assignment
deleted file mode 100644
index 8b137891..00000000
--- a/Capstone Assignment
+++ /dev/null
@@ -1 +0,0 @@
-
From 0e2d7e7f6c8001cd26ded8b2bf594f04aa41ca77 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 13:14:51 -0500
Subject: [PATCH 23/43] Update index.html
add alignment to start button
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 5a9512e5..315d2d23 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@ WHACK-A-MOLE!
Click start to play!
-
+
score: 0
From 792f723114b1548a03d5dd7b2f55f2201d5e92a1 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 13:19:20 -0500
Subject: [PATCH 24/43] Update index.html
commit button issue
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
index.html | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/index.html b/index.html
index 315d2d23..e3dfd252 100644
--- a/index.html
+++ b/index.html
@@ -6,8 +6,10 @@
WHACK-A-MOLE!
-
Click start to play!
-
+ Click start to play!
+
+
+
score: 0
From 886f1ec76b97093f2dacb056655d193c424eed3a Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 13:23:26 -0500
Subject: [PATCH 25/43] Update index.html
seeing if the commits are added to the deployment.
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index e3dfd252..fb03cf3e 100644
--- a/index.html
+++ b/index.html
@@ -12,7 +12,7 @@ Click start to play!
-
score: 0
+ score:
0 seconds left.
From ba11596f6da9a1124c6e7f495cf90149b716c427 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 14:28:02 -0500
Subject: [PATCH 26/43] Update styles.css
Trying to add Start button to the center
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/styles.css | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/styles.css b/src/styles.css
index 210754e3..5eed0573 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -30,6 +30,10 @@ h2 {
font-size: 40px;
}
+.button {
+ align-items: center;
+}
+
#timer{
color: red;
}
@@ -80,7 +84,3 @@ h2 {
top: 0;
/*transform: scale(1.1);*/
}
-
-.button {
- align-items: center;
-}
\ No newline at end of file
From e76f5bbb7269b23409dbab5ce27a025fb155d8b3 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 14:48:03 -0500
Subject: [PATCH 27/43] Update index.html
start button changes
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index fb03cf3e..d66e3728 100644
--- a/index.html
+++ b/index.html
@@ -9,7 +9,7 @@ WHACK-A-MOLE!
Click start to play!
-
+
score:
From 664f09ba7969f0d321fbecee1a3b5a6d0e4905b3 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 15:03:44 -0500
Subject: [PATCH 28/43] Update styles.css
commit style changes
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/styles.css | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/styles.css b/src/styles.css
index 5eed0573..53012d48 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -34,6 +34,10 @@ h2 {
align-items: center;
}
+#score {
+ color: green;
+}
+
#timer{
color: red;
}
From 742c84cf42072888a0be8af0a5babefb5b923616 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 15:06:43 -0500
Subject: [PATCH 29/43] Update index.html
Commit changes
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
index.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/index.html b/index.html
index d66e3728..9446005b 100644
--- a/index.html
+++ b/index.html
@@ -3,7 +3,7 @@
-
WHACK-A-MOLE!
+
WHACK WHACK WHACK-A-MOLE!
Click start to play!
@@ -12,10 +12,10 @@ Click start to play!
-
score:
+ score: 00
-
0 seconds left.
+ 00 seconds left.
From 2b46e3776a8f6df64f8e6f9d3c438a04dd69f92b Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 16:36:52 -0500
Subject: [PATCH 30/43] Update styles.css
Add Media Queries
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/styles.css | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/styles.css b/src/styles.css
index 53012d48..1be401f3 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -88,3 +88,7 @@ h2 {
top: 0;
/*transform: scale(1.1);*/
}
+
+@media
() {
+
+}
From f105d33f83494dbb86faf08c1655024828549e08 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 16:47:26 -0500
Subject: [PATCH 31/43] Update styles.css
Commit changes
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/styles.css | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/styles.css b/src/styles.css
index 1be401f3..676eaa84 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -21,7 +21,8 @@ h1 {
h2 {
text-align: center;
font-size: 50px;
- color: black;
+ font-family: "Comic Sans MS", "Comic Sans";
+ color: white;
-webkit-text-stroke: 1px black;
}
From 3f82dd6e877263495677b34336ddd9865652def7 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 16:50:03 -0500
Subject: [PATCH 32/43] Update index.html
commit changes
---
index.html | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/index.html b/index.html
index 9446005b..2f9641ba 100644
--- a/index.html
+++ b/index.html
@@ -6,10 +6,7 @@
WHACK WHACK WHACK-A-MOLE!
-
Click start to play!
-
-
-
+ Click to play!
score: 00
From 3cb555d31d7407c8dc4f6da39e2c3a4bf2b26106 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 16:57:00 -0500
Subject: [PATCH 33/43] Update styles.css
commit changes
---
src/styles.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/styles.css b/src/styles.css
index 676eaa84..27382969 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -21,8 +21,8 @@ h1 {
h2 {
text-align: center;
font-size: 50px;
- font-family: "Comic Sans MS", "Comic Sans";
- color: white;
+ font-family: Times, Times New Roman, serif;
+ color: cornsilk;
-webkit-text-stroke: 1px black;
}
From dff00d20194ec80f2b0dc47702ea43f0f9226a12 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 17:45:35 -0500
Subject: [PATCH 34/43] Update index.js
commit changes
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/index.js | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/src/index.js b/src/index.js
index a5763bee..0300a51a 100644
--- a/src/index.js
+++ b/src/index.js
@@ -7,7 +7,7 @@ const score = document.querySelector('#score'); // Use querySelector() to get th
const timerDisplay = document.querySelector('#timer'); // use querySelector() to get the timer element.
//Made changes to const timerDisplay, added querySelector timer.
-let time = 30;
+let time = 0;
let timer;
let lastHole = 0;
let points = 0;
@@ -55,13 +55,13 @@ function setDelay(difficulty) {
if (difficulty === "easy") {
return 1500;
// SETTING DIFFICULTY FOR EASY
- }; if (difficulty === "normal") {
+ } if (difficulty === "normal") {
return 1000;
// SETTING DIFFICULTY FOR NORMAL
- }; if (difficulty === "hard") {
+ } if (difficulty === "hard") {
return randomInteger(600, 1200);
//SETTING DIFFICULTY FOR HARD
- };
+ }
}
/**
@@ -84,8 +84,9 @@ function chooseHole(holes) {
const hole = holes[index];
if (hole === lastHole) {
return chooseHole(holes);
+ }else{
+ lastHole = hole;
}
- lastHole = hole;
return hole;
}
@@ -148,7 +149,7 @@ function showAndHide(hole, delay){
toggleVisibility(hole);
const timeoutID = setTimeout(() => {
// TODO: call the toggleVisibility function so that it removes the 'show' class when the timer times out.
- toggleVisibility(hole)
+ toggleVisibility(hole);
gameOver();
}, 1000); // TODO: change the setTimeout delay to the one provided as a parameter
return timeoutID;
@@ -162,7 +163,7 @@ function showAndHide(hole, delay){
*/
function toggleVisibility(hole){
// TODO: add hole.classList.toggle so that it adds or removes the 'show' class.
- hole.classList.toggle('show');
+ hole.classList.toggle("show");
return hole;
}
@@ -220,7 +221,7 @@ function updateTimer() {
*/
function startTimer() {
// TODO: Write your code here
- timer = setInterval(updateTimer, 1000);
+ setInterval(updateTimer, 1000);
return timer;
}
@@ -234,6 +235,16 @@ function startTimer() {
*/
function whack(event) {
// TODO: Write your code here
+ if (time > 0) {
+ points += 1;
+ score.textContent = points;
+ if (points === moles.length && moles.length > 0) {
+ mole.style.background = "red";
+ });
+ } time = 0;
+ score.textContent = points;
+ return time;
+}
updateScore();
return points;
}
@@ -245,10 +256,9 @@ function whack(event) {
*/
function setEventListeners(){
// TODO: Write your code here
- moles.forEach(
- mole => mole.addEventListener('click', whack)
- );
- return moles;
+ for (var i = 0; i < moles.lenght; i++) {
+ moles[i].addEventListener('click', whack);
+ }
}
/**
@@ -283,6 +293,8 @@ function stopGame(){
function startGame(){
setDuration(10);
showUp();
+ startTimer();
+ setEventListeners();
return "game started";
}
From 4734b64af4b360bb1ab2e33e5fe367a00cac75b4 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 17:48:05 -0500
Subject: [PATCH 35/43] Update index.js
take two
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index 0300a51a..5e3775e1 100644
--- a/src/index.js
+++ b/src/index.js
@@ -240,7 +240,7 @@ function whack(event) {
score.textContent = points;
if (points === moles.length && moles.length > 0) {
mole.style.background = "red";
- });
+ };
} time = 0;
score.textContent = points;
return time;
From a1886ade06bb7334c76ccee60433a1ad86561bd9 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 17:59:13 -0500
Subject: [PATCH 36/43] Update index.js
return moles
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/index.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/index.js b/src/index.js
index 5e3775e1..48fa65e8 100644
--- a/src/index.js
+++ b/src/index.js
@@ -259,6 +259,7 @@ function setEventListeners(){
for (var i = 0; i < moles.lenght; i++) {
moles[i].addEventListener('click', whack);
}
+ return moles;
}
/**
From c284df7ea01e97fb2f87f133e58415434236b779 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 18:36:01 -0500
Subject: [PATCH 37/43] Update index.js
commit changes again
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/index.js | 25 ++++++++-----------------
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/src/index.js b/src/index.js
index 48fa65e8..018e818b 100644
--- a/src/index.js
+++ b/src/index.js
@@ -84,9 +84,8 @@ function chooseHole(holes) {
const hole = holes[index];
if (hole === lastHole) {
return chooseHole(holes);
- }else{
- lastHole = hole;
}
+ lastHole = hole;
return hole;
}
@@ -163,7 +162,7 @@ function showAndHide(hole, delay){
*/
function toggleVisibility(hole){
// TODO: add hole.classList.toggle so that it adds or removes the 'show' class.
- hole.classList.toggle("show");
+ hole.classList.toggle('show');
return hole;
}
@@ -235,16 +234,6 @@ function startTimer() {
*/
function whack(event) {
// TODO: Write your code here
- if (time > 0) {
- points += 1;
- score.textContent = points;
- if (points === moles.length && moles.length > 0) {
- mole.style.background = "red";
- };
- } time = 0;
- score.textContent = points;
- return time;
-}
updateScore();
return points;
}
@@ -256,9 +245,8 @@ function whack(event) {
*/
function setEventListeners(){
// TODO: Write your code here
- for (var i = 0; i < moles.lenght; i++) {
- moles[i].addEventListener('click', whack);
- }
+ moles.forEach(
+ mole => mole.addEventListener('click', whack));
return moles;
}
@@ -292,10 +280,13 @@ function stopGame(){
*
*/
function startGame(){
- setDuration(10);
showUp();
+ points = 0;
+ clearScore();
+ setDuration(10);
startTimer();
setEventListeners();
+
return "game started";
}
From 2fde9f2109d3a97d1d915a3dd2e94a2793a9e674 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 18:41:01 -0500
Subject: [PATCH 38/43] Update index.js
commit time duration
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index 018e818b..9491af05 100644
--- a/src/index.js
+++ b/src/index.js
@@ -283,7 +283,7 @@ function startGame(){
showUp();
points = 0;
clearScore();
- setDuration(10);
+ setDuration(30);
startTimer();
setEventListeners();
From 42683dc1d79104a20e25b30f6ef3e2e1fab3ec8c Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 18:43:45 -0500
Subject: [PATCH 39/43] Update index.html
small changes
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
index.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/index.html b/index.html
index 2f9641ba..9b0a38a2 100644
--- a/index.html
+++ b/index.html
@@ -3,16 +3,16 @@
-
WHACK WHACK WHACK-A-MOLE!
+
WHACK-A-MOLE!!!
Click to play!
-
score: 00
+ score: 0
-
00 seconds left.
+ 0 seconds left.
From 96ac334bd6f65bdfc36fa731c3b7ceac714fa84f Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 18:50:41 -0500
Subject: [PATCH 40/43] Update index.html
Liked this Title better. lol
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 9b0a38a2..19b0ff33 100644
--- a/index.html
+++ b/index.html
@@ -3,7 +3,7 @@
-
WHACK-A-MOLE!!!
+
WHACK WHACK WHACK-A-MOLE!!!
Click to play!
From 2531e1d4b55b5a6a2179aa38d7c4a7afadc1b0de Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 18:51:44 -0500
Subject: [PATCH 41/43] Update styles.css
trying a different color
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/styles.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/styles.css b/src/styles.css
index 27382969..5498e370 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -14,7 +14,7 @@ h1 {
text-align: center;
font-size: 100px;
font-family: "arial", "Comic Sans MS", "Comic Sans", cursive;
- color: black;
+ color: Blue;
-webkit-text-stroke: 2px black;
}
From 93db6863e737e89d439daa9721477e6b53354d7b Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 21:35:51 -0500
Subject: [PATCH 42/43] Update index.html
Commit Changes
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
index.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 19b0ff33..4c7a877f 100644
--- a/index.html
+++ b/index.html
@@ -1,9 +1,10 @@
+
-
WHACK WHACK WHACK-A-MOLE!!!
+
WHACK WHACK WHACK-A-MOLE!!!
Click to play!
From 5dbe5a24e5725ccc541cd4bac55bf9c7877cdbe6 Mon Sep 17 00:00:00 2001
From: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
Date: Mon, 15 May 2023 21:36:28 -0500
Subject: [PATCH 43/43] Update styles.css
commit changes
Signed-off-by: Rialda Redzic <114961445+Rialda-Thinkful@users.noreply.github.com>
---
src/styles.css | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/styles.css b/src/styles.css
index 5498e370..4057ab50 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -89,7 +89,3 @@ h2 {
top: 0;
/*transform: scale(1.1);*/
}
-
-@media () {
-
-}