PHPackages                             tinusg/word-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tinusg/word-search

ActiveLibrary

tinusg/word-search
==================

Word search puzzle generator: hides words in an N×N grid in eight directions, with optional hidden message in the leftover cells

v1.0.0(1mo ago)12↓66.7%MITPHPPHP ^8.2

Since Jul 17Pushed 1mo agoCompare

[ Source](https://github.com/tinusg/word-search)[ Packagist](https://packagist.org/packages/tinusg/word-search)[ Docs](https://github.com/tinusg/word-search)[ RSS](/packages/tinusg-word-search/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Word Search
===========

[](#word-search)

Generate word search puzzles in pure PHP. Hides words in an N×N letter grid across all eight directions and returns the solution coordinates, so you can render the puzzle *and* the answer key.

- **Zero dependencies** — plain PHP 8.2+, no framework required
- **Deterministic** — pass a seed and get the same puzzle every time (great for shareable/permalink puzzles and tests)
- **Hidden message mode** — the leftover cells spell out a secret message in reading order
- **Quality-aware search** — backtracking placement with restarts guarantees a share of diagonal words instead of boring row-stacked grids

**See it in action:** the [Emoji](https://www.emojioneel.nl) (in Dutch) word search maker at [emojioneel.nl/woordzoeker](https://www.emojioneel.nl/woordzoeker).

Installation
------------

[](#installation)

```
composer require tinusg/word-search
```

Usage
-----

[](#usage)

```
use TinusG\WordSearch\WordSearchGrid;

$puzzle = new WordSearchGrid(
    size: 13,
    words: ['elephant', 'giraffe', 'penguin', 'crocodile', 'butterfly', /* … */],
);

$puzzle->grid();        // 13×13 array of single uppercase letters
$puzzle->placedWords(); // [['word' => 'ELEPHANT', 'cells' => [['row' => 2, 'col' => 5], …]], …]
$puzzle->wordList();    // sorted list of the words that made it into the grid
```

Words are normalized automatically: uppercased, deduplicated, and skipped when they contain non-A–Z characters, are shorter than 3 letters, or don't fit the grid. Supply more words than the target count and the generator picks a good mix.

### Reproducible puzzles

[](#reproducible-puzzles)

```
$puzzle = new WordSearchGrid(13, $words, seed: 20260717);
```

Same seed + same input = same puzzle. Handy for "puzzle of the day" pages and snapshot tests.

### Hidden message

[](#hidden-message)

Fill the unused cells with a secret message instead of random letters. Solvers find it by crossing out all the listed words and reading the leftovers:

```
$puzzle = new WordSearchGrid(13, $words, seed: 7, message: 'Happy birthday!');

$puzzle->encodedMessage(); // 'HAPPYBIRTHDAY' — letters only, as embedded
```

The generator runs an exact-cover style search so the placed words cover *every* cell except exactly the ones needed for the message. Throws `InvalidArgumentException` when the message is longer than the grid, and `RuntimeException` when no exact cover can be found for the given word pool — supply more (and more varied) words if that happens.

### Grid sizes

[](#grid-sizes)

Any size works. Sizes 11, 13, and 15 have tuned target word counts (10, 13, and 16 words); other sizes default to one word per row:

```
WordSearchGrid::targetWordCount(13); // 13
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

---

Special thanks to [Puzzelpedia](https://www.puzzelpedia.nl).

###  Health Score

38

—

LowBetter than 82% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2152919?v=4)[tinusg](/maintainers/tinusg)[@tinusg](https://github.com/tinusg)

---

Top Contributors

[![tinusg](https://avatars.githubusercontent.com/u/2152919?v=4)](https://github.com/tinusg "tinusg (2 commits)")

---

Tags

gamesword-searchword-search-generatorwordsearchwordsearch-generatewordsearch-puzzlegeneratorgamepuzzleword-searchwordsearchwoordzoeker

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tinusg-word-search/health.svg)

```
[![Health](https://phpackages.com/badges/tinusg-word-search/health.svg)](https://phpackages.com/packages/tinusg-word-search)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k123.7M828](/packages/symfony-maker-bundle)[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

3.0k32.7M126](/packages/simplesoftwareio-simple-qrcode)[phpowermove/docblock

PHP Docblock parser and generator. An API to read and write Docblocks.

2529.6M4](/packages/phpowermove-docblock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
