Skip to content

xmeltrut/WordSearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a6dd7c9 · Aug 9, 2016

History

18 Commits
Aug 9, 2016
Aug 9, 2016
May 22, 2016
Aug 9, 2016
May 22, 2016
Aug 9, 2016
Aug 9, 2016
Aug 9, 2016
Aug 9, 2016
May 22, 2016
May 22, 2016
May 22, 2016
May 22, 2016

Repository files navigation

Word Search

Build Status Latest Stable Version License

Word search generator written in PHP.

Features:

  • Supports multiple words and grid sizes
  • Supports horizontal and vertical words
  • Supports intersecting words
  • English and Finnish alphabets

Produces a grid for you to output, and list of answers.

HHEOÖ
EÖBAR
LSJFD
LLTOK
OPÖOU

Install

Install via Composer:

$ composer require xmeltrut/WordSearch "^1.0"

Usage

In English:

$puzzle = WordSearch\Factory::create(['foo', 'bar']);

In Finnish, with a custom grid size:

$puzzle = WordSearch\Factory::create(
    ['mansikka', 'omena', banaani'],
    10,
    'fi'
);

The Puzzle object contains a toArray method for the puzzle grid and an iterable WordList object with the answers in. You can use these to output the puzzle yourself, or use the HTML transformer.

$transformer = new WordSearch\Transformer\HtmlTransformer($puzzle);
echo $transformer->grid();
echo $transformer->wordList();

Development

Tests can be run via Ant:

ant

About

Word search generator written in PHP.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages