-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gues who #348
base: main
Are you sure you want to change the base?
Gues who #348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Hamdi! Great job getting back up to speed after losing all your work! It seems like your code is mostly there, it's just to keep playing around with the small bugs until you get it working. I identified some things that you can start with and from there it is hard to predict. I wish I could help you more so please write to me if you have any questions during your troubleshooting, I'd be happy to help if I can! Right now it's a little difficult to give any more without spending a lot of time because the webpage is only showing the interface of the starter code without any functionality and no board. Hopefully if you figure out the generateBoard thing I commented on it will make the rest easier to fix. Good luck! :)
code/script.js
Outdated
@@ -2,8 +2,14 @@ | |||
const board = document.getElementById('board') | |||
const questions = document.getElementById('questions') | |||
const restartButton = document.getElementById('restart') | |||
const winOrLose = document.getElementById('winOrLose') | |||
const winOrLoseText = document.getElementById('winOrLoseText') | |||
const playAgainButton = document.getElementById('playAgain') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this button's event listener?
code/script.js
Outdated
const winOrLose = document.getElementById('winOrLose') | ||
const winOrLoseText = document.getElementById('winOrLoseText') | ||
const playAgainButton = document.getElementById('playAgain') | ||
const findOutButton = document.getElementById('filter') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This button also needs an event listener.
code/script.js
Outdated
@@ -2,8 +2,14 @@ | |||
const board = document.getElementById('board') | |||
const questions = document.getElementById('questions') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dropdown menu needs an event listener.
code/script.js
Outdated
} | ||
// Invoke a function to redraw the board with the remaining people. | ||
generateBoard(keep);} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing that your board isn't generating at the startup of the game when this function is called because "keep" doesn't have a value. I could be wrong as I can't get to that part in the code when I run it but when I try following the logic I don't see where the variable "keep" is ever actually assigned a value.
code/script.js
Outdated
|
||
// Invokes the start function when website is loaded | ||
start() | ||
|
||
// All the event listeners | ||
restartButton.addEventListener('click', start) | ||
find |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that this needs to be here.
code/script.js
Outdated
|
||
}; | ||
|
||
const filterCharacters = (keep, matchingCharacters) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two filterCharacter functions, when I plug your code into VScode it shows several functions that don't have closing curly brackets. Both filterCharacter functions and checkQuestion function.
if (confirmGuess) { | ||
checkMyGuess(personToConfirm); | ||
} | ||
}; | ||
|
||
// If you confirm, this function is invoked | ||
const checkMyGuess = (personToCheck) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkMyGuess function has an error in the syntax of the if statement.
No description provided.