Skip to content

Commit 042aa9c

Browse files
committed
Update score text display
1 parent d0ffe37 commit 042aa9c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@ const game = () => {
8787
} else {
8888
//if guess is equal to secret number
8989
feedbackText.textContent =
90-
"You guessed correctly! +" + levelScore + " points!";
90+
"You guessed correctly! +" +
91+
Math.round(
92+
(((levelScore + maxGuess) * (maxAttempts - attempts + 1)) /
93+
(attempts + 1)) *
94+
maxAttempts,
95+
) +
96+
" points!";
9197
levelScore += maxGuess;
9298
score += Math.round(
9399
((levelScore * (maxAttempts - attempts + 1)) / (attempts + 1)) *

0 commit comments

Comments
 (0)