HolyCoder's Posts
Nairaland Forum › HolyCoder's Profile › HolyCoder's Posts
1 (of 1 pages)
Funkypunky:My brother, how far? It's me; we met at the EPIC Tower (for the Cycle 36 Interview) and walked home together. How are you doing? |
Solomon27:I love your program. Particularly I love the background-colour you've used - it's beautiful! Here are a few things I think you should look into: 1. You should try to make a custom dialog-box for displaying your quiz-questions and collecting user-inputs. The default dialog displayed by the 'prompt' keyword provides the user with a checkbox, which (when selected) prevents the page from creating additional dialogs. And if that happens, your program becomes completely useless. 2. I noticed (from your code) that you're only checking if the user's gender is 'male'; in which case you welcome the user with: 'You are welcome Mr....', otherwise you say 'You are welcome Ms....'. Now, what happens is this: If I enter 'olodo' as my gender, it says 'You are welcome Ms...'. Also, even if I enter the string 'Male or MALE' as my gender, I'm welcomed as female. It means your program doesn't properly cater to my gender if I enter anything other than 'male' as my gender. Here's what I think you should do: - Specifically check to see if the user has entered either string 'male' or 'female' as gender, and then welcome him/her appropriately. If the user's gender is neither 'male' nor 'female', you should display a generic welcome-message. You could modify your code to do stuff like this: if (gender.toLowerCase() == "male" ) { alert(`You are welcome Mr. ${firstName} ${lastName}, here are the riddles`); } else if (gender.toLowerCase() == "female" ) { alert(`You are welcome Ms. ${firstName} ${lastName}, here are the riddles`); } else { alert(`You are welcome ${firstName} ${lastName}, here are the riddles`); } of course, you could also replace the 'if-else-if' construct with a 'switch' construct. 3. Finally, I notice you're using the statement-terminator (';') in a manner that makes it look like you don't really understand its purpose. Yes, the program works, but it sends a negative message. As an example, consider the following snippets I've extracted from your source: if (gender == "male" ){ alert(`You are welcome Mr. ${firstName} ${lastName}, here are the riddles`); }else { alert(`You are welcome Ms. ${firstName} ${lastName}, here are the riddles`); }; What exactly is this semicolon doing here? How about this? function start(quiz){ let score = 0; // main game loop for (const [question, answer] of quiz){ const response = ask(question); check(response, answer); }; Again, what is this semicolon doing here? //end of main game loop It's obvious those are not typos, because the pattern is repeated all over your source. Besides those, I think you've done a very good job! Blessings... |
2O17:Great! You're welcome. |
2O17:I did experience the same within the early-hours of today...sent them an e-mail, but received no response...yet. However, I just followed the link now and discovered a date is now available for a pick; so I've scheduled mine. I'm guessing the issue is due to some wrong-setting(s) made within the Calendly App. Several companies are having issues with correctly setting-up that app. You should try visiting your link within normal working-hours (like now) and see if you can pick a date. Good luck! |
1 (of 1 pages)