Skip to content

surhud004/WordHuntGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Word Hunt Generator

Description

The Word Hunt Generator is a tool that creates a word search puzzle based on a list of input words and a specified difficulty level. The generated puzzle is a grid filled with random letters, with the input words randomly placed horizontally.

Current Features

  • Difficulty Levels: Supports three difficulty levels - easy, medium, and hard. Each level determines the grid size and the constraints on the number and length of words.
    • Easy: 5x5 grid, up to 3 words, each with a maximum length of 4 letters.
    • Medium: 10x10 grid, up to 5 words, each with a maximum length of 6 letters.
    • Hard: 15x15 grid, up to 7 words, each with a maximum length of 10 letters.
  • Random Word Placement: Words are placed randomly in horizontal rows within the grid.
  • Grid Filling: Empty spaces in the grid are filled with random uppercase letters.

Future Features (TODOs)

  • Vertical Word Placement: Add functionality to place words vertically in the grid.
  • Diagonal Word Placement: Add functionality to place words diagonally in the grid.
  • Reverse Horizontal Placement: Add functionality to place words in reverse horizontal order.
  • Reverse Vertical Placement: Add functionality to place words in reverse vertical order.
  • Improved Positioning: Handle cases where multiple words can occupy the same row or column without overlap.

Usage

Style 1: Direct function call

To generate a word hunt puzzle, call the generateWHG function with an array of words and a difficulty level:

generateWHG(["cat", "dog", "fish"], "easy");

Style 2: Keyboard input

To generate a word hunt puzzle, call the userInputWords function and then prompt user to enter the difficulty level followed by the words list separated by commas:

userInputWords();
Welcome to Word Hunt Generator!
Enter the difficulty level (choose from easy, medium, hard): easy
You've selected easy!
Easy: Enter up to 3 words (max 4 letters each).
Enter the words here separated by commas: cat, dog, fish

Example Output

Generated a 5x5 Word Hunt:
-----------------------------------------
Words to find: CAT, DOG, FISH
-----------------------------------------
┌─────┬─────┬─────┬─────┬─────┐
│ C   │ A   │ T   │ X   │ Y   │
├─────┼─────┼─────┼─────┼─────┤
│ D   │ O   │ G   │ Z   │ W   │
├─────┼─────┼─────┼─────┼─────┤
│ F   │ I   │ S   │ H   │ Q   │
├─────┼─────┼─────┼─────┼─────┤
│ P   │ L   │ M   │ N   │ O   │
├─────┼─────┼─────┼─────┼─────┤
│ R   │ S   │ T   │ U   │ V   │
└─────┴─────┴─────┴─────┴─────┘

Co-authored by @surhud004 and GitHub Copilot. © 2026 -

About

Word Hunt Generator in JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published