Skip to content

Fix: Hard difficulty now generates 6-letter words in Daily Challenge mode#4

Merged
eccentriccoder01 merged 1 commit intoeccentriccoder01:mainfrom
skvinderr:fix-hard-difficulty-word-length
Oct 19, 2025
Merged

Fix: Hard difficulty now generates 6-letter words in Daily Challenge mode#4
eccentriccoder01 merged 1 commit intoeccentriccoder01:mainfrom
skvinderr:fix-hard-difficulty-word-length

Conversation

@skvinderr
Copy link
Contributor

🐛 Bug Fix

Problem

The Hard difficulty level in Daily Challenge mode was incorrectly generating 5-letter words instead of the expected 6-letter words. This inconsistency affected the difficulty progression and user experience.

Root Cause

The issue was in the fetchWord() function where the Daily Challenge mode was using a hardcoded word list with 5-letter words regardless of the selected difficulty level. The function wasn't properly utilizing the getDailyWord(length) function that respects the difficulty settings.

Solution

  • Fixed Daily Challenge word generation: Modified the fetchWord() function to properly use getDailyWord(length) instead of hardcoded word selection
  • Maintained difficulty consistency: Now Hard difficulty correctly generates 6-letter words in Daily Challenge mode
  • Code cleanup: Removed redundant timer clearing code that was causing potential issues

Changes Made

  • File: script.js
    • Replaced hardcoded daily word selection logic with proper getDailyWord(length) function call
    • Removed unnecessary clearInterval(timer) call that was redundant
    • Ensured difficulty settings are respected in Daily Challenge mode:
      • Easy: 4-letter words
      • Medium: 5-letter words
      • Hard: 6-letter words ✅

Testing

  • Verified Hard difficulty generates 6-letter words in Daily Challenge mode
  • Confirmed other difficulty levels still work correctly
  • Tested non-Daily Challenge mode remains unaffected
  • Ensured no regression in existing functionality

Screenshots/Evidence

The difficulty settings are now properly mapped:

const difficultySettings = {
    easy: 4,
    medium: 5,
    hard: 6  // Now correctly used in Daily Challenge mode
};

…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)
@skvinderr
Copy link
Contributor Author

is there any thing wrong?? its now fixed ? can u give any suggestions @eccentriccoder01

@eccentriccoder01
Copy link
Owner

@skvinderr Great work!

@eccentriccoder01 eccentriccoder01 merged commit 0d19960 into eccentriccoder01:main Oct 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Hard difficulty shows 5-letter words instead of 6-letter words in Daily Challenge mode

2 participants