Tell us what’s happening:
I am not getting the problem is can someone explain the problem statement or can give steps to solve this problem
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
rollDiceBtn.addEventListener("click", () => {
if (rolls === 3) {
alert("You have made three rolls this round. Please select a score.");
} else {
rolls++;
rollDice();
updateStats();
getHighestDuplicates();
}
});
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Challenge Information:
Review Algorithmic Thinking by Building a Dice Game - Step 7
Please tell us what you need help understanding in the description provided in the step?
To me the description is clear so you can help us to help you if you tell us what you understood so far and which specific sentence you need help comprehending.
The problem statement is
If you roll the dice and get a "Three of a kind"
or "Four of a kind"
, then you can get a score totalling the sum of all five dice values. To calculate this, create a getHighestDuplicates
function which takes an array of numbers. The function will need to count how many times each number is found in the array.
If a number appears four or more times, you will need to update the Four of a Kind
option with your updateRadioOption
function. If a number appears three or more times, you will need to update the Three of a Kind
option. In both cases, the score value should be the sum of all five dice.
If neither of those are true, the final option should be updated with a score of 0
. Make sure to call your getHighestDuplicates
when the dice are rolled.
I need help in this like how to solve this problem
Which part do you need help with? Can you be more specific about what you understood and what you need help with?
For eg: here is the first line of the step
If you roll the dice and get a "Three of a kind"
or "Four of a kind"
, then you can get a score totalling the sum of all five dice values.
Do you know what this one is saying? What do you understand from this so far?
I understood that I have to create a function call getHighestDuplicates and have call this function and in function getHighestDuplicate what work should e done?
Please try to tell us which sentence or concept you don’t understand.
Did you understand the objective described by this sentence?
Do you have a specific question here?
My first language isn’t English, so sorry if I’m wrong about something.
The task asks you to create a function that takes an array as a parameter. The function should contain logic to count how many times each number appears in the array.
I dont know how to solve this problem i want steps to know how to solve thats it!
You have made no effort to tell us what part of the steps given in the challenge you need help with.
Therefore, i can only suggest that you read this article and try to rephrase your post after that.