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.
- 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.
- 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.
To generate a word hunt puzzle, call the generateWHG function with an array of words and a difficulty level:
generateWHG(["cat", "dog", "fish"], "easy");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
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 │
└─────┴─────┴─────┴─────┴─────┘