From a64ee647290bcf90c41931d663d3965a735b747c Mon Sep 17 00:00:00 2001 From: skvinderr Date: Mon, 6 Oct 2025 22:48:16 +0530 Subject: [PATCH] Fix: Hard difficulty now generates 6-letter words in Daily Challenge mode - Updated fetchWord() function to use getDailyWord(length) instead of hardcoded 5-letter words - Fixes issue where Hard difficulty (6 letters) was incorrectly showing 5-letter words - Ensures all difficulty levels work correctly in Daily Challenge mode Resolves: [Issue #X] (replace X with your issue number) --- script.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/script.js b/script.js index 715d969..fe74a45 100644 --- a/script.js +++ b/script.js @@ -140,9 +140,7 @@ $(document).ready(function () { function fetchWord(length, daily = false) { const wordList = ["apple", "brave", "crazy", "drink", "eagle", "flame", "glide", "hound", "ivory", "joker"]; if (daily) { - const date = new Date().toDateString(); - const seed = date.split('').reduce((acc, c) => acc + c.charCodeAt(0), 0); - secretWord = wordList[seed % wordList.length].toUpperCase(); + secretWord = getDailyWord(length); startGame(); // directly start game } else { fetch(`https://random-word-api.vercel.app/api?words=1&length=${length}`) @@ -360,7 +358,6 @@ $(document).ready(function () { $("#definition").html(`📖 ${secretWord}: Definition not found.`); }); showHeatmap(); - if (timer) clearInterval(timer); $("#keyboard").addClass("disabled"); }